In this article, we will see the creation of DataGuard with 2 node RAC Primary Database and 2 node RAC Standby database.

Primary Database Standby Database Primary Instance Standby Instance

What I have already done

1. My production database is up and running with 2 node RAC

Oracle Version :

Grid Version :

2. At standby Grid Infrastructure is already installed.

3. ASM is up and running.

4. Oracle Binaries are installed.

Step 1: Check standby database cluster services are running :

Step 2: Prepare the Primary Database :

Check force logging at primary database and enable it if not enabled.

Step 3: Check the archive log if not enabled , enable it.

Step 4: Check details no of redo log files and size of each redo log file.

We can see here , 6 redo log files and with each file having size 50 MB.

So we will create 8 standby redo log files .

Step 5: Set initialization parameters necessary for data guard environment.

Step 6: Set tnsnames.ora file and listener file.

Tnsnames .ora

We need to do a static entry of listener at standby database :

Step 7: Restart listener and restart database so parameters can take effect of new value.

Step 8: Prepare Standby database

Create a necessary directory at standby :

Step 9: Create pfile  $ORACLE_HOME/dbs/initdgracdb1.ora with one parameter.


Step 10: Start the database in the nomount state using pfile.

Step 11: Copy pfile to both standby servers.

Step 12: Create a RMAN script to create a standby database using duplicate database command.

Diskgroup name in my standby database is DGDATA so I have used db_file_name_Convert and log_file_name_convert accordingly.

Step 13: Connect RMAN and run above script to create standby

Step 14: Verify instance is running fine.

Step 15: Add the database using srvctl

Step 16: Add instance using srvctl and start the first instance

Step 17: Set initialization parameters for standby needed for data guard environment.

Step 18: Move spfile in ASM storage so we can use shared spfile for both instances.

Step 19: Restart database

Step 20: Change instance parameters

Step 21: Start the second instance

Step 22: Check details of the second instance

Step 23: Check the active instance of data guard :

Step 24: Start media recovery :

Stay tuned for More articles on Oracle DataGuard

Thank you for giving your valuable time to read the above information.

If you want to be updated with all our articles send us the Invitation or Follow us:

Telegram Channel:

Skant Gupta’s LinkedIn:

Joel Perez’s LinkedIn: Joel Perez’s Profile

LinkedIn Group: Oracle Cloud DBAAS

Facebook Page: OracleHelp

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.