首页 > 数据库 > Oracle > 用户密码过期,在不修改密码的情况下恢复使用
1.使用DBA数据库特权用户查看该用户当前的配置文件
SQL> select username,profile from dba_users where username ='username';
USERNAME PROFILE
------------- --------
USERNAME DEFAULT
2.创建一个临时配置文件
create profile temp_prof limit
PASSWORD_REUSE_MAX unlimited
PASSWORD_REUSE_TIME unlimited;
3.将这个临时配置文件分配给用户
SQL> alter user username profile temp_prof;
4.查看引起混乱的密码:
SQL> select password from user$ where name = 'username';
PASSWORD
--------------
xxxxxxxxxxxxx
5.使用原密码设置该帐号的新密码,这可以使已过期的密码重新生效‘
SQL>alter user username identified by value 'xxxxxxxxxxxxx';
6.将原来的配置文件重新分配给用户:
SQL> alter user username profile default;
以上的技巧,可以在不知道原密码的情况下,使已过期的密码重新生效,而且还能避免配置文件的限制,而导致无法重用密码的问题。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/31438871/viewspace-2186752/ ,如需转载,请注明出处,否则将追究法律责任。