您好,登錄后才能下訂單哦!
本篇文章為大家展示了初始化參數(shù)REMOTE_LOGIN_PASSWORDFILE設置Oracle數(shù)據(jù)庫的密碼驗證方式是什么,內容簡明扼要并且容易理解,絕對能使你眼前一亮,通過這篇文章的詳細介紹希望你能有所收獲。
初始化參數(shù)REMOTE_LOGIN_PASSWORDFILE設置Oracle數(shù)據(jù)庫的密碼驗證方式。
這個參數(shù)最常見的設置為EXCLUSIVE,這也是數(shù)據(jù)庫的默認設置:
bash-3.00$ ls -l orapwtest1
-rw-r----- 1 oracle oinstall 1536 Apr 14 14:12 orapwtest1
bash-3.00$ export ORACLE_SID=test1
bash-3.00$ sqlplus "/ as sysdba"
SQL*Plus: Release 11.1.0.6.0 - Production on 星期四 4月 16 17:23:32 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
連接到:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> show parameter remote_login
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile string EXCLUSIVE
SQL> grant sysdba to test;
授權成功。
SQL> host
$ cd $ORACLE_HOME/dbs
$ ls -l orapwtest1
-rw-r----- 1 oracle oinstall 1536 Apr 16 17:24 orapwtest1
$ strings orapwtest1
Z[\]
ORACLE Remote Password file
INTERNAL
8D7F004CD7D32C58
D3CE9AB10E42F19D
TEST
7A0F2B316C212D67
如果將REMOTE_LOGIN_PASSWORDFILE設置為NONE,則禁止密碼文件驗證方式,添加SYSDBA權限的時候系統(tǒng)會報錯:
$ exit
SQL> conn test/test@test1 as sysdba
已連接。
SQL> alter system set remote_login_passwordfile = none scope = spfile sid = 'test1';
系統(tǒng)已更改。
SQL> shutdown immediate
數(shù)據(jù)庫已經關閉。
已經卸載數(shù)據(jù)庫。
ORACLE 例程已經關閉。
SQL> conn test/test@test1 as sysdba
ERROR:
ORA-12514: TNS: 監(jiān)聽程序當前無法識別連接描述符中請求的服務
SQL> conn / as sysdba
已連接到空閑例程。
SQL> startup
ORACLE 例程已經啟動。
Total System Global Area 776896512 bytes
Fixed Size 2098776 bytes
Variable Size 212523432 bytes
Database Buffers 557842432 bytes
Redo Buffers 4431872 bytes
數(shù)據(jù)庫裝載完畢。
數(shù)據(jù)庫已經打開。
SQL> grant sysoper to test;
grant sysoper to test
*
第 1 行出現(xiàn)錯誤:
ORA-01994: GRANT 失敗: 口令文件缺失或已禁用
SQL> show parameter remote_login
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile string NONE
可以看到將REMOTE_LOGIN_PASSWORDFILE設置為NONE,嘗試使用密碼文件驗證方式登陸會失敗,且授權或回收SYSDBA、SYSOPER權限會失敗。
如果將REMOTE_LOGIN_PASSWORDFILE設置為SHARED,則任何使用這個密碼文件的數(shù)據(jù)庫都不能進行授權回收SYSDBA、SYSOPER權限的操作,但是這些數(shù)據(jù)庫可以使用這個密碼文件來進行驗證。
這種方式一般用于管理RAC數(shù)據(jù)庫,或者同一臺服務器上的多個不同數(shù)據(jù)庫實例。
下面看一下將REMOTE_LOGIN_PASSWORDFILE設置為SHARED的情況:
SQL> alter system set remote_login_passwordfile = shared scope = spfile sid = 'test1';
系統(tǒng)已更改。
SQL> shutdown immediate
數(shù)據(jù)庫已經關閉。
已經卸載數(shù)據(jù)庫。
ORACLE 例程已經關閉。
SQL> conn / as sysdba
已連接到空閑例程。
SQL> startup
ORACLE 例程已經啟動。
Total System Global Area 776896512 bytes
Fixed Size 2098776 bytes
Variable Size 212523432 bytes
Database Buffers 557842432 bytes
Redo Buffers 4431872 bytes
數(shù)據(jù)庫裝載完畢。
數(shù)據(jù)庫已經打開。
SQL> conn test/test@test1 as sysdba
已連接。
SQL> grant sysoper to test;
grant sysoper to test
*
第 1 行出現(xiàn)錯誤:
ORA-01999: 口令文件不能在 SHARED 模式下更新
SQL> show parameter remote_login
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile string SHARED
SQL> exit
從 Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options 斷開
bash-3.00$ mv orapwractest1 orapwractest1.bak
bash-3.00$ ln orapwtest1 orapwractest1
bash-3.00$ ls -l orapwractest1
-rw-r----- 2 oracle oinstall 1536 Apr 16 17:24 orapwractest1
bash-3.00$ export ORACLE_SID=ractest1
bash-3.00$ sqlplus "/ as sysdba"
SQL*Plus: Release 11.1.0.6.0 - Production on 星期四 4月 16 18:07:35 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
已連接到空閑例程。
SQL> startup
ORACLE 例程已經啟動。
Total System Global Area 1603887104 bytes
Fixed Size 2095208 bytes
Variable Size 741722008 bytes
Database Buffers 855638016 bytes
Redo Buffers 4431872 bytes
數(shù)據(jù)庫裝載完畢。
數(shù)據(jù)庫已經打開。
SQL> conn test/test@ractest1 as sysdba
已連接。
SQL> grant sysoper to test1;
grant sysoper to test1
*
第 1 行出現(xiàn)錯誤:
ORA-01917: 用戶或角色 'TEST1' 不存在
SQL> grant sysoper to test;
授權成功。
SQL> conn test/test@test1 as sysoper
已連接。
可以看到使用SHARED方式啟動的數(shù)據(jù)庫,可以利用密碼文件進行驗證,但是不能授權或回收SYSDBA和SYSOPER權限。
隨后,啟動另一個數(shù)據(jù)庫,且將這個數(shù)據(jù)庫的密碼文件指向剛才test數(shù)據(jù)庫所使用的密碼文件,這樣兩個數(shù)據(jù)庫就共享了同一個密碼文件了。
不過對于TEST數(shù)據(jù)庫,采用了SHARED方式,因此不能執(zhí)行SYSDBA和SYSOPER的授權,而對于RACTEST數(shù)據(jù)庫,采用了默認的REMOTE_LOGIN_PASSWORDFILE設置,因此可以對這個密碼文件進行修改,而這個修改在另外的數(shù)據(jù)庫中,可以馬上生效。
如果將RACTEST數(shù)據(jù)庫也設置為SHARED方式啟動,那么沒有數(shù)據(jù)庫可以修改這個密碼文件了。
上述內容就是初始化參數(shù)REMOTE_LOGIN_PASSWORDFILE設置Oracle數(shù)據(jù)庫的密碼驗證方式是什么,你們學到知識或技能了嗎?如果還想學到更多技能或者豐富自己的知識儲備,歡迎關注億速云行業(yè)資訊頻道。
免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經查實,將立刻刪除涉嫌侵權內容。