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:
<code>sqlplus / as sysdba</code>
Step 2: Reset password
ALTER USER
statement to reset the password. Syntax:
<code>ALTER USER <用户名> IDENTIFIED BY <新密码>;</code>
For example:
<code>ALTER USER scott IDENTIFIED BY tiger;</code>
Step 3: Check the password
WHENEVER FAILED
statement to check if the password has been reset. Syntax:
<code>WHENEVER FAILED THEN RAISE_APPLICATION_ERROR(-20001,'密碼重置失敗。');</code>
For example:
<code>WHENEVER FAILED THEN RAISE_APPLICATION_ERROR(-20001,'密碼重置失敗。'); ALTER USER scott IDENTIFIED BY tiger;</code>
Step 4: Reconnect
For example:
<code>sqlplus scott/tiger</code>
Step 5: Update password file (optional)
Command:
<code>orapwd file=<密码文件名> password=<新密码></code>
For example:
<code>orapwd file=orapw scott password=tiger</code>
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!