Unknown user’s password

There is sometimes a situation when we do not have a password from some user and we want to log in as that user and run some commands.

Here we will know the first password of the user, only for the sake of testing that this works at the end

SQL> create user tester identified by test;

Now, let us pretend that we want to login as the tester user, but do not know the password.

What we can do is to find out current hashed password (all passwords are saved so)

SQL> select name,password from user$ where name=’TESTER’;

#NAME                           PASSWORD
#—————————— ——————————
#TESTER                         83B5D260A2D254E1

Now we will change password so that we can connect

SQL> alter user tester identified by test2;

SQL> connect tester/test2;
SUCCESS! do whatever you need to do with this user

Now we will return the old password (it’s hashed value) loged in as a sys user

SQL> alter user tester identified by values ‘83B5D260A2D254E1‘;

And at the end we test whether we can still connect with the old password

SQL> connect tester/test

SUCCESS!

More info on http://askdba.org/weblog/2008/11/how-to-changerestore-user-password-in-11g/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: