Oracle的ORAPWD工具用來建立密碼檔案
擁有SYSDBA和SYSOPER許可權的使用者,可以執行類似CREATE DATABASE、DROP DATABASE、RECOVER、STARTUP、SHUTDOWN之類的操作。這兩個許可權不但很高,而且很特殊。因為這些使用者不能透過資料庫進行驗證。當資料庫關閉後,如果一個擁有SYSDBA許可權的使用者要啟動資料庫,那麼這個使用者的驗證肯定要放在資料庫之外。
因此Oracle提高了作業系統驗證和密碼檔案驗證兩種方式。而ORAPWD正是Oracle用來生成密碼檔案的工具。
密碼檔案一般放在ORACLE_HOME/dbs目錄下,對於WINDOWS環境,則是ORACLE_HOMEdatabase目錄。檔名稱為orapw + $ORACLE_SID。
這個命令很簡單:
$ orapwd -h
Usage: orapwd file=
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.
建立密碼檔案可以重新設定SYS使用者的密碼:
$ sqlplus /nolog
SQL*Plus: Release 9.2.0.4.0 - Production on 星期五 4月 10 01:44:03 2009
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> conn sys/abc@bjtest as sysdba
ERROR:
ORA-01017: invalid username/password; logon denied
SQL> conn sys/test@bjtest as sysdba已連線。
SQL> exit從Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production中斷開
可以看到指定bjtest服務名的時候,是沒有使用作業系統驗證的,可以看到目前SYS使用者的密碼是TEST。
下面透過ORAPWD工具新建一個密碼檔案,指定一個新的密碼:
$ cd $ORACLE_HOME/dbs
$ mv orapwbjtest orapwbjtest.bak
$ orapwd file=orapwbjtest password=newpasswd entries=100
其中password用來設定SYS使用者密碼,而entries表示密碼檔案中可以儲存多少條記錄。需要注意,這個值並不是一個確切的數量,真正可以儲存的記錄數可能會有所出入,這和1個作業系統塊能儲存多少條記錄有關係。
下面看看新密碼是否生效:
$ sqlplus /nolog
SQL*Plus: Release 9.2.0.4.0 - Production on 星期五 4月 10 01:45:50 2009
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> conn sys/test@bjtest as sysdba
ERROR:
ORA-01031: insufficient privileges
SQL> conn sys/newpasswd@bjtest as sysdba
ERROR:
ORA-01031: insufficient privileges
SQL> conn / as sysdba已連線。
SQL> shutdown immediate資料庫已經關閉。已經解除安裝資料庫。
ORACLE例程已經關閉。
SQL> startup
ORACLE例程已經啟動。
Total System Global Area 9432971568 bytes
Fixed Size 756016 bytes
Variable Size 838860800 bytes
Database Buffers 8589934592 bytes
Redo Buffers 3420160 bytes資料庫裝載完畢。資料庫已經開啟。
SQL> conn sys/test@bjtest as sysdba
ERROR:
ORA-01017: invalid username/password; logon denied
警告: 您不再連線到 ORACLE。
SQL> conn sys/newpasswd@bjtest as sysdba已連線。
可以看到將原有的密碼檔案替換後,新的密碼檔案並不會當時生效,從返回的錯誤ORA-1031也可以看出這個問題。
需要Oracle重新啟動,載入新的密碼檔案後才可以生效,這是SYS密碼已經變為新設定的密碼了。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/11411056/viewspace-733448/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- orapwd 工具建立密碼檔案遵守的命名方法密碼
- Oracle 建立口令檔案 orapwdOracle
- 1.7.2. 使用ORAPWD建立資料庫密碼檔案資料庫密碼
- 建立oracle 密碼檔案Oracle密碼
- orapwd建立密碼及驗證方法密碼
- ORACLE 8I 建立密碼檔案!Oracle密碼
- Oracle工具——ORAPWDOracle
- 建立密碼檔案 -ORA-01031 ,orapwd file=orapw$ORACLE_SID password=sys entries=10密碼Oracle
- Oracle密碼檔案的建立、使用和維護 (zt)Oracle密碼
- 【密碼檔案】Oracle 18c orapwd 命令 OPW-00029: Password complexity failed密碼OracleAI
- Oracle 密碼檔案Oracle密碼
- Oracle:ASM & 密碼檔案OracleASM密碼
- 關於ORACLE作業系統認證和ORAPWD密碼檔案認證SYSDBA許可權Oracle作業系統密碼
- oracle 關於--密碼檔案Oracle密碼
- 關於oracle 密碼檔案Oracle密碼
- 管理(002):建立密碼檔案示例密碼
- Oracle優化案例-建立不成功的密碼檔案(二十七)Oracle優化密碼
- Oracle密碼檔案的作用和說明Oracle密碼
- Oracle 12c的DG自動同步密碼檔案--ASM 新特性:共享密碼檔案Oracle密碼ASM
- Linux基礎命令---htpasswd建立密碼檔案Linux密碼
- oracle本地驗證和密碼檔案Oracle密碼
- ORACLE密碼檔案和登入方式Oracle密碼
- oracle密碼檔案起什麼作用Oracle密碼
- oracle orapwd OPW-00001 無法開啟口令檔案Oracle
- 怎樣使用orapwd新建口令檔案
- 關於密碼檔案,SYS密碼密碼
- rac中的密碼檔案密碼
- 1.7. 建立和維護資料庫密碼檔案資料庫密碼
- 重建oracle密碼檔案pwd+sid.oraOracle密碼
- Oracle資料庫密碼檔案的使用和維護(轉)Oracle資料庫密碼
- 測試 oracle 密碼檔案在何時起作用Oracle密碼
- MYSQL建立使用者時用密文密碼MySql密碼
- 誤刪除$ORACLE_HOME/dbs下的引數檔案、密碼檔案,如何快速重建Oracle密碼
- 用cli建立.vue檔案Vue
- Oracle釋出密碼工具補預設密碼漏洞(轉)Oracle密碼
- RAC環境中的密碼檔案密碼
- 破解cisco配置檔案密碼密碼
- 密碼檔案資訊總結密碼