连接数据库,报密码过期,错误为:ORA-28001: the password has expired
.
解决方法:
1.通过sqlplus / as sysdba 方式进去数据库更改
2.查看用户密码默认管理方式
SQL> select profile from dba_users where username='用户名';
PROFILE
------------------------------
DEFAULT
SQL> 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
可以看到默认的过期天数为180天。
3.更新密码
SQL> ALTER USER 用户名 IDENTIFIED BY 新密码;
User altered
4.如果想去除180天的密码生存周期的限制可通过如下SQL语句将其关闭
SQL> ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
Profile altered
SQL> 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