Searching for user passwords in Oracle

For obvious security reasons we can not see clear the password of the users of the database, but as an administrator user SYSTEM does have privileges to view the encrypted password:


SQL> select password from dba_users where username='SCOTT';
PASSWORD
-----------------------------
F894844C34402B67

The usefulness of this is that as we return the SELECT can be used in a sentence of password change; 


SQL> alter user scott identified by values 'F894844C34402B67';

That we have not done anything since we have assigned to Scott who had the same password (TIGER), but if we change the password:


SQL> alter user scott identified by newpassword;
SQL> connect scott/newpassword
Connected.

And now we get back to the initial password:


SQL> connect system/dbapwd
Connected.
SQL> alter user scott identified by values 'F894844C34402B67';
User altered.

SQL> connect scott/tiger
Connected.

This example is illustrative only, but this may be really useful to create a user, or replicate it in another environment with the same password that I had. If you do not remember what your password is not stored there, and we have no desire to ask anybody, we can recover the encrypted password, the user create a password with anyone, and then modify it with the encrypted we saved:


SQL> create user test identified by password;
User created.

SQL> select password from dba_users where username='TEST';
PASSWORD
------------------------------
808E242669FC5270

SQL> drop user test;
Deleted user.

SQL> create user test identified by whateveryouwant;
User created.

SQL> alter user test identified by values '808E242669FC5270';
Modified user.

We have thus recreated the user test with the same password I had, and without knowledge.

 

Just what I need!

Thank you!!!
Just what I need to migrate a database from 9i to 10g without disrupting my users.