Thursday, May 21, 2009

How to change an Oracle password temporarily

In Oracle it is possible to change a password temporarily. This can be useful for DBA which act as a different user.

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

USERNAME PASSWORD
-------- ----------------
GEORGE F894844C34402B67

SQL> alter user george identified by welcome123;


Now login with the following credentials: george/welcome(old passwd)
After doing your work you can change the password back by using an undocumented feature called "by values"

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

1 comment:

Anonymous said...

I logged in as SYS but when I ran "select * from dba_users", all the passwords were blank. Am I missing something?