After the Oracle database password expires, you should use the SYSDBA account to connect, and then perform the following steps in sequence: ① Use the ALTER USER statement to reset the password; ② Use the WHENEVER FAILED statement to check whether the password has been reset; ③ Reconnect to the database, Use a new password; ④ (optional) Update the password file.
How to deal with Oracle database password expiration
Question:If the Oracle database password expires, How should this be handled?
Solution:
Step 1: Use a SYSDBA account to connect
For example:
sqlplus / as sysdba
Step 2: Reset password
ALTER USER
statement to reset the password.Syntax:
ALTER USER <用户名> IDENTIFIED BY <新密码>;
For example:
ALTER USER scott IDENTIFIED BY tiger;
Step 3: Check the password
WHENEVER FAILED
statement to check if the password has been reset.Syntax:
WHENEVER FAILED THEN RAISE_APPLICATION_ERROR(-20001,'密碼重置失敗。');
For example:
WHENEVER FAILED THEN RAISE_APPLICATION_ERROR(-20001,'密碼重置失敗。'); ALTER USER scott IDENTIFIED BY tiger;
Step 4: Reconnect
For example:
sqlplus scott/tiger
Step 5: Update password file (optional)
Command:
orapwd file=<密码文件名> password=<新密码>
For example:
orapwd file=orapw scott password=tiger
The above is the detailed content of What to do if the oracle database password expires. For more information, please follow other related articles on the PHP Chinese website!