Umm, I forgot my password

Probem solved, with the following convenient password reset procedure found in a large production database, with EXECUTE granted to PUBLIC and a handy public synonym:

CREATE OR REPLACE PROCEDURE 
    reset_user_password(p_username IN VARCHAR2) 
AS 
BEGIN 
    execute immediate 
    ' ALTER USER ' || upper(p_username) || 
    ' IDENTIFIED BY '||upper(p_username); 
END; 
/

Many thanks to Robert De Laat for this submission.

Advertisements
By Ankur Bhatia Posted in Oracle

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s