You are on page 1of 34

Step-1: Parameter Settings .

This needs to be executed in both Primary and Standby notes

SQL> ALTER DATABASE FORCE LOGGING;


Step-2: Parameter Settings

We need to check the following parameter in Primary system. No action here and proceed for "Step-
2".

db_unique_name='BP1' #Already set by default

dg_broker_start=true

local_listener='Listener_O12' # Not required

log_archive_dest_1='LOCATION="H:\oracle\BP1\oraarch", valid_for=(ONLINE_LOGFILE,ALL_ROLES)'

log_archive_dest_state_1='ENABLE'

log_archive_format='%t_%s_%r.dbf'

log_archive_max_processes=2

log_archive_min_succeed_dest=1

log_archive_trace=0
log_file_name_convert='O12','O12'

standby_file_management='AUTO'

Step-2:

#As per "Step-2", run the following command in the Primary system in SQL Prompt and copy the
output in a notepad':

show parameter db_unique_name

show parameter dg_broker_start

show parameter local_listener

show parameter log_archive_dest_1


show parameter log_archive_dest_state_1

show parameter log_archive_format

show parameter log_archive_max_processes

show parameter log_archive_min_succeed_dest

show parameter log_archive_trace

show parameter log_file_name_convert

show parameter standby_file_management

Step-3:

#As per "Step-2", the following output is copied in a notepad and verify the parameter as per the
step#1:

SQL> show parameter db_unique_name

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

db_unique_name string BP1

SQL> show parameter dg_broker_start

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

dg_broker_start boolean FALSE

SQL> show parameter local_listener

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

local_listener string (ADDRESS=(PROTOCOL=IPC)(KEY=RE

GISTER_FslSAPBP1DBSD))

SQL> show parameter log_archive_dest_1


NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

log_archive_dest_1 string LOCATION=H:\oracle\BP1\oraarch

\BP1arch

log_archive_dest_10 string

log_archive_dest_11 string

log_archive_dest_12 string

log_archive_dest_13 string

log_archive_dest_14 string

log_archive_dest_15 string

log_archive_dest_16 string

log_archive_dest_17 string

log_archive_dest_18 string

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

log_archive_dest_19 string

SQL> show parameter log_archive_dest_state_1

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

log_archive_dest_state_1 string enable

log_archive_dest_state_10 string enable

log_archive_dest_state_11 string enable

log_archive_dest_state_12 string enable

log_archive_dest_state_13 string enable

log_archive_dest_state_14 string enable

log_archive_dest_state_15 string enable


log_archive_dest_state_16 string enable

log_archive_dest_state_17 string enable

log_archive_dest_state_18 string enable

log_archive_dest_state_19 string enable

SQL> show parameter log_archive_format

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

log_archive_format string %t_%s_%r.dbf

SQL> show parameter log_archive_max_processes

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

log_archive_max_processes integer 4

SQL> show parameter log_archive_min_succeed_dest

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

log_archive_min_succeed_dest integer 1

SQL> show parameter log_archive_trace

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

log_archive_trace integer 0

SQL> show parameter log_file_name_convert

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

log_file_name_convert string
SQL> show parameter standby_file_management

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

standby_file_management string MANUAL

SQL>

Step-4:

#Take the backup of init<SID>.ora, spfile etc. Refer the screenshot attached in the word document in
primary system:

eg:

In my system:

I:\oracle\BP1\sapdata1\database

I:\oracle\BP1\sapprof (Screenshot-3)

E:\usr\sap\BP1\SYS\profile\oracle
Step-5:

Based on the above output, we need to compare the value in "Step-1" and "Step-3"as given above.
The new values need to be applied as follows. Execute it in the sql prompt of primary system.

(Sample Screenshots provided in the Annexure-1 (end of the document) for the below commands)

alter system set dg_broker_start=true scope=both;

alter system set log_archive_dest_1='LOCATION="H:\oracle\BP1\oraarch",


valid_for=(ONLINE_LOGFILE,ALL_ROLES)'
alter system set standby_file_management='AUTO' scope=both;

Step-6

We need to add the following parameter in Primary System through SQL prompt.

alter system set fal_server='bp1_dr.world' scope=BOTH;

alter system set FAL_CLIENT='bp1.world' scope=BOTH;

Refer the following link:

https://imbibhuti.wordpress.com/2013/10/15/fal_client-and-fal_server-parameters/

Step-7

We need to add the following parameter in Primary System through SQL prompt.

ALTER SYSTEM SET log_archive_dest_2='service="bp1.world"','ASYNC NOAFFIRM delay=0 optional


compression=disable max_failure=100 max_connections=1 reopen=300 db_unique_name="bp1_dr"
net_timeout=30','valid_for=(online_logfile,all_roles)' SCOPE=BOTH;
Standby:

Step-7

#For Standby system.

Proceed the step Step-1 to Step-5 as above for Standby system.

Step-8

#For Standby system.

alter system set fal_server='bp1.world' scope=BOTH

alter system set FAL_CLIENT='bp1_dr.world' scope=BOTH

Step-9

#For Standby system.

ALTER SYSTEM SET log_archive_dest_2='service="bp1_dr.world"','ASYNC NOAFFIRM delay=0 optional


compression=disable max_failure=100 max_connections=1 reopen=300 db_unique_name="bp1"
net_timeout=30','valid_for=(online_logfile,all_roles)' SCOPE=BOTH;
Step-10:

Before configuring the dataguard, the pre-requisites are

