口令檔案的作用及其重建小結
1,首先你要清楚口令檔案的作用, 當你透過遠端的方式去連線資料庫時,口令檔案會校驗使用者的密碼 是否正確,但是如果你是透過作業系統驗證,那口令檔案就不再起作用了 來看下面的驗證
[oracle@ENMOEDU dbs]$ sqlplus sys/oracle@ENMOEDU as sysdba #遠端方式登入
SQL*Plus: Release 11.2.0.3.0 Production on Sun Aug 17 22:25:08 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL*Plus: Release 11.2.0.3.0 Production on Sun Aug 17 22:25:08 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ENMOEDU dbs]$ sqlplus / as sysdba #作業系統驗證
SQL*Plus: Release 11.2.0.3.0 Production on Sun Aug 17 22:30:04 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SYS@ENMOEDU>
SQL*Plus: Release 11.2.0.3.0 Production on Sun Aug 17 22:30:04 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SYS@ENMOEDU>
2.接著我們們把口令檔案刪掉。口令檔案的命名格式 :orapw+例項名
[oracle@ENMOEDU dbs]$ pwd
/u01/app/oracle/product/11.2.0/dbhome_1/dbs
[oracle@ENMOEDU dbs]$ ls #紅色字是口令檔案
84pg6l6q_1_1 87pg6lh0_1_1 c-87396644-20140817-01 init.ora orapwenmoedu snapcf_ENMOEDU.f
86pg6lco_1_1 c-87396644-20140817-00 hc_ENMOEDU.dat lkENMOEDU orapwENMOEDU spfileENMOEDU.ora
/u01/app/oracle/product/11.2.0/dbhome_1/dbs
[oracle@ENMOEDU dbs]$ ls #紅色字是口令檔案
84pg6l6q_1_1 87pg6lh0_1_1 c-87396644-20140817-01 init.ora orapwenmoedu snapcf_ENMOEDU.f
86pg6lco_1_1 c-87396644-20140817-00 hc_ENMOEDU.dat lkENMOEDU orapwENMOEDU spfileENMOEDU.ora
[oracle@ENMOEDU dbs]$ rm orapwENMOEDU
3.再次驗證遠端方式和作業系統驗證兩種方式 發現遠端已經不能成功連線了 但作業系統仍然有效
[oracle@ENMOEDU dbs]$ sqlplus sys/oracle@ENMOEDU as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Sun Aug 17 22:32:55 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
ERROR:
ORA-01031: insufficient privileges
SQL*Plus: Release 11.2.0.3.0 Production on Sun Aug 17 22:32:55 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
ERROR:
ORA-01031: insufficient privileges
[oracle@ENMOEDU dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Sun Aug 17 22:35:14 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL*Plus: Release 11.2.0.3.0 Production on Sun Aug 17 22:35:14 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
4.要知道口令檔案是可以重建的 看下面過程
1)顯示建立密碼檔案工具的幫助資訊
oracle@ENMOEDU dbs]$ orapwd
Usage: orapwd file= entries= force= ignorecase= nosysdba=
where
file - name of password file (required),
password - password for SYS will be prompted if not specified at command line,
entries - maximum number of distinct DBA (optional),
force - whether to overwrite existing file (optional),
ignorecase - passwords are case-insensitive (optional),
nosysdba - whether to shut out the SYSDBA logon (optional Database Vault only).
There must be no spaces around the equal-to (=) character.
Usage: orapwd file=
where
file - name of password file (required),
password - password for SYS will be prompted if not specified at command line,
entries - maximum number of distinct DBA (optional),
force - whether to overwrite existing file (optional),
ignorecase - passwords are case-insensitive (optional),
nosysdba - whether to shut out the SYSDBA logon (optional Database Vault only).
There must be no spaces around the equal-to (=) character.
2)建立密碼檔案
[oracle@ENMOEDU dbs]$ orapwd file=orapwENMOEDU password=oracle entries=10 #entries 是說最多可以有多少擁有DBA角色的使用者
[oracle@ENMOEDU dbs]$ ls
84pg6l6q_1_1 87pg6lh0_1_1 c-87396644-20140817-01 init.ora orapwenmoedu snapcf_ENMOEDU.f
86pg6lco_1_1 c-87396644-20140817-00 hc_ENMOEDU.dat lkENMOEDU orapwENMOEDU spfileENMOEDU.ora
[oracle@ENMOEDU dbs]$ ls
84pg6l6q_1_1 87pg6lh0_1_1 c-87396644-20140817-01 init.ora orapwenmoedu snapcf_ENMOEDU.f
86pg6lco_1_1 c-87396644-20140817-00 hc_ENMOEDU.dat lkENMOEDU orapwENMOEDU spfileENMOEDU.ora
5.再次 遠端透過密碼驗證 成功登入
[oracle@ENMOEDU dbs]$ sqlplus sys/oracle@ENMOEDU as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Sun Aug 17 22:42:42 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SYS@ENMOEDU>
SQL*Plus: Release 11.2.0.3.0 Production on Sun Aug 17 22:42:42 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SYS@ENMOEDU>
總結 :1.口令檔案可有可無,一般情況下是有的
2.密碼檔案的格式: orapw+例項名 (也就是 .bash_profile 檔案中的 $ORACLE_SID =例項名)
3.注意建立口令檔案時,等號兩端不能有空格
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29654823/viewspace-1253405/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 重建口令檔案
- 口令檔案
- Oracle ----口令檔案Oracle
- 引數檔案/口令檔案
- JAVA註解的總結及其作用Java
- OS認證以及口令檔案的一點總結(轉)
- 重建控制檔案
- 重建控制檔案--
- Oracle 控制檔案的重建Oracle
- Oracle 建立口令檔案 orapwdOracle
- XML口令檔案描述 (轉)XML
- 重新認識口令檔案
- 微信小程式檔案作用域模組引用微信小程式
- 如何重建RAC的控制檔案
- ORACLE控制檔案的重建 (轉)Oracle
- Oracle重建控制檔案Oracle
- DataGuard重建控制檔案
- 重建/dev/null檔案devNull
- oracle 重建控制檔案Oracle
- ASM認證與口令檔案ASM
- Oracle OS 認證, 口令檔案Oracle
- unix口令檔案介紹(轉)
- os認證和口令檔案!
- 檔案包含漏洞小結
- 利用trace重建控制檔案
- 【口令檔案】remote_login_passwordfileREM
- 怎樣使用orapwd新建口令檔案
- os認證以及口令檔案的(引用warehouse的)
- 日誌檔案的修復小結
- oracle 控制檔案的修復小結Oracle
- 重建控制檔案的恢復(noresetlogs)
- PHP檔案包含小總結PHP
- RAC環境重建控制檔案
- 控制檔案重建以及備份
- Oracle基礎結構之OS驗證和口令檔案驗證Oracle
- 為oracle資料庫建立口令檔案Oracle資料庫
- Oracle 重建表(rename)注意事項小結Oracle
- Android Manifest.xml檔案的結構及作用AndroidXML