29 April 2010

How to switch to another user!!!

Need to become a different Oracle database user? There is a way to login into a another user's
account without knowing their password:

1. Find out the encrypted password for the user

SQL> select username, password from dba_users where username = 'USERNAME';

USERNAME PASSWORD
------------ ------------------------------
USERNAME 6B4712549D4DA963

Save the encrypted password value somewhere i.e. in a text file

2. Change user's password to a temporary password

SQL> alter user USERNAME identified by 'password';

3. Do whatever you had to do as that user

4. Change user's password back to the original

SQL> alter user USERNAME identified by values '6B4712549D4DA963';



do not forget to use the word 'values' here, else this won't work!




.

No comments:

Post a Comment