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’;
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