【引數】REMOTE_LOGIN_PASSWORDFILE引數三種取值及其行為特性分析
在某些情況下可以使用REMOTE_LOGIN_PASSWORDFILE引數增強系統的安全性,所謂提高安全性就是禁止以SYSDBA或SYSOPER特權使用者從客戶端登陸到資料庫系統中。這是一種犧牲管理便捷性為前提的。需酌情使用。
本文主要闡述REMOTE_LOGIN_PASSWORDFILE引數的三種取值及對系統的影響。
1. 參考資訊
官方文件中有關REMOTE_LOGIN_PASSWORDFILE引數的描述:
2. REMOTE_LOGIN_PASSWORDFILE引數預設值及其行為特性分析
1)REMOTE_LOGIN_PASSWORDFILE引數的預設值是EXCLUSIVE
sys@ora10g> show parameter REMOTE_LOGIN_PASSWORDFILE
NAME TYPE VALUE
-------------------------- ---------- ----------------------
remote_login_passwordfile string EXCLUSIVE
2)嘗試將SYSDBA特權授予給普通使用者secooler
sys@ora10g> grant sysdba to secooler;
grant sysdba to secooler
*
ERROR at line 1:
ORA-01994: GRANT failed: password file missing or disabled
此處報錯是由於密碼檔案丟失導致的,因為授予sysdba許可權需要調整密碼檔案。
3)手工建立丟失的密碼檔案
ora10g@secdb /home/oracle$ cd $ORACLE_HOME/dbs
ora10g@secdb /oracle/app/oracle/product/10.2.0/db_1/dbs$
ora10g@secdb /oracle/app/oracle/product/10.2.0/db_1/dbs$ orapwd file=orapwora10g password=oracle entries=10
4)再次嘗試SYSDBA授權成功
sys@ora10g> grant sysdba to secooler;
Grant succeeded.
5)密碼檔案的變化
此時在密碼檔案中記錄了這個授權的資訊。
ora10g@secdb /oracle/app/oracle/product/10.2.0/db_1/dbs$ strings orapwora10g
]\[Z
ORACLE Remote Password file
INTERNAL
AB27B53EDC5FEF41
8A8F025737A9097A
SECOOLER
034E4342BB2D437D
最後兩行資訊即是新增的內容。
6)客戶端連線性測試
$ sqlplus secooler/secooler@ora10g as sysdba
SQL*Plus: Release 10.2.0.3.0 - Production on 星期二 12月 21 21:48:34 2010
Copyright (c) 1982, 2006, Oracle.? All Rights Reserved.
連線到:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
SQL> show user;
USER 為 "SYS"
SQL>
注意,此處我們雖然使用的是普通使用者secooler登入的資料庫,但真實的使用者名稱是SYS。因此我們便可以使用這種方法來管理資料庫,這就是便捷所在。
7)人為移除密碼檔案測試
如果此時我們將密碼檔案刪除,客戶端將沒有辦法再以sysdba許可權連線到資料庫
$ sqlplus secooler/secooler@ora10g as sysdba
SQL*Plus: Release 10.2.0.3.0 - Production on 星期二 12月 21 21:53:50 2010
Copyright (c) 1982, 2006, Oracle.? All Rights Reserved.
ERROR:
ORA-01031: insufficient privileges
請輸入使用者名稱:
因此,透過REMOTE_LOGIN_PASSWORDFILE引數和密碼檔案共同實現了客戶端以SYSDBA許可權登入系統的目的。
3. REMOTE_LOGIN_PASSWORDFILE引數NONE值及其行為特性分析
1)調整引數REMOTE_LOGIN_PASSWORDFILE為NONE
sys@ora10g> alter system set remote_login_passwordfile=none scope=spfile;
System altered.
sys@ora10g> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
sys@ora10g> startup;
ORACLE instance started.
Total System Global Area 835104768 bytes
Fixed Size 2257840 bytes
Variable Size 549456976 bytes
Database Buffers 281018368 bytes
Redo Buffers 2371584 bytes
Database mounted.
Database opened.
sys@ora10g> show parameter REMOTE_LOGIN_PASSWORDFILE
NAME TYPE VALUE
-------------------------- ---------- ----------------------
remote_login_passwordfile string NONE
2)調整後,客戶端將無法發起連線
$ sqlplus secooler/secooler@ora10g as sysdba
SQL*Plus: Release 10.2.0.3.0 - Production on 星期二 12月 21 22:00:02 2010
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
請輸入使用者名稱:
3)SYSDBA許可權的授予與回收亦是被禁止的
(1)授權測試
sys@ora10g> grant sysdba to secooler;
grant sysdba to secooler
*
ERROR at line 1:
ORA-01994: GRANT failed: password file missing or disabled
注意,此處的報錯原因是不是因為密碼檔案不存在,與前面曾經提到的報錯資訊有區別。
(2)回收測試
sys@ora10g> revoke sysdba from secooler;
Revoke succeeded.
此處雖然提示許可權回收成功,但是實際上並沒有生效,是無效操作。證明之。
<1>在此基礎上調整引數為EXCLUSIVE
sys@ora10g> alter system set remote_login_passwordfile=EXCLUSIVE scope=spfile;
System altered.
sys@ora10g> startup force;
ORACLE instance started.
Total System Global Area 835104768 bytes
Fixed Size 2257840 bytes
Variable Size 549456976 bytes
Database Buffers 281018368 bytes
Redo Buffers 2371584 bytes
Database mounted.
Database opened.
<2>此時客戶端依然能夠成功登陸
$ sqlplus secooler/secooler@172.17.193.211ora10g as sysdba
SQL*Plus: Release 10.2.0.3.0 - Production on 星期二 12月 21 22:06:05 2010
Copyright (c) 1982, 2006, Oracle.? All Rights Reserved.
連線到:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
SQL> show user
USER 為 "SYS"
SQL>
SQL> show parameter REMOTE_LOGIN_PASSWORDFILE
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile string EXCLUSIVE
結論:因此證明了當REMOTE_LOGIN_PASSWORDFILE引數為NONE時回收SYSDBA許可權是無效的。
4.REMOTE_LOGIN_PASSWORDFILE引數SHARED值及其行為特性分析
1)調整引數REMOTE_LOGIN_PASSWORDFILE為SHARED
sys@ora10g> alter system set remote_login_passwordfile=shared scope=spfile;
System altered.
sys@ora10g> startup force;
ORACLE instance started.
Total System Global Area 835104768 bytes
Fixed Size 2257840 bytes
Variable Size 549456976 bytes
Database Buffers 281018368 bytes
Redo Buffers 2371584 bytes
Database mounted.
Database opened.
sys@ora10g> show parameter remote_login_passwordfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile string SHARED
2)此時客戶端的連線是不受限制的,連線通暢
$ sqlplus secooler/secooler@ora10g as sysdba
SQL*Plus: Release 10.2.0.3.0 - Production on 星期二 12月 21 22:08:04 2010
Copyright (c) 1982, 2006, Oracle.? All Rights Reserved.
連線到:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
SQL>
SQL> show user
USER 為 "SYS"
3)此時伺服器端授予和回收SYSDBA許可權是不被允許的
sys@ora10g> grant sysdba to secooler;
grant sysdba to secooler
*
ERROR at line 1:
ORA-01999: password file cannot be updated in SHARED mode
sys@ora10g> revoke sysdba from secooler;
revoke sysdba from secooler
*
ERROR at line 1:
ORA-01999: password file cannot be updated in SHARED mode
5.小結
在此總結一下在REMOTE_LOGIN_PASSWORDFILE引數取不同值時的行為特性。REMOTE_LOGIN_PASSWORDFILE引數可以有三種取值:EXCLUSIVE(預設)、NONE和SHARED。
1)當取值為EXCLUSIVE時
允許客戶端以SYSDBA或SYSOPER許可權登入到資料庫例項中完成資料庫管理操作;
允許授予和回收SYSDBA或SYSOPER許可權。
2)當取值為NONE時
禁止客戶端以SYSDBA或SYSOPER許可權登入到資料庫例項中完成資料庫管理操作;
禁止授予和回收SYSDBA或SYSOPER許可權。
3)當取值為SHARED時
允許客戶端以SYSDBA或SYSOPER許可權登入到資料庫例項中完成資料庫管理操作;
禁止授予和回收SYSDBA或SYSOPER許可權。
以上便是引數REMOTE_LOGIN_PASSWORDFILE在不同取值情況下對系統的影響(本文是以SYSDBA特權為例,SYSOPER特權相同)。每一種取值都有其自己的應用場景。我們需要做的是根據不同的場景做出相應的取捨。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31397003/viewspace-2216819/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 從引數取值看Oracle OMF特性Oracle
- Remote_login_passwordfile引數探究REM
- 關於REMOTE_LOGIN_PASSWORDFILE引數REM
- 初始化引數REMOTE_LOGIN_PASSWORDFILEREM
- python使用引數對巢狀字典進行取值Python巢狀
- Java(三)引數Java
- Swift語言中為外部引數設定預設值可變引數常量引數變數引數輸入輸出引數Swift變數
- kettle 引數——變數引數和常量引數變數
- REMOTE_LOGIN_PASSWORDFILE引數和ORAPW密碼檔案REM密碼
- Ceph配置引數分析
- 引數匹配順序——Python學習之引數(三)Python
- Oracle引數檔案解析——引數檔案分析獲取Oracle
- springmvc引數型別轉換三種方式SpringMVC型別
- 10g中的optimizer_mode引數的取值
- oracle ASM引數ASM_POWER_LIMIT以及其它一些引數詳解OracleASMMIT
- Oracle引數-隱藏引數Oracle
- JavaScript replace()第二個引數為函式時的引數JavaScript函式
- 三種方法實現:獲取 url 中的引數
- 什麼是請求引數、表單引數、url引數、header引數、Cookie引數?一文講懂HeaderCookie
- SpringMVC學習(三)對映請求引數&請求引數SpringMVC
- 《深入解析Oracle》第三章,引數及引數檔案Oracle
- GET請求引數為中文時亂碼分析
- c# 方法引數_值引數C#
- c# 方法引數_引用引數C#
- 動態引數,靜態引數
- 開啟歸檔模式及其相關引數模式
- C#中的值引數,引用引數及輸出引數C#
- SQL Server效能分析引數 (轉)SQLServer
- CUDA __global__ function 引數分析Function
- Swift學習筆記(三十三)——常量引數,變數引數和inout引數Swift筆記變數
- python疑問5:位置引數,預設引數,可變引數,關鍵字引數,命名關鍵字引數區別Python
- 通過行為引數化傳遞程式碼
- JavaScript形式引數和實際引數JavaScript
- Oracle引數檔案解析——引數解析Oracle
- c#方法引數_輸出引數C#
- c# 方法引數_陣列引數C#陣列
- js判斷引數是否為非數字JS
- 把物件作為引數(轉)物件