Creating a Data Guard Physical Standby environment
Once you have your primary database up and running these are the steps to follow.
Enable Forced Logging
Create a Password File
Configure a Standby Redo Log
Enable Archiving
Set Primary Database Initialization Parameters
Below are the steps to implement the Physical Standby.
Create a Control File for the Standby Database
Backup the Primary Database and transfer a copy to the Standby node.
Prepare an Initialization Parameter File for the Standby Database
Configure the listener and tnsnames to support the database on both nodes
Set Up the Environment to Support the Standby Database on the standby node.
Start the Physical Standby Database
Verify the Physical Standby Database Is Performing Properly
Primary Database Steps.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
SQL> select name from v$database; NAME --------- PRIMARYDB SQL> select file_name from dba_data_files; FILE_NAME -------------------------------------------------------------------------------- /test/db/PRIMARYDB/datafile/o1_mf_users_310mzml9_.dbf /test/db/PRIMARYDB/datafile/o1_mf_sysaux_310mzm34_.dbf /test/db/PRIMARYDB/datafile/o1_mf_undotbs1_310mzmk2_.dbf /test/db/PRIMARYDB/datafile/o1_mf_system_310mzm27_.dbf /test/db/PRIMARYDB/datafile/o1_mf_test2_3117h15v_.dbf /test/db/PRIMARYDB/datafile/o1_mf_test3_3117h8nv_.dbf /test/db/PRIMARYDB/datafile/o1_mf_test4_3117hk7d_.dbf 7 rows selected. SQL> select name from v$database; NAME --------- PRIMARYDB SQL> show parameters unique NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_unique_name string PRIMARYDB |
Enable Forced Logging
In order to implement Standby Database we have to enable ‘Forced Logging’. because the standby database is transactional replica, so if any changes happen at primary database it should replicate to the standby database.
This option ensures that even in the event that a ‘nologging’ operation is done, force logging takes precedence and all operations are logged into the redo logs.
1 2 3 |
SQL> ALTER DATABASE FORCE LOGGING; Database altered. |
Create a Password File
A password file must be created on the Primary and copied over to the Standby site. The sys password must be identical on both sites. This is a key pre requisite in order to be able to ship and apply archived logs from Primary to Standby.
1 2 3 4 5 |
cd $ORACLE_HOME/dbs [TEST1] > orapwd file=orapw$ORACLE_SID password=oracle force=y OR [TEST1] > orapwd file=orapwPRIMARYDB password=oracle force=y |
Configure a Standby Redo Log
A Standby Redo log is added to enable Data Guard Maximum Availability and Maximum Protection modes. It is important to configure the Standby Redo Logs (SRL) with the same size as the online redo logs.
In this example I’m using Oracle Managed Files, that’s why I don’t need to provide the SRL path and file name. If you are not using OMF’s you then must pass the full qualified name.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
SQL> select * from v$logfile; GROUP# STATUS TYPE IS_MEMBER ---------------------------------------------------------------------------------------------- 3 ONLINE /test/db/PRIMARYDB/onlinelog/o1_mf_3_310n22jj_.log NO 2 ONLINE /test/db/PRIMARYDB/onlinelog/o1_mf_2_310n21sx_.log NO 1 ONLINE /test/db/PRIMARYDB/onlinelog/o1_mf_1_310n215q_.log NO SQL> select bytes from v$log; BYTES ---------- 52428800 52428800 52428800 SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 4 SIZE 50M; Database altered. SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 5 SIZE 50M; Database altered. SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 6 SIZE 50M; Database altered. SQL> select * from v$logfile; GROUP# STATUS TYPE IS_MEMBER ---------- ------- ------- ----------------------------------------------------------- 3 ONLINE /test/db/PRIMARYDB/onlinelog/o1_mf_3_310n22jj_.log NO 2 ONLINE /test/db/PRIMARYDB/onlinelog/o1_mf_2_310n21sx_.log NO 1 ONLINE /test/db/PRIMARYDB/onlinelog/o1_mf_1_310n215q_.log NO 4 STANDBY /test/db/PRIMARYDB/onlinelog/o1_mf_4_3gznjc9v_.log NO 5 STANDBY /test/db/PRIMARYDB/onlinelog/o1_mf_5_3gznnrh0_.log NO 6 STANDBY /test/db/PRIMARYDB/onlinelog/o1_mf_6_3gznrwd7_.log NO 6 rows selected. |
CONTINUED IN THE NEXT ARTICLE……………………………