DBA FAQ 5 - becoming another user in V6

From: Scott Tiger <kml_at_cellar.org>
Date: 26 Mar 93 14:07:32 GMT
Message-ID: <0qV11B8w164w_at_cellar.org>


DBA FAQ
(Frequently Asked Questions for/from Database Administrators) by Kevin M. Loney, aka kml_at_cellar.org (username "Scott Tiger")

Fifth in a Series.
30-NOV-92 Initial posting. KML.

Part 5. How to Become another user in V6

This is several pages long, you may want to just print it out and read it offline. The scripts in this FAQ are V6 specific.



This article may not be published without prior approval of the author.

        How to become another user in Oracle V6.

What you'll need:

        A DBA account
        A "become" script
        A "reset" script

I can't help you get the DBA account, but I can provide the two scripts. Not only that, but I can do it in such a way that it won't show up in the dba_audit_dba table.

This method makes use of the password assignment techniques used by export/import. I've also used it to lock people out of accounts while keeping the account open (connect='1') so that its grants won't get cleaned out (see FAQ 4).

First, create a script that will reset the user to his present encrypted password; then revise his password to a word of your choosing. You'll have to remember to reset his password when you're done.

BECOME.SQL: rem become.sql
rem K Loney, 9/10/92.
rem resets user's password to 'reset' temporarily rem to change it back, run sys$login:reset_{username}.sql

set pagesize 0
set feedback off
set verify off
set echo off
set termout off

spool sys$login:reset_&&1..sql
select 'alter user &&1 identified by values '||''''|| password||''''||';'
from dba_users where username = upper('&&1');

select 'host delete sys$login:reset_&&1..sql;*' from dual;

select 'exit' from dual;
spool off

alter user &&1 identified by newpassword; exit

That's it. The first part builds an alter user string (which won't show up in dba_audit_dba, at least not in 6.0.33.1), and stores it in a file (reset_username). Then the account's password is changed - in this case, to 'newpassword'. You can now log in as that user, using 'newpassword' as the account password. When you're done, run the reset_username script you created. It'll delete itself when it's complete.



Feedback is always welcome and appreciated.

Kevin Loney (kml_at_cellar.org) regularly writes the User Help column for Oracle magazine. In his spare time, he is an Oracle DBA in southeast PA. Comments and questions are always welcome.
::::::::::     ::    ::        :::::Alself me to myduce introlow
 Scott/::: ::::::< ::::: . :::::::::kml%cellar_at_tredysvr.tredydev.unisys.com
::Tiger::::::::::    :: ::: ::::::::kml_at_cellar.org  Damn the electric fence!
Received on Fri Mar 26 1993 - 15:07:32 CET

Original text of this message