In my previous article, I mentioned how to solve Oracle Password Expired Error (ORA-28001). In some cases, we must unlock user with the existing password. I will show you how to unlock an expired user which you do not know user’s existing password.
Let’s list expired users.
1 2 3 4 5 | SQL> select username,account_status from dba_users where account_status like '%EXPIRE%' order by created; USERNAME ACCOUNT_STASUS OCINAR EXPIRED & LOCKED |
We can list “user$” view for users’ passwords. spare4 column shows the encrypted password.
1 2 3 4 5 | SQL> select spare4 from user$ where name='OCINAR'; SPARE4 -------------------------------------------------------------------------------- S:3E36B03EDF18C7EC8E512175B810437F962C2741293E0E38BD85CBE4C05F |
We can unlock “ocinar” user with its existing encrypted password.
1 | SQL> alter user ocinar identified by values 'S:3E36B03EDF18C7EC8E512175B810437F962C2741293E0E38BD85CBE4C05F' account unlock; |
Now, “OCINAR” is active and can connect database again with its original password.
alter user user_name identified by new_pass;
thank you by Onur Çınar