Oracle中password file orapwd的作用及说明(一)

2014-11-24 12:59:36 · 作者: · 浏览: 0
Oracle中password file orapwd的作用及说明
数据库没有启动之前,数据库内建用户是无法通过数据库来验证身份的
口令文件中存放sysdba/sysoper用户的用户名及口令
允许用户通过口令文件验证,在数据库未启动之前登陆
从而启动数据库
如果没有口令文件,在数据库未启动之前就只能通过操作系统认证.
使用Rman,很多时候需要在nomount,mount等状态对数据库进行处理
所以通常要求sysdba权限如果属于本地DBA组,可以通过操作系统认证登陆
如果是远程sysdba登陆,需要通过passwordfile认证.
1.remote_login_passwordfile = NONE
此时停用口令文件验证, Oracle数据库不允许远程SYSDBA/SYSOPER身份登录
无法通过远程进行数据库起停等操作管理
local:
[oracle@jumper oracle]$ sqlplus "/ as sysdba"
SQL*Plus: Release 9.2.0.3.0 - Production on Thu Apr 15 09:58:45 2004
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.3.0 - Production
SQL> alter user sys identified by oracle;
User altered.
SQL> show parameter pass
NAME TYPE VALUE
--------------------- ----------- ------------------------------
remote_login_passwordfile string NONE
remote:
E:\Oracle\ora92\bin>sqlplus /nolog
SQL*Plus: Release 9.2.0.4.0 -
Production on 星期四 4月 15 09:39:22 2004
Copyright (c) 1982, 2002, Oracle
Corporation. All rights reserved.
SQL> connect sys/oracle@hsjf as
sysdba
ERROR:
ORA-01017: invalid username/password; logon denied
此处实际上是无法通过口令文件验证
2.remote_login_passwordfile = exclusive
SQL> alter system set remote_login_passwordfile=exclusive scope=spfile;
System altered.
SQL> startup force;
ORACLE instance started.
Total System Global Area 131142648 bytes
Fixed Size 451576 bytes
Variable Size 104857600 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
SQL> show parameter pass
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile string EXCLUSIVE
SQL> alter user sys identified by oracle;
User altered.
remote:
E:\Oracle\ora92\bin>sqlplus /nolog
SQL*Plus: Release 9.2.0.4.0 -
Production on 星期四 4月 15 09:47:11 2004
Copyright (c) 1982, 2002, Oracle
Corporation. All rights reserved.
SQL> connect sys/oracle@hsjf as
sysdba
已连接。
SQL> show user
USER 为"SYS"
SQL>
这实际上就是通过口令文件验证登录的
3.进一步测试
如果此时我们删除passwdfile,sysdba/sysoper将无法认证,也就无法登陆数据库
Server:
SQL> !
[oracle@jumper oracle]$ cd $ORACLE_HOME/dbs
[oracle@jumper dbs]$ ls orapwhsjf
orapwhsjf
[oracle@jumper dbs]$ mv orapwhsjf orapwhsjf.bak
[oracle@jumper dbs]$
Remote:
E:\Oracle\ora92\bin>sqlplus /nolog
SQL*Plus: Release 9.2.0.4.0 - Production on 星期四 4月 15 09:50:14 2004
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> connect sys/oracle@hsjf as sysdba
ERROR:
ORA-01031: insufficient privileges
SQL>
这实际上就是无法通过口令文件验证身份
4.如果丢失了passwdfile
如果使用passwdfile却意外丢失,此时将不能启动数据库
SQL> startup force;
ORACLE instance started.
Total System Global Area 131142648 bytes
Fixed Size 451576 bytes
Variable Size 10485760