oracle数据库密码过期问题

错误提示:java.sql.SQLWarning: ORA-28002: the password will expire within 1 days

错误原因:默认情况下,oracle11g版本以上密码的存活周期为180天,当超出这个时间时,密码就会过期,数据库不能连接。

解决方法:修改密码生存周期。(本例修改密码无时限)
步骤:
1.win+R——>打开运行窗口,输入cmd,进入命令窗口。
2.连接数据库
sqlplus “/as sysdba”


oracle数据库密码过期问题
3.查询数据库是否安装
select status from v$instance;
如果数据库状态为open,那么说明数据库已经安装。

4.查看口令失效的用户的profile文件(一般为default)
select username,profile from dba_users;
oracle数据库密码过期问题

5.查看指定文件的密码有效期

SELECT * FROM dba_profiles WHERE profile=‘DEFAULT’ AND resource_name=‘PASSWORD_LIFE_TIME’;
oracle数据库密码过期问题
6.修改密码有效期(修改后立即生效,不需重启数据库)
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
oracle数据库密码过期问题

7.断开数据库连接
exit

如果用户的密码已经过期,还需要再修改一次密码才能使用。
alter user user_name identified by password;
user_name是用户名,password是新密码。
如果账户被锁:ORA-28000: the account is locked,则使用如下语句解锁。
alter user user_name account unlock;
commit;

连接远程服务器:
sqlplus user_name/[email protected]:port/sid
例如:sqlplus cdbp/[email protected]:1521/orcl

oracle数据库密码过期问题

oracle数据库密码过期问题

原文:https://blog.csdn.net/mafan121/article/details/50537158?utm_source=copy