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: Password Generator...

RE: Password Generator...

From: Jamadagni, Rajendra <Rajendra.Jamadagni_at_espn.com>
Date: Thu, 21 Nov 2002 09:14:07 -0800
Message-ID: <F001.00509035.20021121091407@fatcity.com>


We use this ...

PROCEDURE Generate ( USERID VARCHAR2 ) IS newpass VARCHAR2(20);
dbname VARCHAR2(10);
/*
connect system
grant execute on admin_passwd to sys;
create synonym sys.admin_passwd for system.admin_passwd; */
BEGIN
DBMS_OUTPUT.ENABLE(100000);
newpass :=
dbms_random.string('U',4)||TO_CHAR(SYSDATE,'SS')||DBMS_RANDOM.STRING('U',2); EXECUTE IMMEDIATE 'alter user '||USERID||' identified by '||newpass; SELECT NAME INTO dbname FROM v$database; UPDATE tcs.system_users SET password_update_date=TRUNC(SYSDATE) WHERE su_sys_user_name=USERID;
DBMS_OUTPUT.PUT_LINE('The new password for '||USERID||' is '||newpass||' in the '||dbname||' database.');
EXECUTE IMMEDIATE 'alter user '||USERID||' password expire'; EXECUTE IMMEDIATE 'alter user '||USERID||' account unlock'; EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN OTHERS THEN
-- Consider logging the error and then re-raise
RAISE;
END generate;

this is inside a package which is propogated to all DB's ... the system_users is an application table.

Raj



Rajendra Jamadagni MIS, ESPN Inc. Rajendra dot Jamadagni at ESPN dot com
Any opinion expressed here is personal and doesn't reflect that of ESPN Inc.

QOTD: Any clod can have facts, but having an opinion is an art! -----Original Message-----
Sent: Thursday, November 21, 2002 11:39 AM To: Multiple recipients of list ORACLE-L

Hey folks-
I have a question that was presented to me by a web development team.. Does anyone know of products,procedures,etc that would generate a random password for a user? For example-similar to that at MetaLink when you forget your password-and they send you a new one that is just a string of characters/numeric digits...
Thanks!
Greg Loughmiller
Sr Manager - Enterprise Data Architecture gloughmiller (IPS)
678.893.3217 (office)


--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Jamadagni, Rajendra
  INET: Rajendra.Jamadagni_at_espn.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
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 Thu Nov 21 2002 - 11:14:07 CST

Original text of this message

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