oracle 11g 強制修改密碼 ORA-28001 的 處理方法

收到一個監控用戶沒法鏈接數據的告警, Oracle提示錯誤消息ORA-28001: the password has expired, 上去查看用戶狀態居然是expired,獲取用戶基本信息腳本以下:
    connect / as sysdba;
    col username for a16
    col password for a18
    col user_id for 999999
    col account_status heading 'Account|Status' for a20
    col default_tablespace heading 'Default|Tablespace' for a25
    col temporary_tablespace heading 'Temporary|Tablespace' for a12
    set lines 125
    set pages 100
    select username,user_id,password,account_status,default_tablespace,temporary_tablespace,to_char(created,'yyyy-mm-dd hh24:mi:ss') created
    from dba_users
    order by username;
    這是Oracle11G的一個新特性, Oracle11G建立用戶時缺省密碼過時限制是180天,
若是超過180天用戶密碼未作修改則該用戶沒法登陸。
    查看PROFILE設置
   select * from dba_profiles where profile='DEFAULT' and resource_name='PASSWORD_LIFE_TIME';

    DEFAULT   PASSWORD_LIFE_TIME PASSWORD 180   數據庫

        處理邏輯,將用戶密碼修改並判斷是否須要這個策略spa

         ALTER USER 用戶名 IDENTIFIED BY 密碼 ;
        語句進行修改密碼,密碼修改後該用戶可正常鏈接數據庫。
    若是須要修改策略

    ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED.net

    語句將口令有效期默認值180天修改爲「無限制」。orm

相關文章
相關標籤/搜索