Oracle密碼檔案和登入方式
前言:
眾所周知Oracle資料庫有個密碼檔案,這個密碼檔案的作用就是當資料庫未啟動的時候,可以通過密碼驗證的方式登入資料庫並進行一系列的mount和open操作;
通過實驗的方式來瞭解ORACLE密碼檔案的建立和一些相關特性;
Oracle 密碼檔案
在CentOS 6.4下安裝Oracle 11gR2(x64)
Oracle 11gR2 在VMWare虛擬機器中安裝步驟
Debian 下 安裝 Oracle 11g XE R2
1、密碼檔案的路徑
Windows平台 $ORACLE_HOME\database
Linux平台 $ORACLE_HOME/dbs
2、密碼檔案的格式
windows平台 PWDsid.ora
Linux平台 orapwsid
3、密碼檔案的建立方式
ORAPWD FILE=filename [ENTRIES=numusers] [FORCE={Y|N}] [IGNORECASE={Y|N}]
相關參數:
Argument |
Description |
FILE |
Name to assign to the password file. You must supply a complete path. If you supply only a file name, the file is written to the current directory.(密碼檔案名稱,需要根據上面的格式命名) |
ENTRIES |
(Optional) Maximum number of entries (user accounts) to permit in the file. (有多少個sysdba,sysoper許可權使用者放到密碼檔案中去) |
FORCE |
(Optional) If y, permits overwriting an existing password file. (如果已經存在了密碼檔案,可以覆蓋) |
IGNORECASE |
(Optional) If y, passwords are treated as case-insensitive.(忽略大小寫,這個參數還需要跟SEC_CASE_SENSITIVE_LOGO參數關聯) |
例子: orapwd file=orapworcl password=oracle force=y
4、密碼檔案的認證方式有兩種,分別如下:
使用與作業系統整合的身分識別驗證
使用Oracle資料庫的密碼檔案進行身份認證
通過這兩種密碼認證的時候,涉及到兩個參數:
4.1 remote_login_passwordfile = none | exclusive |shared 位於$ORACLE_HOME/dbs/spfile$ORACLE_SID.ora參數檔案中
none : 不使密碼檔案認證,需要通過作業系統認證,即資料庫的特權使用者只能從作業系統進行登入
exclusive :要密碼檔案認證,自己獨佔使用(預設值)
shared :要密碼檔案認證,不同執行個體dba使用者可以共用密碼檔案
4.2 $ORACLE_HOME/network/admin/sqlnet.ora
SQLNET.AUTHENTICATION_SERVICES = none | all | ntf(windows)
none: 表示關閉作業系統認證,只能密碼認證
all : 用於linux或unix平台,關閉本機密碼檔案認證,採用作業系統認證,但遠程<異機>可以使用密碼檔案認證
nts : 用於windows平台
注意:當1和2都是none的情況下sys使用者將登陸不了(雖然不合理,但是經過實驗的驗證也確實如此)