the password XXX hsa expired

阅读更多
调试Web项目的时候出现异常:



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



网上查了一下,是Oracle11g密码过期的原因
连接Oracle,以Oracle用户登陆,输入以下命令



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



结果显示: 



[html] view plain copy print?
01.PROFILE  
02.------------------------------------------------------------  
03.RESOURCE_NAME  
04.------------------------------------------------------------  
05.RESOURCE_TYPE  
06.----------------  
07.LIMIT  
08.------------------------------------------------------------  
09.  
10.DEFAULT  
11.PASSWORD_LIFE_TIME  
12.PASSWORD  
13.180  
14.  
15.------------------------------------------------------------  



结果显示密码有效期是180天

输入命令:



alter profile default  limit password_life_time unlimited;  
commit;  



再次执行:


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




结果显示为:


01.PROFILE  
02.------------------------------------------------------------  
03.RESOURCE_NAME  
04.------------------------------------------------------------  
05.RESOURCE_TYPE  
06.----------------  
07.LIMIT  
08.------------------------------------------------------------  
09.  
10.DEFAULT  
11.PASSWORD_LIFE_TIME  
12.PASSWORD  
13.UNLIMITED  
14.------------------------------------------------------------  



进行以上步骤之后需要改变密码,否则还会出现password has expired异常
改变密码的命令



alter user XXXUSER identified by Welcome1;  




如果账号被锁住,则需要解锁命令


alter user XXXUSER identified by oracle account unlock;  



再次调试,问题解决

From:
http://blog.csdn.net/android_robot/article/details/7598345

你可能感兴趣的:(the password XXX hsa expired)