How to login as user without changing the password



Last updated on July 17th, 2015 at 06:05 pm

 1) First, we extract the encrypted password:

select
‘alter user “‘||username||'” identified by values ”’||extract(xmltype(dbms_metadata.get_xml(‘USER’,username)),’//USER_T/PASSWORD/text()’).getStringVal()||”’;’  old_password
from
   dba_users
where
username = ‘XXXX’;

OLD_PASSWORD
——————————————————————–
alter user “XXXX” identified by values ’15EC3EC6EAF863Clkhfdadk’;

2) You can now change XXXX’s password  and Do your Stuff

alter user XXXX identified by sunshine;
connect XXXX/sunshine;
< do your stuff>

3)  When you have completed your testing you can set-back the original encrypted password using the output from the query in step 1:

alter user “XXXX” identified by values ’15EC3EC6EAF863Clkhfdadk’;


Leave a Reply