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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 1.7.2. 使用ORAPWD建立資料庫密碼檔案資料庫密碼
- 【密碼檔案】Oracle 18c orapwd 命令 OPW-00029: Password complexity failed密碼OracleAI
- Oracle 密碼檔案Oracle密碼
- Oracle:ASM & 密碼檔案OracleASM密碼
- Oracle優化案例-建立不成功的密碼檔案(二十七)Oracle優化密碼
- 管理(002):建立密碼檔案示例密碼
- Oracle 12c的DG自動同步密碼檔案--ASM 新特性:共享密碼檔案Oracle密碼ASM
- Linux基礎命令---htpasswd建立密碼檔案Linux密碼
- oracle orapwd使用說明Oracle
- Oracle19c orapwd修改密碼之後連線資料庫報ORA-12154Oracle密碼資料庫
- 1.7. 建立和維護資料庫密碼檔案資料庫密碼
- 用cli建立.vue檔案Vue
- 如何在 Linux 上用密碼加密和解密檔案Linux密碼加密解密
- SpringBoot專案配置檔案中密碼的加密Spring Boot密碼加密
- 重建共享(db或asm)密碼檔案 in Oracle 19c RAC-20220209ASM密碼Oracle
- Oracle 11g 重新建立控制檔案Oracle
- 管理(005):密碼檔案設定密碼
- Oracle Linux 7使用syslog來管理Oracle ASM的審計檔案OracleLinuxASM
- Nifty File Lists for mac檔案列表建立工具Mac
- python 建立密碼Python密碼
- PDF檔案有限制密碼,該如何編輯檔案?密碼
- oracle 19c建立非OMF檔案命名格式的PDBOracle
- Linux 下用 SCP 無需輸入密碼傳輸檔案Linux密碼
- 用 Git 來共享檔案Git
- 如何給PDF檔案設定密碼?密碼
- 1.6.5. 使用密碼檔案認證密碼
- dmg檔案建立工具:DropDMG for Mac中文版Mac
- 區域網訪問共享檔案需要密碼怎麼辦?取消區域網共享檔案訪問密碼的方法密碼
- 12c複製 RAC ASM中的密碼檔案到檔案系統ASM密碼
- shell指令碼技巧—建立和清空檔案指令碼
- 1.7.7. 檢視密碼檔案成員密碼
- 實用的檔案搜尋工具:ProFind for MacMac
- excelwin10版檔案密碼忘了怎麼辦_excelwin10版檔案密碼忘了如何開啟ExcelWin10密碼
- oracle dg庫資料檔案建立失敗ORA-01111Oracle
- oracle ORA-01189 ORA-01110(控制檔案建立報錯)Oracle
- ASM有自己的引數、密碼、alert、監聽檔案ASM密碼
- 用SpringMVC來簡單的操作Excel檔案SpringMVCExcel
- 建立.symlnk檔案
- Linux基礎命令---檢查密碼檔案pwckLinux密碼