Wednesday 20 September 2017

12c copy the password file from PRIMARY ASM to the STANDBY ASM.


When you create a RAC database in 12c with DBCA, the password file will be stored in an ASM. In this post i will demonstrate how to refresh/copy the password file from PRIMARY ASM to the STANDBY ASM.

During the creation of a standby database or after having altered the password for any user granted the SYSDBA,SYSOPER or SYSDG privileges the password file must be copied from the primary site to the standby site.

The Oracle Database Enterprise Edition 12.1.0.1 and above can now store password files in ASM diskgroups.  By default if dbca is used to create a RAC database, the password file is created in an ASM diskgroup on the Primary site
Steps to copy password file between Primary and Standby Sites ASM

On primary

  • Connect to ASM instance on the local node, and copy the password file to a temporary location:

$ . oraenv
$ ORACLE_SID = [XXX] ? +ASM1
$ asmcmd –p
ASMCMD> pwcopy +DATA1/PRIMARY/PASSWORD/pwdprimary.1758.915635849 /home/oracle/orapwstdbydb
ASMCMD> exit

Transfer the password file to the standby destination

$ scp -p /home/oracle/orapwstdbydb standbyhost:/home/oracle

On Standby

  • Connect to ASM instance on the local node, and copy the password file from the temporary location to ASM:

$ . oraenv
$ ORACLE_SID = [XXX] ? +ASM1
$ asmcmd –p
ASMCMD> pwcopy /home/oracle/orapwstdbydb +DATA1/STDBYDB/orapwstdbdy
ASMCMD> ls –ltr +DATA1/STDBYDB/orapwstddby
Type Redund Striped Time Sys Name
PASSWORD HIGH COARSE AUG 27 20:00:00 N pwdorabisdb=> +DATA1/ASM/PASSWORD/pwdasm.280.987265849
ASMCMD> exit

After the password file is copied over ASM, subsequently, update the details in the cluster register, using the following command:

$ srvctl modify database –d STDBYDB –pwfile +DATA1/STDBYDB/orapwstdbdy
$ srvctl config database -d STDBYDB

Database unique name: STDBYDB
Database name:
Oracle home: /u01/app/oracle/product/12.1.0.2/dbhome_1
Oracle user: oracle
Spfile:
Password file: +DATA1/STDBYDB/orapwstdbdy
Domain:
Start options: open

CONCLUSION
  • When a RAC database in 12c is created with DBCA, its password is typically stored in ASM
  • Whenever there is an update in the password file, or configuring a RAC database ADG, it is mandatory to refresh/copy the Password file from the primary ASM destination to the standby ASM location
  • Although it is possible to keep the 12c database password file out of ASM, but, it is highly recommended to have RAC database password file in a shared location to avoid managing multiple copies of PWD files for each instance of RAC database.

Reference document MOS ID 1984091.1

4 comments:

  1. Hello
    Why the file goes to +DATA1/ASM folder?
    pwdorabisdb=> +DATA1/ASM/PASSWORD/pwdasm.280.987265849

    ReplyDelete
  2. How to copy file from ASM primary to non ASM dr

    ReplyDelete
    Replies
    1. Transfer the password file to the standby destination
      scp /home/oracle/orapwstdbydb standbyhost:/home/oracle

      Delete

Total Pageviews