Consultation Oracle user passwords

For obvious security reasons can not see clear the user password of the database, but a manager as SYSTEM user 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 just as we returned the SELECT can be used in a sentence of changing the password;

SQL> alter user scott IDENTIFIED BY VALUES 'F894844C34402B67';

With this we have not done anything since we have assigned to SCOTT the same password that I had (TIGER), but if we change the password:

SQL> alter user scott IDENTIFIED BY newpwd;
SQL> connect scott / newpwd
Connected.

And now we wish to put 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 system can be really useful to recreate a user, or replicated in another environment with the same password I had.If you do not remember what their password, do not have it stored, and have no desire to ask anyone, we can retrieve the encrypted password, recreate the user with any password, and then modify it with the encrypted that we have saved:

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

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

SQL> drop user test;
Deleted user.

SQL> create user loquequieras IDENTIFIED BY test;
User created.

SQL> alter user test values ​​'808E242669FC5270 IDENTIFIED BY ';
User altered.

Thus we re-create the test user with the same password I had, and without knowing it.