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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Help with passwords

Re: Help with passwords

From: John Carlson <jcarlson_at_CJ.COM>
Date: Wed, 24 Oct 2001 09:42:25 -0700
Message-ID: <F001.003B354A.20011024094550@fatcity.com>

Here is a script I use all the time to run jobs for other users. It saves the current password, sets the password to temp, connects to user, and sets it back to original setting. Now you are logged in as the new user but their password was only changed for less than a second. The script also uses an idea I borrowed from Steve Adam's Ixora site to save and restore the sqlplus settings. (Thanks Steve).

>>>>>>> Cut Here

@save_sqlplus_settings
set termout off echo off pause off
REM connect_as.sql
REM If you are currently connected as a user with 'alter any user' REM privilege, this will connect you as any other user. REM usage: @connect_as new_user_id
REM 11/07/1998 - John Carlson
REM 11/16/2000 - John Carlson (Oracle V8.1.6) REM Added save and restore settings scripts which use new REM sqlplus 'store set' command.

whenever sqlerror exit sql.sqlerror

col password NEW_VALUE save_pass
define new_user=&1

SELECT password
FROM dba_users
WHERE username=upper('&new_user');

whenever sqlerror continue

ALTER user &new_user identified by temp; CONNECT &new_user/temp
ALTER user &new_user identified by values '&save_pass';

undef 1
undef save_pass
undef new_user
set termout on
show user

@restore_sqlplus_settings

<<<<<<<<<<<<<<<<<  Cut Here

HTH,
John

>>> G.L.Alink_at_civ.utwente.nl 10/24/01 07:10AM >>> Hi all,

I've got a little question, which i can't find simply on metalink. I've got one user with a not know password and i want to temporary change it;s password.
I know it is possible to save the hex-key in dba_users. But how can i change it back to that hex-key?

I need temporary this user account and can change the password, but i want to change it back to the original.

Thx anyway,
Marco

> Marco Alink
> Systeem- en databasebeheerder, Centrum voor Informatievoorziening,
> Universiteit Twente, Postbus 217, 7500 AE Enschede
> telefoon: 053 - 489 2628, fax:053 - 489 2383, http://www.utwente.nl/civ
>
>
>

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com 
-- 
Author: 
  INET: G.L.Alink_at_civ.utwente.nl 

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: John Carlson
  INET: jcarlson_at_CJ.COM

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Wed Oct 24 2001 - 11:42:25 CDT

Original text of this message

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