Oracle密码过期, 报:ORA-01017: 用户名/口令无效; 登录被拒绝

连接Oracle,以Oracle用户登陆:

[sql]   view plain  copy
  1. $su - oracle  
  2. $sqlplus 数据库用户/数据库密码 as sysdba  


输入查询:

[sql]   view plain  copy
  1. select * from dba_profiles where profile='DEFAULT' and resource_name='PASSWORD_LIFE_TIME';  


结果显示:

[sql]   view plain  copy
  1. PROFILE  
  2. ------------------------------------------------------------  
  3. RESOURCE_NAME  
  4. ------------------------------------------------------------  
  5. RESOURCE_TYPE  
  6. ----------------  
  7. LIMIT  
  8. ------------------------------------------------------------  
  9.   
  10. DEFAULT  
  11. PASSWORD_LIFE_TIME  
  12. PASSWORD  
  13. 180  
  14.   
  15. ------------------------------------------------------------  


结果显示密码有效期是180天
输入命令:

[sql]   view plain  copy
  1. alter profile default  limit password_life_time unlimited;  
  2. commit;  

再次执行:

[sql]   view plain  copy
  1. select * from dba_profiles where profile='DEFAULT' and resource_name='PASSWORD_LIFE_TIME';  


结果显示为:

[sql]   view plain  copy
  1. PROFILE  
  2. ------------------------------------------------------------  
  3. RESOURCE_NAME  
  4. ------------------------------------------------------------  
  5. RESOURCE_TYPE  
  6. ----------------  
  7. LIMIT  
  8. ------------------------------------------------------------  
  9.   
  10. DEFAULT  
  11. PASSWORD_LIFE_TIME  
  12. PASSWORD  
  13. UNLIMITED  
  14. ------------------------------------------------------------  


 

改变新密码的命令:

[sql]   view plain  copy
  1. alter user 数据库用户名 identified by 数据库新密码;  


若系统需要修改为原来密码:

[sql]   view plain  copy
  1. alter user 数据库用户名 identified by 数据库原来密码;  


注: 需要修改新密码再修改回原来密码,原来密码才会生效

 

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

[sql]   view plain  copy
  1. alter user 数据库用户名 identified by 数据库密码 account unlock;  


再次调试,问题解决


猜你喜欢

转载自blog.csdn.net/qq493820798/article/details/80407534