SQL ScriptConnect as another user |
This script allows you to change to connect to another schema from any DBA database user without you knowing the password. It resets the password back to the original so nobody knows you've connected, (unless the database is being audited or course!)
&user - Schema to connect as
CLEAR SET HEAD ON SET VERIFY OFF PROMPT ACCEPT user PROMPT ' Goto which user : ' set pages 0 set feed off set verify off set echo off set term off spool temp.sql select 'alter user &user identified by values '||chr(39)||password||chr(39)||';' from dba_users where username = UPPER('&user') / spool off PROMPT PROMPT Changing password of &user to TEMP ... PROMPT alter user &user identified by temp; PROMPT PROMPT Connect as &user ... PROMPT connect &user/temp PROMPT PROMPT Resetting Password to original ... PROMPT START temp.sql
Return to Index of SQL Scripts
Home
|
Company Profile
|
Services
|
Contact Us
|
SQL scripts and tips
|
Quiz
|