oracle 11g 默認密碼過期時間爲180天,
密碼過期後,訪問數據庫會出現如下異常:
java.sql.SQLException: ORA-28001: the password has expired
查詢密碼過期設定:
select * from dba_profiles where profile='DEFAULT' and resource_name='PASSWORD_LIFE_TIME';
修改密碼過期爲:unlimited
alter profile default limit password_life_time unlimited;
將密碼設定修改爲unlimited後,可能繼續報the password has expired異常
此時,需修改密碼:
alter user user_name identified by password;
如果想繼續使用原來的密碼,可以將密碼修改爲另一個值後,再修改回來。
如果用戶被鎖定:java.sql.SQLException: ORA-28000: the account is locked
執行以下語句解除用戶鎖定:
alter user user_name account unlock;