修改oracle用戶(hù)的密碼有以下方法:

普通用戶(hù)
(1)通過(guò)alter user語(yǔ)法來(lái)進(jìn)行修改 ,這也是最常見(jiàn)的方式:

(2) 第二種方式,是通過(guò)password命令來(lái)修改:

從安全性角度來(lái)說(shuō) ,推薦大家通過(guò)第二種方式來(lái)修改用戶(hù)密碼,這樣可防止明文密碼泄露。
sys用戶(hù)
另外關(guān)于sys用戶(hù)密碼,不要使用password以及alter user 方式去修改,原因主要如下:
(1) 當(dāng)REMOTE_LOGIN_PASSWORDFILE參數(shù)設(shè)置為shared時(shí),我們使用alter user 修改sys密碼時(shí),會(huì)報(bào)
ORA-28046: Password change for SYS disallowed error.
測(cè)試如下:

(2) 大多數(shù)內(nèi)部遞歸SQL都使用SYS用戶(hù)。因此,如果您試圖在數(shù)據(jù)庫(kù)打開(kāi)時(shí)使用ALTER USER語(yǔ)句更改此密碼,則可能會(huì)導(dǎo)致死鎖。
因此,對(duì)于sys用戶(hù)我們需要使用orapwd來(lái)進(jìn)行修改:
[oracle@orcl dbs]$ orapwd file='orapworcl' entries=5 force=y 這里注意等號(hào)左右不能有空格;
關(guān)于orapwd說(shuō)明引用官網(wǎng),如下:
| 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. |
FORCE
| (Optional) If
y
, permits overwriting an existing password file.
|
IGNORECASE
| (Optional) If
y
, passwords are treated as case-insensitive.
|
This argument sets the name of the password file being created. You must specify the full path name for the file. This argument is mandatory.
The file name required for the password file is operating system specific. Some operating systems require the password file to adhere to a specific format and be located in a specific directory. Other operating systems allow the use of environment variables to specify the name and location of the password file.
Table 1-1 lists the required name and location for the password file on the UNIX, Linux, and Windows platforms. For other platforms, consult your platform-specific documentation.
Table 1-1 Required Password File Name and Location on UNIX, Linux, and Windows
| Platform | Required Name | Required Location) |
|---|---|---|
UNIX and Linux |
| ORACLE_HOME
|
Windows |
| ORACLE_HOME
|
網(wǎng)站標(biāo)題:oracle修改用戶(hù)密碼的方法-創(chuàng)新互聯(lián)
網(wǎng)址分享:http://www.chinadenli.net/article38/dcdppp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站制作、小程序開(kāi)發(fā)、虛擬主機(jī)、用戶(hù)體驗(yàn)、定制開(kāi)發(fā)、電子商務(wù)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話(huà):028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容