ORA-28001: the password has expired 解決

來源:互聯網
上載者:User

ORA-28001: the password has expired 解決

ORA-28001: the password has expired
Cause: The user"s account has expired and the password needs to be changed
Action: change the password or contact the DBA

程式串連DB伺服器時報錯:
13-04-22 17:32:15 [ERROR] com.sohu.game.Main {Main.java:102} - 統計失敗:
java.sql.SQLException: ORA-28001: the password has expired

        at Oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
        at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
        at oracle.jdbc.ttc7.O3log.receive2nd(O3log.java:496)

解決方案:
 查看帳號的資訊:
SQL> select USERNAME,ACCOUNT_STATUS,LOCK_DATE,EXPIRY_DATE,password,CREATED from dba_users where username=upper('xxx ');

USERNAME      ACCOUNT_ST LOCK_DATE    EXPIRY_DATE            CREATED
-------------------- ---------- -------------------- ------------------- ------------------------------ -------------------
xxx                EXPIRED      2013-04-22 14:44:43      2012-10-17 14:20:15

 查看帳號的PASSWORD_LIFE_TIME設定:
SQL> select * from dba_profiles where profile like '%xxx%';
PROFILE              RESOURCE_NAME                    RESOURCE LIMIT
------------------------------ -------------------------------- -------- ----------------------------------------
PF_xxx      PASSWORD_LIFE_TIME              PASSWORD DEFAULT
 查看系統PROFILE檔案的預設設定:
SQL> select * from dba_profiles where profile like '%DEFAULT%';
PROFILE          RESOURCE_NAME                    RESOURCE LIMIT
------------------------------ -------------------------------- -------- ----------------------------------------
DEFAULT        PASSWORD_LIFE_TIME              PASSWORD 180
 設定了使用者的PASSWORD_LIFE_TIME,預設為180天;
 修改使用者的PASSWORD_LIFE_TIME限制:
SQL> alter profile DEFAULT limit PASSWORD_LIFE_TIME unlimited;
Profile altered.
 重新設定使用者的密碼:
SQL> alter user xxx identified by xxx;
User altered.
SQL> select USERNAME,ACCOUNT_STATUS,LOCK_DATE,EXPIRY_DATE,password,CREATED from dba_users where username=upper('xxx');
USERNAME    ACCOUNT_ST LOCK_DATE    EXPIRY_DATE        CREATED
-------------------- ---------- -------------------- ------------------- ------------------------------ -------------------
XXX              OPEN            2012-10-17 14:20:15
 帳號狀態恢複正常。

注意:
因為這個帳號是應用程式在使用的,不能更換密碼,所在在使用alter user...identified by的時候,需要使用這個帳號當前的密碼進行操作。

在CentOS 6.4下安裝Oracle 11gR2(x64)

Oracle 11gR2 在VMWare虛擬機器中安裝步驟

Debian 下 安裝 Oracle 11g XE R2

相關文章

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.