[oracle@jumper dbs]$ cp orapwhsjf.bak orapw
[oracle@jumper dbs]$ exit
exit
SQL> alter database open;
Database altered.
SQL> show parameter passw
NAME TYPE VALUE
------------------------------------ ----------- ---------------
remote_login_passwordfile string SHARED
SQL>
很多人可能會產(chǎn)生有這樣的疑問,多個Exclusive的數(shù)據(jù)庫是否可以共享一個口令文件(orapw)呢?
繼續(xù)回到試驗中:
SQL> show parameter passwordNAME TYPE VALUE
------------------------------------ ----------- ---------------
remote_login_passwordfile string SHARED
[oracle@jumper dbs]$ strings orapw
]\[Z
ORACLE Remote Password file
INTERNAL
AB27B53EDC5FEF41
8A8F025737A9097A
注意這里僅記錄著INTERNAL/SYS的口令
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 235999908 bytes
Fixed Size 451236 bytes
Variable Size 201326592 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
SQL> !
[oracle@jumper bin]$ cd $ORACLE_HOME/dbs
[oracle@jumper dbs]$ strings orapw
]\[Z
ORACLE Remote Password file
HSJF
INTERNAL
AB27B53EDC5FEF41
8A8F025737A9097A
[oracle@jumper dbs]$ exit
exit
注意此處,以EXCLUSIVE方式啟動以后,實例名稱信息就會被寫入口令文件.
如果此時有其它實例以Exclusive模式啟動仍然可以使用這個口令文件,口令文件中的實例名稱同時被改寫.
這也就是說,數(shù)據(jù)庫只在啟動過程中才讀取口令文件,數(shù)據(jù)庫運行過程中并不鎖定該文件,類似于pfile/spfile文件.
SQL> select * from v$pwfile_users;USERNAME SYSDB SYSOP
------------------------------ ----- -----
SYS TRUE TRUE
SQL> grant sysdba to eygle;
Grant succeeded.
SQL> select * from v$pwfile_users;
USERNAME SYSDB SYSOP
------------------------------ ----- -----
SYS TRUE TRUE
EYGLE TRUE FALSE
SQL> !
[oracle@jumper bin]$ cd $ORACLE_HOME/dbs
[oracle@jumper dbs]$ strings orapw
]\[Z
ORACLE Remote Password file
HSJF
INTERNAL
AB27B53EDC5FEF41
8A8F025737A9097A
>EYGLE
B726E09FE21F8E83
注意:
在此處我們可以增加SYSDBA用戶,并且這些信息可以被寫入到口令文件。
如果我們在口令文件中增加了其他SYSDBA用戶,這個文件就不能被其它Exclusive的實例共享。
仔細(xì)了解過后,我們可以發(fā)覺,口令文件對于其他用戶來說其實就是啟到了一個sudo的作用。
6.重建口令文件
假如口令文件丟失,使用orapwd可以很方便的重建口令文件,詳細(xì)的語法如下:
[oracle@jumper oracle]$ orapwdUsage: orapwd file= password= entries= where
file - name of password file (mand),
password - password for SYS (mand),
entries - maximum number of distinct DBA and OPERs (opt),
There are no spaces around the equal-to (=) character.
本新聞共
3頁,當(dāng)前在第
3頁
1 2 3