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: to connect to a user that password is unknow?-> just script modification

Re: to connect to a user that password is unknow?-> just script modification

From: Grt <grt_post_at_hotmail.com>
Date: Sun, 31 Jan 1999 02:59:59 +0100
Message-ID: <36B3B91F.B61ACC11@hotmail.com>


Very nice script, Mr. Kyte
For conveniant usage some minor modifications:

--bof
whenever sqlerror exit

REM accept simplifies usage
accept 1 prompt 'Username? : '
accept SID prompt 'SID? : '

REM for unnecessary output
set termout off
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;

REM SID needed because of "ORA-12203: TNS:unable to connect to destination"-error and subsequent exit.
connect &1/hello@&SID
alter user &1 identified by values '&pw';

set termout on
show user

whenever sqlerror continue
--eof

grt Received on Sat Jan 30 1999 - 19:59:59 CST

Original text of this message

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