天天看點

連接配接oracle時報錯:ORA-28001: the password has expired

今天想啟動一下自己之前做的項目,結果就報使用者密碼過期的錯誤了,沒辦法,隻能處理了。

調試Web項目的時候出現異常:

  1. java.sql.SQLException: ORA-28001: the password has expired

網上查了一下,是Oracle11g密碼過期的原因

連接配接Oracle,以Oracle使用者登陸,輸入以下指令

  1. select * from dba_profiles where profile='DEFAULT' and resource_name='PASSWORD_LIFE_TIME';

結果顯示:

  1. PROFILE
  2. ------------------------------------------------------------
  3. RESOURCE_NAME
  4. ------------------------------------------------------------
  5. RESOURCE_TYPE
  6. ----------------
  7. LIMIT
  8. ------------------------------------------------------------
  9. DEFAULT
  10. PASSWORD_LIFE_TIME
  11. PASSWORD
  12. 180
  13. ------------------------------------------------------------

結果顯示密碼有效期是180天

輸入指令:

  1. alter profile default  limit password_life_time unlimited;
  2. commit;

再次執行:

  1. select * from dba_profiles where profile='DEFAULT' and resource_name='PASSWORD_LIFE_TIME';

結果顯示為:

  1. PROFILE
  2. ------------------------------------------------------------
  3. RESOURCE_NAME
  4. ------------------------------------------------------------
  5. RESOURCE_TYPE
  6. ----------------
  7. LIMIT
  8. ------------------------------------------------------------
  9. DEFAULT
  10. PASSWORD_LIFE_TIME
  11. PASSWORD
  12. UNLIMITED
  13. ------------------------------------------------------------
  1. alter user XXXUSER identified by Welcome1;
  1. alter user XXXUSER identified by oracle account unlock;