a) All the above-mentioned steps to be completed.


b) Tnsping should be completed. In case of tnsping issue we need look for listener.ora,
tnasnames.ora and sqlnet.ora)
c) How to check the tnsping given in Annexure-2

Connect to Data Guard and configuration Configuration

C:\Users\bp1adm>dgmgrl /

create configuration oqbp1 as primary database is BP1 connect identifier is BP1.WORLD;

add database BP1_DR as connect identifier is BP1_DR.WORLD maintained as physical;


Check the configuration:
Step-11:
In the above, screenshot, we can see that “Configuration Status” is “DISABLED”. Now we need to
enable. Before enabling, cross verify the above parameter for both ‘bp1’ ad bp1_dr’
Based on the above both screenshot for “BP1” and “BP1_DR”, the following parameter needs to be
corrected or modified.:

How to modify the DGMGRL parameter, please refer the annexure 4.

DGMGR  for BP1


EDIT DATABASE BP1 SET PROPERTY LogXptMode='ASYNC'; (already in place. No need to modify)

EDIT DATABASE BP1 SET PROPERTY DelayMins='0'; (already in place. No need to modify)

EDIT DATABASE GP1 SET PROPERTY MaxFailure='100'; (For my case I am not changing currently. As per
document we need to change 100)

EDIT DATABASE GP1 set PROPERTY hostname = 'Primary'; (already in place. No need to modify)

EDIT DATABASE GP1 set PROPERTY logfilenameconvert ="'BP1','BP1'"; (Since the Source and target are
same, so No need to modify)

EDIT DATABASE BP1 set PROPERTY StandbyArchiveLocation='C:\oracle\BP1\oraarch'; (This change is a


must)

EDIT DATABASE BP1 set TransportLagThreshold = '0'; (As per the annexure 4 screenshot, it seems this
parameter is a must)

EDIT DATABASE BP1 set PROPERTY ApplyLagThreshold = '0'; (I just documented. Incase of any issue we
will modify)

EDIT DATABASE BP1 set PROPERTY TransportDisconnectedThreshold = '0'; (I just documented. Incase of
any issue we will modify)

DGMGR  for BP1_DR

EDIT DATABASE GP1_DR SET PROPERTY LogXptMode='ASYNC'; (already in place. No need to modify)

EDIT DATABASE BP1_DR SET PROPERTY DelayMins='0'; (already in place. No need to modify)

EDIT DATABASE GP1_DR SET PROPERTY MaxFailure='100'; (For my case I am not changing currently. As
per document we need to change 100)

EDIT DATABASE GP1_DR set PROPERTY hostname = 'Primary'; (already in place. No need to modify)

EDIT DATABASE GP1_DR set PROPERTY logfilenameconvert ="'BP1','BP1'"; (Since the Source and target
are same, so No need to modify)

EDIT DATABASE BP1_DR set PROPERTY StandbyArchiveLocation='C:\oracle\BP1\oraarch'; (This change


is a must)

EDIT DATABASE BP1_DR set TransportLagThreshold = '0'; (As per the annexure 4 screenshot, it seems
this parameter is a must)

EDIT DATABASE BP1_DR set PROPERTY ApplyLagThreshold = '0'; (I just documented. Incase of any issue
we will modify)
EDIT DATABASE BP1_DR set PROPERTY TransportDisconnectedThreshold = '0'; (I just documented.
Incase of any issue we will modify)

Step-12

Step-13

DGMGRL> enable configuration

The “configuration status” should be “SUCCESS”. That means every configuration is configured
correctly. Else we need to troubleshoot.
Step-14

For other command for checking the DGMGRL configuration, trouble shooting, check the Annexure-3.
This should always run in the node where the primary database is running.
Annexure-1

The following are the Sample Screenshots (No action or steps here). Just an information only:
alter system set local_listener = '(ADDRESS = (PROTOCOL = TCP)(HOST = primary)(PORT = 1527))'
SCOPE=BOTH;
Standby
Annexure-2

From Primary

C:>tnsping BP1

C:>tnsping BP1.World
C:>tnsping BP1_DR

C:>tnsping BP1._DRWorld
sqlplus sys/Welcome1234$@BP1_DR.WORLD as sysdba

sqlplus sys/Welcome1234$@BP1.WORLD as sysdba


From Standby

C:>tnsping BP1_DR

C:>tnsping BP1._DRWorld
C:>tnsping BP1

C:>tnsping BP1.World
sqlplus sys/Welcome1234$@BP1_DR.WORLD as sysdba

sqlplus sys/Welcome1234$@BP1.WORLD as sysdba


Annexure-3

This should always run in the node where the primary database is running.
Annexure-4

The following is the example. We need to verify the parameter as per the Step-11 and then modify.

EDIT DATABASE GP1_DR SET PROPERTY LogXptMode='ASYNC';

EDIT DATABASE BP1_DR SET PROPERTY DelayMins='0';


EDIT DATABASE GP1_DR SET PROPERTY MaxFailure='100';

EDIT DATABASE GP1_DR set PROPERTY hostname = 'Standby';

EDIT DATABASE GP1_DR set PROPERTY logfilenameconvert ="'BP1','BP1'";

EDIT DATABASE BP1_DR set PROPERTY StandbyArchiveLocation='C:\oracle\BP1\oraarch';

EDIT DATABASE BP1_DR set PROPERTY ApplyLagThreshold = '0';

EDIT DATABASE BP1_DR set PROPERTY TransportDisconnectedThreshold = '0';

You might also like