In the administration of an Oracle database there are times when we will have to create a new password file due to corruption, lack of space for administrators, or new database creation. Oracle provides the utility ORAPWD to accomplish such a task. This article will cover the use of the utility ORAPWD to create a new password file and implementation for remote connection to the oracle database. This procedure will work on any OS.
1. Logon to your Oracle database server as the Oracle software owner.
2. Navigate to the following directory $ORACLE_HOME/dbs and list the file orapw* to check if a password file already exists for this instance.
mylinux :> cd $ORACLE_HOME/dbs
mylinux :> ls -lrt
total 272
-rw-r–r– 1 oracle dba 3979 Jan 27 18:54 initorcl.ora
-rw-r—– 1 oracle dba 5120 Mar 13 13:49 spfileorcl.ora
mylinux :>
3. No password file is listed, so we can proceed to step 4. In this example our SID is ORCL if we located a file of the orapworcl, we would have to rename it with the following command:
mv orapworcl orapworcl_bak
4. Now we are ready to execute the ORAPWD utility to create our oracle password file. The ORAPWD utility has the following three options:
file – name of the password file, default format is orapw{SID} located in directory $ORACLE_HOME/dbs
password – Password for the SYS user.
entries – Number of distinct DBA users who can be placed in the file.
IE orapwd file=$ORACLE_HOME/dbs/orapworcl password=password1 entries=5
5. Execute the ORAPWD command.
mylinux :>orapwd file=./orapworacle password=password1 entries=5
mylinux :>
6. Execute the ls command to see the new password file.
mylinux :> ls orapw*
orapworcl
mylinux :>
7. Enter SQLPLUS with SYSDBA privileges.
mylinux :> sqlplus ‘/ as SYSDBA’
SQL*Plus: Release 10.2.0.4.0 – Production on Sat Oct 10 10:18:48 2009
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 – 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
8. Ensure that the init parameter REMOTE_LOGIN_PASSWORDFILE is set to EXCLUSIVE through the use of the show command.
SQL> show parameter REMOTE_LOGIN_PASSWORDFILE
NAME TYPE VALUE
———————————— ———– ———-
REMOTE_LOGIN_PASSWORDFILE string EXCLUSIVE
SQL>
9. If the parameter was something other then EXCLUSIVE, use the alter system command to change it to exclusive and restart the database.
Now you can access the database remotely as the user SYS by giving the password used in the ORAPWD utility.
Larry J. Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com