Thursday, May 27, 2010

How to preserve user password in Orac...


How to preserve user password in Oracle database (setting it back without knowing it )


oracle 11g

In 11g, if the PASSWORD_VERSIONS column of DBA_USERS contains 10G (along with 11g), then you can change it as follows
SQL> select name, password from sys.user$ where name like 'TAISMGR';

NAME                           PASSWORD
------------------------------ ------------------------------
TAISMGR                        BA0060B79A9624D8


save it - change to your own liking - and then set it back as follows

SQL>  alter user TAISMGR identified by values 'BA0060B79A9624D8';

User altered.



Oracle 10gR2 & below

Get the password from dba_users (from the "password" column), and then change it 


SQL> select username, password from dba_users where username like 'AJIT%';

USERNAME                       PASSWORD
------------------------------ ------------------------------
AJITS                          8D01EB2FEAF198B3


SQL> alter user ajits identified by values '8D01EB2FEAF198B3';

User altered.