Reset the Password for an Oracle Expired Login or Username to Old or Previous Value

advertisements

_____________________________________________________________________________________________________________________

The Eucharistic Miracles of the World
Sometimes we don’t remember the passwords for some application user/logins which we hard coded in the application. These users/logins password get expired by the aging. Even though the account password is expired the encrypted password values will be stored in the database. There are two ways to find out the encrypted values and reset it to the old value.


SQL> SELECT USERNAME, ACCOUNT_STATUS FROM dba_users where username ='TEST';

USERNAME                       ACCOUNT_STATUS
------------------------------ -----------------------------
TEST                           EXPIRED

  1. From sys.user$ table
SQL> select name, password from sys.user$ where name ='TEST';

NAME                           PASSWORD
------------------------------ ---------------------------
TEST                           92C5B0023D792E06

  1. From DBA_USERS table

SQL>  select extract( xmltype (dbms_metadata.get_xml('USER', username)), '//USER_T/PASSWORD/text()').getStringVal() OldPass
  2  from dba_users where username ='TEST';

OLDPASS
----------------
92C5B0023D792E06

Now you can easily reset the password by following command and connect the application.
    SQL> alter user "TEST" identified by values ‘92C5B0023D792E06';

User altered.

SQL> SELECT USERNAME, ACCOUNT_STATUS FROM dba_users where username ='TEST';

USERNAME                       ACCOUNT_STATUS
------------------------------ ---------------------------
TEST                           OPEN

Please try out and let me know your comments.

_____________________________________________________________________________________________________________________

A visitor from Xizang viewed 'Where You Can Find the Oracle 11g 12c DBCA Install' 55 mins ago
A visitor from Delhi viewed 'RMAN Restore Failed RMAN-06100: no channel to rest' 1 hr 15 mins ago
A visitor from Nevada viewed 'RMAN-08591: WARNING: invalid archived log deletion' 3 hrs 10 mins ago
A visitor from Zapopan viewed 'Fix DGMGRL Error: ORA-16698: LOG_ARCHIVE_DEST_n pa' 4 hrs 24 mins ago
A visitor from New york viewed 'How to Get Current SCN for Oracle 10g 11g Database' 5 hrs 44 mins ago

0 comments:

Post a Comment

Labels

Oracle (629) Script (86) General (77) Unix (47) Blog (23) Technology (19) gadget (6) games (6) Business (3) OCI (3) SQL* Loader (3) Datapump (2)
 

acehints.com Copyright 2011-25 All Rights Reserved | Site Map | Contact | Disclaimer