Current Environment:
Operating System: Oracle Linux 6.3
RDBMS Version : 11.2.0.4
Operating System: Oracle Linux 6.3
RDBMS Version : 11.2.0.4
Step 1: Please perform below prerequisites before proceeding
further:
- DG_BROKER_START initialization parameter must be TRUE in both Primary and Standby databases.
- Primary database must be in ARCHIVELOG mode.
- Primary and Standby databases must be in MOUNT or OPEN mode.
- Redo log files must be configured in your physical standby environment.
- TNS entry must be configured in both Primary and Standby environment.
- Database must be running in Enterprise Edition.
- Compatible parameter must be set to 10.2.0.1.0 or later.
Step 2: Check the broker parameter whether it is TRUE, if not then set it to TRUE in
both Primary and Standby databases.
On Primary:
SQL> show parameter broker
NAME TYPE
VALUE
------------------------------------ -----------
------------------------------
dg_broker_config_file1 string /home/oracle/u01/product/11.2.
0/dbhome_1/dbs/dr1DC.dat
dg_broker_config_file2 string /home/oracle/u01/product/11.2.
0/dbhome_1/dbs/dr2DC.dat
dg_broker_start boolean
FALSE
SQL> alter system set dg_broker_start=true
scope=spfile;
System altered.
SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.
Total System Global Area 784998400 bytes
Fixed Size 2257352 bytes
Variable Size 515903032 bytes
Database Buffers 264241152 bytes
Redo Buffers 2596864 bytes
Database mounted.
Database opened.
On Standby:
NAME DB_UNIQUE_NAME DATABASE_ROLE OPEN_MODE CONTROL SWITCHOVER_STATUS
--------- ------------------------------
---------------- -------------------- ------- --------------------
DC DR
PHYSICAL STANDBY MOUNTED STANDBY NOT ALLOWED
SQL> show parameter broker
NAME TYPE
VALUE
------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string /home/oracle/u01/product/11.2.
0/dbhome_1/dbs/dr1DR.dat
dg_broker_config_file2 string /home/oracle/u01/product/11.2.
0/dbhome_1/dbs/dr2DR.dat
dg_broker_start boolean
FALSE
SQL> alter system set dg_broker_start=true
scope=spfile;
System altered.
SQL> shut immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 784998400 bytes
Fixed Size 2257352 bytes
Variable Size 515903032 bytes
Database Buffers 264241152 bytes
Redo Buffers 2596864 bytes
Database mounted.
SQL>
SQL> show parameter broker
NAME TYPE
VALUE
------------------------------------ -----------
------------------------------
dg_broker_config_file1 string /home/oracle/u01/product/11.2.
0/dbhome_1/dbs/dr1DR.dat
dg_broker_config_file2 string /home/oracle/u01/product/11.2.
0/dbhome_1/dbs/dr2DR.dat
dg_broker_start boolean
TRUE
Step 3: You will get below error message when you login to
DGMGRL first time.
[oracle@dc ~]$ dgmgrl
DGMGRL for Linux: Version 11.2.0.4.0 - 64bit
Production
Copyright (c) 2000, 2009, Oracle. All rights
reserved.
Welcome to DGMGRL, type "help" for
information.
DGMGRL> connect sys/oracle
Connected.
DGMGRL>
DGMGRL> show configuration
ORA-16532: Data Guard broker configuration does not
exist
Configuration details cannot be determined by DGMGRL
DGMGRL>
Step 4: Now add Primary database to the Broker.
[oracle@dc ~]$ dgmgrl
DGMGRL for Linux: Version 11.2.0.4.0 - 64bit
Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for
information.
DGMGRL> connect sys/oracle
Connected.
DGMGRL>
DGMGRL> create configuration 'Broker' as primary
database is DC connect identifier is DC;
Configuration "Broker" created with
primary database "dc"
DGMGRL>
DGMGRL>
Step 5: Now add Standby database to the Broker.
[oracle@dc ~]$ dgmgrl
DGMGRL for Linux: Version 11.2.0.4.0 - 64bit
Production
Copyright (c) 2000, 2009, Oracle. All rights
reserved.
Welcome to DGMGRL, type "help" for
information.
DGMGRL> connect sys/oracle
Connected.
DGMGRL>
DGMGRL> ADD DATABASE DR AS CONNECT IDENTIFIER IS
DR;
Database "dr" added
DGMGRL>
DGMGRL>
Step 6: Check the configuration which is still in disabled
status. You need to enable it.
DGMGRL> show configuration;
Configuration - Broker
Protection
Mode: MaxPerformance
Databases:
dc -
Primary database
dr -
Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
DISABLED
DGMGRL>
DGMGRL> enable configuration;
Enabled.
DGMGRL>
Step 7: Still you will get below error message if you have
not configured standby redo logs in Physical Standby database. You must need to
add SRLs. Also create standby controlfile to get the details about newly
created SRLs.
DGMGRL> show configuration;
Configuration - Broker
Protection
Mode: MaxPerformance
Databases:
dc -
Primary database
Warning: ORA-16789: standby redo logs not configured
dr -
Physical standby database
Error:
ORA-16525: the Data Guard broker is not yet available
Fast-Start Failover: DISABLED
Configuration Status:
ERROR
DGMGRL>
SQL> alter database add standby logfile group
4('/home/oracle/datafile/DC/redostand01.log') size 50m;
Database altered.
SQL> alter database add standby logfile group
5('/home/oracle/datafile/DC/redostand02.log') size 50m;
Database altered.
SQL> alter database add standby logfile group
6('/home/oracle/datafile/DC/redostand03.log') size 50m;
Database altered.
SQL> alter database add standby logfile group
7('/home/oracle/datafile/DC/redostand04.log') size 50m;
Database altered.
SQL> alter database create standby
controlfile as '/home/oracle/datafile/DC/stand.ctl';
Database altered.
Step 8: Copy these SRLs and standby control file to standby
location and restore controlfile.
oracle@dc DC]$ cd /home/oracle/datafile/DC/
oracle@dc DC]$ scp redostand0*
oracle@192.*.*.*:/home/oracle/datafile/DC/.
The authenticity of host '192.*.*.*
(192.*.*.*)' can't be established.
RSA key fingerprint is
d4:e0:7b:40:14:4f:33:60:9d:90:30:55:8d:c2:9c:ce.
Are you sure you want to continue connecting
(yes/no)? yes
Warning: Permanently added '192.*.*.*' (RSA) to
the list of known hosts.
oracle@192.168.*.*'s password:
redostand01.log 100% 50MB
50.0MB/s 00:01
redostand02.log 100% 50MB 50.0MB/s
00:01
redostand03.log 100% 50MB 50.0MB/s
00:00
redostand04.log 100% 50MB 50.0MB/s
00:01
[oracle@dc DC]$ scp stand.ctl
oracle@192.*.*.*:/home/oracle/datafile/DC/.
oracle@192.*.*.*'s password:
stand.ctl 100%
9744KB 9.5MB/s 00:00
SQL> shut immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise
Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real
Application Testing options
[oracle@dr ~]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on
Fri Aug 11 11:53:35 2017
Copyright (c) 1982, 2011, Oracle and/or its
affiliates. All rights reserved.
connected to target database (not started)
RMAN> startup nomount;
Oracle instance started
Total System Global Area 784998400 bytes
Fixed Size 2257352 bytes
Variable Size 515903032 bytes
Database Buffers 264241152 bytes
Redo Buffers 2596864 bytes
RMAN> restore standby controlfile from '/home/oracle/datafile/DC/stand.ctl';
Starting restore at 11-AUG-17
using target database control file instead of
recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK
channel ORA_DISK_1: copied control file copy
output file name=/home/oracle/u01/control01.ctl
output file name=/home/oracle/u01/control02.ctl
Finished restore at 11-AUG-17
RMAN>
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN>
RMAN> exit
[oracle@dr ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Fri Aug
11 11:55:16 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release
11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real
Application Testing options
SQL>
SQL> alter database recover managed standby
database disconnect from session;
Database altered.
SQL> set lines 300 pages 3000
SQL> col member for a56
SQL> select * from v$logfile;
GROUP#
STATUS TYPE MEMBER IS_
---------- ------- -------
-------------------------------------------------------- ---
3 ONLINE
/home/oracle/datafile/DC/redo03.log NO
2 ONLINE
/home/oracle/datafile/DC/redo02.log NO
1 ONLINE
/home/oracle/datafile/DC/redo01.log NO
4 STANDBY
/home/oracle/datafile/DC/redostand01.log NO
5 STANDBY
/home/oracle/datafile/DC/redostand02.log NO
6 STANDBY
/home/oracle/datafile/DC/redostand03.log NO
7 STANDBY
/home/oracle/datafile/DC/redostand04.log NO
7 rows selected.
You can see that newly created SRLs are now part of the
physical standby database.
Step 9: Now check the configuration again from both primary and standby side and also verify everything
is up and running fine.
DGMGRL>
DGMGRL> show configuration;
Configuration - Broker
Protection Mode:
MaxPerformance
Databases:
dc - Primary
database
dr - Physical
standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL>
DGMGRL>
DGMGRL> show configuration verbose;
Configuration - Broker
Protection Mode:
MaxPerformance
Databases:
dc - Primary
database
dr - Physical
standby database
Properties:
FastStartFailoverThreshold =
'30'
OperationTimeout = '30'
FastStartFailoverLagLimit =
'30'
CommunicationTimeout =
'180'
ObserverReconnect =
'0'
FastStartFailoverAutoReinstate =
'TRUE'
FastStartFailoverPmyShutdown =
'TRUE'
BystandersFollowRoleChange = 'ALL'
ObserverOverride =
'FALSE'
ExternalDestination1 =
''
ExternalDestination2 =
''
PrimaryLostWriteAction =
'CONTINUE'
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
You have successfully created Dataguard Broker.
Thanks for reading this post ! Please comment if you like this post.
Wow very nice easily understandable the concept and processes to configure dg broker..
ReplyDelete