ORA-28002: the password will expire within 7 days 解决方法

今天启动服务的时候,项目报错,发现错误在数据库连接部分,报出ORA-28002: the password will expire within 7 days错误。

启动PLSQL,采用sys sysdba模式进入

1.查看用户的profile设置:select username,profile from dba_users; 一般用户的profile设置都为DEFAULT。

2.查看系统profiles中PASSWORD_LIFE_TIME设置。select * from dba_profiles s where s.profile='DEFAULT' and resource_name='PASSWORD_LIFE_TIME';

PROFILE                        RESOURCE_NAME                    RESOURCE                      LIMIT

------------------------------ -------------------------------- ------------------------------------------------
DEFAULT                        PASSWORD_LIFE_TIME               PASSWORD                180dys

==============================================================

3.修改DBA_PROFILES中PASSWORD_LIFE_TIM的设置,改为ULIMITED。

alter profile default limit PASSWORD_LIFE_TIME unlimited;  

修改后设置立即生效,不需要重启数据库,此时密码永远不会过期。

4.已经被报告了密码快要过期的账户必须再改一次密码(需要DBA权限)

以system用户为例sqlplus / as sysdba        alter user system identified by root;再连接数据再也不会出现密码过期的事情了。

如果是其他用户的话,那么就使用其他用户名。

alter user scott identified by tiger;

猜你喜欢

转载自blog.csdn.net/yy_csdn1314/article/details/51611901