Database Reference
In-Depth Information
to a solution. Some examples are querying the view V$INDEX_USAGE or running third-party
scripts that do not prefix database objects with schema names, without changing the code.
The example below uses the user SYSTEM, which has DBA privileges, and the application
schema HR. The first step is to connect as a DBA and to save the current unknown password.
SQL> CONNECT system
Enter password:
Connected.
SQL> SPOOL pwd.log
SQL> SELECT password FROM dba_users WHERE username='HR';
PASSWORD
------------------------------
2AB46277EE8215C4
SQL> SPOOL OFF
The file pwd.log now contains the password hash of the schema HR. Next, edit pwd.log ,
such that it contains a SQL statement suitable for resetting the password to its original value.
The syntax is ALTER USER username IDENTIFIED BY VALUES ' password_hash ', where password_
hash is the password hash obtained above. After editing, the file pwd.log should contain the
following line:
ALTER USER hr IDENTIFIED BY VALUES '2AB46277EE8215C4';
Now the password may be changed temporarily.
SQL> ALTER USER hr IDENTIFIED BY secret;
User altered.
Note that the preceding statement will send the temporary password to the DBMS instance
unencrypted. Use the SQL*Plus command PASSWORD if this concerns you. The password hash
stored in the data dictionary has now changed.
SQL> SELECT password FROM dba_users WHERE username='HR';
PASSWORD
------------------------------
D370106EA83A3CD3
Next, start one or more applications suitable for diagnosing and/or solving the issue at
hand. To minimize the interval while the changed password is in effect, proceed to restore the
original password immediately after the application has connected to the DBMS instance.
$ sqlplus hr/secret
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
SQL>
Now, reset the password to its original value by running the ALTER USER command in file
pwd.log .
 
Search WWH ::




Custom Search