java.sql.SQLException: ORA-28001: the password has expired(oracle密码过期默认180天)

维护的网站网站登录后总是显示404,日志显示java.sql.SQLException: ORA-28001: the password has expired——oracle密码过期了;

解决方法: 打开SQL Pluse 或者是登录sql客户端工具(如sqlDeveloper/pLsql/navacate新建查询)都行;

   一、

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
 
------------------------------------------------------------

二、

 

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;

解决!

你可能感兴趣的:(技术记录)