Sunday, September 18, 2022

Why and How to update the user password to same password without knowing their actual password?

 Why ?

For certain reason you may need to update the password record for the Oracle user , for example if the user will be expired soon and you want to update the expiration period by change the password however you may want to keep the same password and you don’t know the password as well, in this case if you run Oracle 11g and more you can use the below query to get the alter and use the hash value as input thus the same old password will be kept however Oracle will update all dependencies like you enter a new password , that is mean expiration and graceful period all will be updated..

How ?

Below is scripts I used to generated all user under graceful message and update their password to same current password (no change) , you may change the where ( like ) with any situation that you may need to list,:

select

'alter user ' || su.name || ' identified by values'

   || ' ''' || spare4 || ';'    || su.password || ''';'

from sys.user$ su

join dba_users du on ACCOUNT_STATUS like 'EXPIRED(GRACE)%' and su.name = du.username;

No comments:

Post a Comment

Why and How to install Grid 19c on RHEL 8?

  Why ? Simply we will be requested to install Oracle Grid RAC DB on Redhat RHEL 8, below is my note for this installation . How ? 1-  OS in...