As an Oracle Database Administrator (DBA), determining the proper location and name for a password file is crucial for database security and administration. The password file stores passwords for users with SYSDBA, SYSOPER, SYSASM, SYSBACKUP, or SYSDG privileges. Here's how you can determine the proper location and name for the password file in Oracle 12c:
The name of the password file is usually associated with the Oracle instance SID and takes the form:
- `orapw<SID>` on Unix and Linux systems
- `PWD<SID>.ora` on Windows systems
Finding Password File Information
Here are the ways you can find or specify the password file location and name:
- Initialization Parameters: The parameters `REMOTE_LOGIN_PASSWORDFILE` and `ORACLE_HOME` in the initialization file (init.ora or spfile.ora) can give you information about password files.
- Environment Variables: The `$ORACLE_SID` and `$ORACLE_HOME` environment variables on Unix/Linux or `%ORACLE_SID%` and `%ORACLE_HOME%` on Windows can help you identify the SID and Oracle home directory.
- SQL Query: You can query the `v$pwfile_users` view to get details about the password file:
SELECT * FROM v$pwfile_users;
- Show Parameter: Use the following SQL command to see the current setting for the `REMOTE_LOGIN_PASSWORDFILE` parameter:
SHOW PARAMETER REMOTE_LOGIN_PASSWORDFILE;
Creating or Changing the Password File
If you need to create or re-create the password file, you can use the `orapwd` utility. Here's an example command to create a password file:
orapwd FILE=$ORACLE_HOME/dbs/orapw$ORACLE_SID PASSWORD= ENTRIES=
Replace `<sys_password>` with the password for the SYS user and `<max_users>`with the maximum number of distinct privileged users you plan to have.
Key Points to Remember
- Make sure the `ORACLE_HOME` and `ORACLE_SID` environment variables are set correctly.
- The user who is creating the password file should have write permissions to the specified directory.
- Ensure that the `REMOTE_LOGIN_PASSWORDFILE` parameter is set appropriately (`EXCLUSIVE`, `SHARED`, or `NONE`).
- Keep the password file secure, and restrict its permissions to prevent unauthorized access.
By following these guidelines, you should be able to determine the proper location and name for the password file in Oracle 12c.
The proper name and location for a password file is specific to the operating system. There are some slight differences between Windows and Unix, and there may be differences for other operating systems as well.
If you make a Mistake
Naming the password file is one area where Oracle is somewhat forgiving. If you configure a database to use a password file and Oracle can not find the file when you try to start the database, Oracle will display a message showing you the exact directory path and filename that it is looking for. So if you get the filename or location wrong the first time, it is a very easy mistake to correct. You can simply create the password file again using the correct name and location.
Naming Password file
The name of the password file for a database should take one of the following two forms:
In both cases, the "_instance_identifier" represents the Oracle instance identifier, or SID. Using the COIN instance as an example, the password file should be named
pwdCOIN.ora, depending on whether you are running Oracle on Unix or Windows NT. Note that Oracle on Unix does not expect the password file to have an extension, while Oracle running on Windows NT does.
Placing the password file in Legacy Environments
In addition to having inconsistent naming conventions across platforms, Oracle also expects to find the password file in different directories for each operating system. For Unix and Windows, the password file should be in one of the following two directories:
Under Windows, the
part of the path represents the default install.
When installing an Oracle 11g database on a Windows 7 machine which already has a lot of different software installed,
On win 7 64bit, go to PATH variable
Right click on my computer > properties >
Advanced system Settings > Advanced Tab >
click on Envirnment variable > in system variable - look for Path>
- When the failure occurs during installation of Oracle 11g, click on cancel, you will need to restart the installation from scratch
- On win 7 64bit, go to PATH variable(Right click on my computer>properties>Advanced system Settings>Advanced Tab>click on Envirnment variable>in system variable - look for Path>
- Find the Path environment in the System Variables window and edit it, click on it and select all the values within it, paste these into a word document or something and save it.
- Clear the Path environment and simply add a single directory such as c:\Seer
- Start the installation of Oracle 11g again and wait while it executes the process
- Return to the Environment Variables and paste the originals back after the new ones put in by the installation
If you chose a different location for your Oracle home when you installed the software, that part of the path will reflect your choice.
Also, do not be confused by the fact that both the Windows NT and Unix implementations have a
The password file goes in
for Unix and in
Now, determine the proper location and name for the password file for your own database. Later on in this module, you will use this information to actually create the password file.