oracledba.help
System

Password File

The password file for an Oracle database is called a database password file, and the password file for Oracle ASM is called an Oracle ASM password file. This page details database password file actions.

What You Need To Know

  • When a database is created (via DBCA) a password file is created.
    $ORACLE_HOME/dbs/orapw<DB_NAME>
  • When you create a RAC database (via DBCA) the password file will be stored in ASM.
  • To use the password file the REMOTE_LOGIN_PASSWORDFILE is set. Grant privileges as required.
  • By default passwords in the password file are case-sensitive.

In the following examples:

  • Database name = oradb
  • Password = go
  • Place commands on one line when executing.
    Some commands shown on multiple lines for easier viewing.

ASM Copy

OS to ASM

 ASMCMD> pwcopy /u01/app/oracle/product/12.2.0.1/dbhome_1/dbs/orapworadb 
                +DATA/oradb/orapworadb

ASM to OS

 ASMCMD> pwcopy +DATA/oradb/orapworadb /tmp/orapworadb_sb

ASM to OS: Alternate Method

 su - grid
 asmcmd

 ASMCMD> cd +DATA/oradb/PASSWORD
 ASMCMD> ls 
 ASMCMD> pwdoradb.256.958481401
 ASMCMD> pwcopy +DATA/oradb/PASSWORD/pwdoradb.256.958481401 /tmp/orapworadb_sb
 ASMCMD> exit

 su - oracle
 oracle> cp /tmp/orapworadb_sb /u01/rman/orapworadb_sb 

Create

OS File Based Database

 orapwd file=$ORACLE_HOME/dbs/orapworadb_sb password=go entries=10 force=y

If Newly Migrated to 12.2:

 orapwd file=$ORACLE_HOME/dbs/orapworadb_sb password=go entries=10 force=y format=12

ASM Database

Option 1 (Create directly in ASM)

 su - oracle
 orapwd file='+DATA/oradb/PASSWORD' password=go entries=10 
        force=y format=12 dbuniquename='oradb'

 The above command creates the dir: +DATA/oradb/PASSWORD
 Example file created: pwdoradb.272.955355373 

Option 2 (Copy from OS stored password file.)

  su - oracle
  orapwd file=$ORACLE_HOME/dbs/orapworadb password=go 
         entries=10 force=y format=12

  su - grid
  asmcmd 
  ASMCMD> mkdir +DATA/oradb/PASSWORD
  ASMCMD> pwcopy --dbuniquename oradb 
          /u01/app/oracle/product/12.2.0.1/dbhome_1/dbs/orapworadb 
          +DATA/oradb/PASSWORD/orapworadb