Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Is there a way to connect to a user that password is unknow ?

Re: Is there a way to connect to a user that password is unknow ?

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Thu, 28 Jan 1999 13:39:51 GMT
Message-ID: <36b26893.4400517@192.86.155.100>


A copy of this was sent to yewpc_at_my-dejanews.com (if that email address didn't require changing) On Thu, 28 Jan 1999 07:16:57 GMT, you wrote:

>Hi,
> I would like to temporary connect to a user that I don't
> know the password. Is there a way to do that ?
>
> The only way I can think of is to alter the user password but
> by this way I will not be able to set back the user original
> password.
>
> Anyone have any idea ?
> Thankz in advance...
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

This is an 'su.sql' script I use in sqlplus:

column password new_value pw

declare

    l_passwd varchar2(45);
begin

    select password into l_passwd

      from sys.dba_users
     where username = upper('&1');

end;
/

select password
  from sys.dba_users
 where username = upper( '&1' )
/

alter user &1 identified by Hello;
connect &1/hello
alter user &1 identified by values '&pw'; show user
whenever sqlerror continue

--------------------------- eof -------------------------

it starts by testing your access to the sys.dba_users table -- if that fails -- it exits. If zero rows returned -- it exits.

It then selects the 'password' from the dba_users table and stuffs it into a macro variable "&pw"

We alter the user you want to become to have a known password (if that fails, we exit).

We 'fix' their password back after loggin in as them....

Note, you need to have access to dba_users and the alter user privelege.  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Service Industries
Reston, VA USA

--
http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Thu Jan 28 1999 - 07:39:51 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US