Database Reference
In-Depth Information
Recovering the Database Password File
The database password file is a critical file that stores the credentials for users granted non-
role-based privileges. The privileges stored in the password file are those granted for:
SYSDBA
SYSBACKUP
SYSOPER
SYSDG
SYSKM
SYSASM (for ASM instances)
The password file is created (or recreated) using the orapwd utility. Here is an example of
the creation of a password file:
orapwd FILE='+DATA_DG/orcl/orapworcl' ENTRIES=10 DBUNIQUENAME='orcl'
In this example, we have created a password file for the database orcl. The password
file will be created in the ASM disk group called +DATA_DG. This password file is called
orapworcl , which follows the standard naming convention of password files for Oracle
databases. The password file standard naming convention is orapw , followed by the name
of the database assigned to that password file—in this case orcl . The DBUNIQUENAME param-
eter is required for ASM to ensure that the password file name will not conflict with that of
another password file.
The view V$PWFILE_USERS is provided so that you can look at the users in the database
password file and what privileges they have been granted. It's a good idea to print a report
showing the users and the privileges they have been granted in case you need to recreate the
password file.
You can backup the password file at any time. You can also restore the password file
from that backup. Additionally, you can recreate the password file using the orapwd utility.
In this case, you would also need to re-grant users the permissions that they previously had.
Clearing Redo Logs
Once in a great while something happens to an online redo log and the database just seems
to get stuck. Now, there are many reasons for this. It might be that the FRA has filled up
and you need to add additional space to it. Another rare possibility is that the online redo
log has become corrupted somehow. If might be that the logfile can't be archived for some
reason (perhaps it was accidently deleted, in which case the database might well just hang
instead of crashing).
In cases like this, you can use the ALTER DATABASE CLEAR LOGFILE command to reini-
tialize the bad online redo log file. Further, you may need to indicate that the bad log
file should not be archived, in which case you would issue the ALTER DATABASE CLEAR
UNARCHIVED LOGFILE to indicate that it should not be archived. This is common in cases
Search WWH ::




Custom Search