ORA-28001: the password has expired解決方案,ora-28001expired

來源:互聯網
上載者:User

ORA-28001: the password has expired解決方案,ora-28001expired

Oracle提示錯誤訊息ORA-28001: the password has expired,是由於Oracle11G的新特性所致, Oracle11G建立使用者時預設密碼到期限制是180天(即6個月), 如果超過180天使用者密碼未做修改則該使用者無法登入。 Oracle公司是為了資料庫的安全性預設在11G中引入了這個預設功能,但是這個預設的功能很容易被DBA或者是開發人員給疏忽,一旦密碼180天未修改過,就會出現這樣的問題。
解決方案可通過如下SQL語句

注: 首先需要使用dba登入.
運行SQLPlus命令列工具, 輸入:
connect as sysdba;
輸入dba的使用者名稱和密碼後進行.

SELECT * FROM dba_profiles WHERE profile=’DEFAULT’ AND resource_name=’PASSWORD_LIFE_TIME’
查詢密碼的有效期間設定,LIMIT欄位是密碼有效天數。
在密碼將要到期或已經到期時可通過如下語句進行修改密碼,密碼修改後該使用者可正常串連資料庫。
ALTER USER 使用者名稱 IDENTIFIED BY 密碼 ;

如果想去除180天的密碼生存周期的限制可通過如下SQL語句將其關閉
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED
如上SQL語句將口令有效期間預設值180天修改成了“無限制”。但是出於資料庫安全性考慮,不建議將PASSWORD_LIFE_TIME值設定成UNLIMITED,建議大家定期修改資料庫使用者口令。

Oracle密碼到期the password has expired解決辦法

oracle 出現the password has expired這個問題,今天突然發現項目訪問不了,一查發現用不了,也登不進去,

這個問題由是Oracle11g密碼到期的原因導致的

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

java.sql.SQLException: ORA-28001: the password has expired
網上查了一下,串連Oracle,以Oracle使用者登陸,輸入以下命令

select * from dba_profiles where profile=’DEFAULT’ and resource_name=’PASSWORD_LIFE_TIME’;
結果顯示:

PROFILE RESOURCE_NAME RESOURCE_TYPE LIMIT

DEFAULT
PASSWORD_LIFE_TIME
PASSWORD
180

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

輸入命令:

alter profile default limit password_life_time unlimited;
commit;
再次執行:

select * from dba_profiles where profile=’DEFAULT’ and resource_name=’PASSWORD_LIFE_TIME’;
結果顯示為:

PROFILE RESOURCE_NAME RESOURCE_TYPE LIMIT

DEFAULT
PASSWORD_LIFE_TIME
PASSWORD

UNLIMITED

進行以上步驟之後需要改變密碼,否則還會出現password has expired異常

改變密碼的命令

alter user XXXUSER identified by Welcome1;
如果帳號被鎖住,則需要解鎖命令

alter user XXXUSER identified by oracle account unlock;
再次調試,問題解決

著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.