How does one switch to another user in Oracle? (for DBA
ORACLE Interview Questions and Answers (Part 4)
(Continued from previous question...)
609. How does one switch to another user in Oracle? (for DBA
Users normally use the "connect" statement to connect from one database user to another. However, DBAs can switch from one user to another without a password. Of course it is not advisable to bridge Oracle's security, but look at this example:
SQL> select password from dba_users where username='SCOTT';
SQL> alter user scott identified by lion;
SQL> connect scott/lion
REM Do whatever you like...
SQL> connect system/manager
SQL> alter user scott identified by values 'F894844C34402B67';
SQL> connect scott/tiger
Note: Also see the su.sql script in the Useful Scripts and Sample Programs Page.
(Continued on next question...)
Other Interview Questions