溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

oracle修改用戶密碼的方法

發(fā)布時間:2020-08-11 22:13:19 來源:ITPUB博客 閱讀:145 作者:零度的雨1205 欄目:關系型數據庫

修改oracle用戶的密碼有以下方法:

普通用戶  

(1)通過alter user語法來進行修改 ,這也是最常見的方式:

oracle修改用戶密碼的方法

(2) 第二種方式,是通過password命令來修改:

oracle修改用戶密碼的方法


從安全性角度來說 ,推薦大家通過第二種方式來修改用戶密碼,這樣可防止明文密碼泄露。


sys用戶

另外關于sys用戶密碼,不要使用password以及alter user 方式去修改,原因主要如下:

(1) 當REMOTE_LOGIN_PASSWORDFILE參數設置為shared時,我們使用alter user 修改sys密碼時,會報

ORA-28046: Password change for SYS disallowed error.

測試如下:

oracle修改用戶密碼的方法


(2) 大多數內部遞歸SQL都使用SYS用戶。因此,如果您試圖在數據庫打開時使用ALTER USER語句更改此密碼,則可能會導致死鎖。


因此,對于sys用戶我們需要使用orapwd來進行修改:

[oracle@orcl dbs]$ orapwd file='orapworcl' entries=5 force=y       這里注意等號左右不能有空格;


關于orapwd說明引用官網,如下:

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.


FILE

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

orapw ORACLE_SID

ORACLE_HOME /dbs

Windows

PWD ORACLE_SID .ora

ORACLE_HOME \database


For example, for a database instance with the SID  orcldw , the password file must be named  orapworcldw  on Linux and  PWDorcldw.ora  on Windows.

In an Oracle Real Application Clusters environment on a platform that requires an environment variable to be set to the path of the password file, the environment variable for each instance must point to the same password file.

Caution:

It is critically important to the security of your system that you protect your password file and the environment variables that identify the location of the password file. Any user with access to these could potentially compromise the security of the connection.
ENTRIES

This argument specifies the number of entries that you require the password file to accept. This number corresponds to the number of distinct users allowed to connect to the database as  SYSDBA  or  SYSOPER . The actual number of allowable entries can be higher than the number of users, because the  ORAPWD  utility continues to assign password entries until an operating system block is filled. For example, if your operating system block size is 512 bytes, it holds four password entries. The number of password entries allocated is always a multiple of four.

Entries can be reused as users are added to and removed from the password file. If you intend to specify  REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE , and to allow the granting of  SYSDBA  and  SYSOPER  privileges to users, this argument is required.

Caution:

When you exceed the allocated number of password entries, you must create a new password file. To avoid this necessity, allocate more entries than you think you will ever need.
FORCE

This argument, if set to  Y , enables you to overwrite an existing password file. An error is returned if a password file of the same name already exists and this argument is omitted or set to  N .

IGNORECASE

If this argument is set to  y , passwords are case-insensitive. That is, case is ignored when comparing the password that the user supplies during login with the password in the password file.


向AI問一下細節(jié)

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI