Configuration
of 10g Data Guard Broker and Observer for Switchover
Configuring Data
Guard Broker for Switchover, General Review.
On a previous document, 10g Data Guard, Physical Standby Creation, step by step I did describe how to implement a Data Guard
configuration; on this document I'm adding how to configure the broker and observer, setup the database to Maximum Availability and
managing switchover from Data Guard Manager, DGMGRL.
Data Guard Broker permit to manage a Data Guard Configuration, from both the Enterprise Manager Grid Control console, or from a
terminal in command line mode. In this document I will explore command line mode.
Pre requisites include the use of 10g Oracle server, using spfile on both the primary and standby and a third server for the Observer,
and configure the listeners to include a service for the Data Guard Broker.
The Enviroment
• 2 Linux servers, Oracle Distribution 2.6.9-55 EL i686 i386 GNU/Linux, the Primary and Standby databases are located on these
servers.
• 1 Linux server, RH Linux 2.6.9-42.ELsmp x86_64 GNU/Linux, The Data Guard Broker Observer is located on this server
• Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
ssh is configured for user oracle on both nodes
• Oracle Home is on identical path on both nodes
• Primary database PROD
• Standby database STDBY
Step by Step Implementation of Data Guard Broker
Enable Data Guard Broker
Start on the Primary and Standby databases
SQL> ALTER SYSTEM SET DG_BROKER_START=TRUE SCOPE=BOTH;
System altered.
SQL> ALTER SYSTEM SET DG_BROKER_START=TRUE SCOPE=BOTH;
System altered.
Setup the Local_Listener parameter on both the Primary and Standby databases
SQL> ALTER SYSTEM SET LOCAL_LISTENER='(ADDRESS = (PROTOCOL = TCP)(HOST = rac1.localdomain)(PORT = 1521)(IP = FIRST))' SCOPE=BOTH;
System altered.
Setup the tnsnames to enable communication with both the Primary and Standby databases
The listener.ora should include a service named global_db_nameDGMGRL to enable the broker to start the databases on the event of
switchover. This configuration needs to be included on both servers.
Listener.ora on Node 1
LISTENER_VMRACTEST =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1.localdomain)(PORT = 1521)(IP = FIRST))
)
)
SID_LIST_LISTENER_VMRACTEST =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = PROD)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1 )
(SID_NAME = PROD)
)
(SID_DESC =
(SID_NAME= PROD)
(GLOBAL_DBNAME = PROD_DGMGRL)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1 )
)
)
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1.localdomain)(PORT = 1521)(IP = FIRST))
)
)
SID_LIST_LISTENER_VMRACTEST =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = PROD)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1 )
(SID_NAME = PROD)
)
(SID_DESC =
(SID_NAME= PROD)
(GLOBAL_DBNAME = PROD_DGMGRL)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1 )
)
)
Listener.ora on Node 2
LISTENER_VMRACTEST =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac2.localdomain)(PORT = 1521)(IP = FIRST))
)
)
SID_LIST_LISTENER_VMRACTEST =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = STDBY)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1 )
(SID_NAME = STDBY)
)
(SID_DESC =
(SID_NAME= STDBY)
(GLOBAL_DBNAME = STDBY_DGMGRL)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1 )
)
)
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac2.localdomain)(PORT = 1521)(IP = FIRST))
)
)
SID_LIST_LISTENER_VMRACTEST =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = STDBY)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1 )
(SID_NAME = STDBY)
)
(SID_DESC =
(SID_NAME= STDBY)
(GLOBAL_DBNAME = STDBY_DGMGRL)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1 )
)
)
Tnsnames.ora on Node 1, 2
and the observer node
PROD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PROD_DGMGRL)
)
)
STDBY =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac2.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = STDBY_DGMGRL)
)
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PROD_DGMGRL)
)
)
STDBY =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac2.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = STDBY_DGMGRL)
)
)
Setup the Broker
configuration files
The broker
configuration files are automatically created when the broker is started using
ALTER SYSTEM SET
DG_BROKER_START=TRUE.
The default destination can be modified using the parameters DG_BROKER_CONFIG_FILE1 and DG_BROKER_CONFIG_FILE2
On Primary:
SQL>SHOW PARAMETERS DG_BROKER_CONFIG
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string /u01/app/oracle/product/10.2.0
/db_1/dbs/dr1PROD.dat
dg_broker_config_file2 string /u01/app/oracle/product/10.2.0
/db_1/dbs/dr2PROD.dat
On standby:
SQL> SHOW PARAMETERS DG_BROKER_CONFIG
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string /u01/app/oracle/product/10.2.0
/db_1/dbs/dr1STDBY.dat
dg_broker_config_file2 string /u01/app/oracle/product/10.2.0
/db_1/dbs/dr2STDBY.dat
Next create from within the DGMGRL the configuration
[oracle@rac1 ~]$ dgmgrl
DGMGRL for Linux: Version 10.2.0.1.0 - Production
Copyright (c) 2000, 2005, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/oracle@PROD
Connected.
DGMGRL> create configuration PROD AS
> PRIMARY DATABASE IS PROD
> CONNECT IDENTIFIER IS PROD;
Configuration "PROD" created with primary database "PROD"
Add the standby to the configuration and check it
DGMGRL> ADD DATABASE STDBY AS
> CONNECT IDENTIFIER IS STDBY
> MAINTAINED AS PHYSICAL;
Database "STDBY" added
DGMGRL> SHOW CONFIGURATION;
Configuration
Name: PROD
Enabled: NO
Protection Mode: MaxPerformance
Fast-Start Failover: DISABLED
Databases:
PROD - Primary database
STDBY - Physical standby database
Current status for "PROD":
DISABLED
DGMGRL> SHOW DATABASE VERBOSE STDBY;
Database
Name: STDBY
Role: PHYSICAL STANDBY
Enabled: NO
Intended State: OFFLINE
Instance(s):
STDBY
Properties:
InitialConnectIdentifier = 'STDBY'
LogXptMode = 'ARCH'
Dependency = ''
DelayMins = '0'
Binding = 'OPTIONAL'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '180'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'auto'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '30'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = '/u01/app/oracle/oradata/PROD/, /u01/app /oracle/oradata/STDBY/'
LogFileNameConvert = '/u01/app/oracle/oradata/PROD/, /u01/app /oracle/oradata/STDBY/'
FastStartFailoverTarget = ''
StatusReport = '(monitor)'
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
HostName = 'rac2'
SidName = 'STDBY'
LocalListenerAddress = '(ADDRESS=(PROTOCOL=TCP)(HOST=rac2.localdo main)(PORT=1521))'
StandbyArchiveLocation = '/u01/app/oracle/oradata/STDBY/arch/'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.arc'
LatestLog = '(monitor)'
TopWaitEvents = '(monitor)'
Current status for "STDBY":
DISABLED
DGMGRL> show database verbose PROD;
Database
Name: PROD
Role: PRIMARY
Enabled: NO
Intended State: OFFLINE
Instance(s):
PROD
Properties:
InitialConnectIdentifier = 'PROD'
LogXptMode = 'ASYNC'
Dependency = ''
DelayMins = '0'
Binding = 'OPTIONAL'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '180'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'auto'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '30'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = '/u01/app/oracle/oradata/STDBY/, /u01/app/o racle/oradata/PROD/'
LogFileNameConvert = '/u01/app/oracle/oradata/STDBY/, /u01/app/o racle/oradata/PROD/'
FastStartFailoverTarget = ''
StatusReport = '(monitor)'
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
HostName = 'rac1'
SidName = 'PROD'
LocalListenerAddress = '(ADDRESS=(PROTOCOL=TCP)(HOST=rac1.localdo main)(PORT=1521))'
StandbyArchiveLocation = '/u01/app/oracle/oradata/PROD/arch/'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.arc'
LatestLog = '(monitor)'
TopWaitEvents = '(monitor)'
Current status for "PROD":
DISABLED
DGMGRL> enable configuration;
Enabled.
DGMGRL> show configuration;
Configuration
Name: PROD
Enabled: YES
Protection Mode: MaxPerformance
Fast-Start Failover: DISABLED
Databases:
PROD - Primary database
STDBY - Physical standby database
Current status for "PROD":
SUCCESS
DGMGRL> enable database STDBY;
Enabled.
DGMGRL> SHOW DATABASE VERBOSE STDBY;
Database
Name: STDBY
Role: PHYSICAL STANDBY
Enabled: YES
Intended State: ONLINE
Instance(s):
STDBY
Properties:
InitialConnectIdentifier = 'STDBY'
LogXptMode = 'ARCH'
Dependency = ''
DelayMins = '0'
Binding = 'OPTIONAL'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '180'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'auto'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '30'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = '/u01/app/oracle/oradata/PROD/, /u01/app/oracle/oradata/STDBY/'
LogFileNameConvert = '/u01/app/oracle/oradata/PROD/, /u01/app/oracle/oradata/STDBY/'
FastStartFailoverTarget = ''
StatusReport = '(monitor)'
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
HostName = 'rac2'
SidName = 'STDBY'
LocalListenerAddress = '(ADDRESS=(PROTOCOL=TCP)(HOST=rac2.localdomain)(PORT=1521))'
StandbyArchiveLocation = '/u01/app/oracle/oradata/STDBY/arch/'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.arc'
LatestLog = '(monitor)'
TopWaitEvents = '(monitor)'
Current status for "STDBY":
SUCCESS
Enabling the configuration and databases
DGMGRL> enable configuration;
Enabled.
DGMGRL> show configuration;
Configuration
Name: PROD
Enabled: YES
Protection Mode: MaxPerformance
Fast-Start Failover: DISABLED
Databases:
PROD - Primary database
STDBY - Physical standby database
Current status for "PROD":
SUCCESS
DGMGRL> enable database STDBY;
Enabled.
DGMGRL> SHOW DATABASE VERBOSE STDBY;
Database
Name: STDBY
Role: PHYSICAL STANDBY
Enabled: YES
Intended State: ONLINE
Instance(s):
STDBY
Properties:
InitialConnectIdentifier = 'STDBY'
LogXptMode = 'ARCH'
Dependency = ''
DelayMins = '0'
Binding = 'OPTIONAL'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '180'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'auto'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '30'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = '/u01/app/oracle/oradata/PROD/, /u01/app/oracle/oradata/STDBY/'
LogFileNameConvert = '/u01/app/oracle/oradata/PROD/, /u01/app/oracle/oradata/STDBY/'
FastStartFailoverTarget = ''
StatusReport = '(monitor)'
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
HostName = 'rac2'
SidName = 'STDBY'
LocalListenerAddress = '(ADDRESS=(PROTOCOL=TCP)(HOST=rac2.localdomain)(PORT=1521))'
StandbyArchiveLocation = '/u01/app/oracle/oradata/STDBY/arch/'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.arc'
LatestLog = '(monitor)'
TopWaitEvents = '(monitor)'
Current status for "STDBY":
SUCCESS
Enabling Fast Start Failover and the Observer
These are the steps required to enable and check Fast Start Failover and the Observer:
DG_BROKER_START=TRUE.
The default destination can be modified using the parameters DG_BROKER_CONFIG_FILE1 and DG_BROKER_CONFIG_FILE2
On Primary:
SQL>SHOW PARAMETERS DG_BROKER_CONFIG
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string /u01/app/oracle/product/10.2.0
/db_1/dbs/dr1PROD.dat
dg_broker_config_file2 string /u01/app/oracle/product/10.2.0
/db_1/dbs/dr2PROD.dat
On standby:
SQL> SHOW PARAMETERS DG_BROKER_CONFIG
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string /u01/app/oracle/product/10.2.0
/db_1/dbs/dr1STDBY.dat
dg_broker_config_file2 string /u01/app/oracle/product/10.2.0
/db_1/dbs/dr2STDBY.dat
Next create from within the DGMGRL the configuration
[oracle@rac1 ~]$ dgmgrl
DGMGRL for Linux: Version 10.2.0.1.0 - Production
Copyright (c) 2000, 2005, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/oracle@PROD
Connected.
DGMGRL> create configuration PROD AS
> PRIMARY DATABASE IS PROD
> CONNECT IDENTIFIER IS PROD;
Configuration "PROD" created with primary database "PROD"
Add the standby to the configuration and check it
DGMGRL> ADD DATABASE STDBY AS
> CONNECT IDENTIFIER IS STDBY
> MAINTAINED AS PHYSICAL;
Database "STDBY" added
DGMGRL> SHOW CONFIGURATION;
Configuration
Name: PROD
Enabled: NO
Protection Mode: MaxPerformance
Fast-Start Failover: DISABLED
Databases:
PROD - Primary database
STDBY - Physical standby database
Current status for "PROD":
DISABLED
DGMGRL> SHOW DATABASE VERBOSE STDBY;
Database
Name: STDBY
Role: PHYSICAL STANDBY
Enabled: NO
Intended State: OFFLINE
Instance(s):
STDBY
Properties:
InitialConnectIdentifier = 'STDBY'
LogXptMode = 'ARCH'
Dependency = ''
DelayMins = '0'
Binding = 'OPTIONAL'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '180'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'auto'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '30'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = '/u01/app/oracle/oradata/PROD/, /u01/app /oracle/oradata/STDBY/'
LogFileNameConvert = '/u01/app/oracle/oradata/PROD/, /u01/app /oracle/oradata/STDBY/'
FastStartFailoverTarget = ''
StatusReport = '(monitor)'
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
HostName = 'rac2'
SidName = 'STDBY'
LocalListenerAddress = '(ADDRESS=(PROTOCOL=TCP)(HOST=rac2.localdo main)(PORT=1521))'
StandbyArchiveLocation = '/u01/app/oracle/oradata/STDBY/arch/'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.arc'
LatestLog = '(monitor)'
TopWaitEvents = '(monitor)'
Current status for "STDBY":
DISABLED
DGMGRL> show database verbose PROD;
Database
Name: PROD
Role: PRIMARY
Enabled: NO
Intended State: OFFLINE
Instance(s):
PROD
Properties:
InitialConnectIdentifier = 'PROD'
LogXptMode = 'ASYNC'
Dependency = ''
DelayMins = '0'
Binding = 'OPTIONAL'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '180'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'auto'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '30'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = '/u01/app/oracle/oradata/STDBY/, /u01/app/o racle/oradata/PROD/'
LogFileNameConvert = '/u01/app/oracle/oradata/STDBY/, /u01/app/o racle/oradata/PROD/'
FastStartFailoverTarget = ''
StatusReport = '(monitor)'
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
HostName = 'rac1'
SidName = 'PROD'
LocalListenerAddress = '(ADDRESS=(PROTOCOL=TCP)(HOST=rac1.localdo main)(PORT=1521))'
StandbyArchiveLocation = '/u01/app/oracle/oradata/PROD/arch/'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.arc'
LatestLog = '(monitor)'
TopWaitEvents = '(monitor)'
Current status for "PROD":
DISABLED
DGMGRL> enable configuration;
Enabled.
DGMGRL> show configuration;
Configuration
Name: PROD
Enabled: YES
Protection Mode: MaxPerformance
Fast-Start Failover: DISABLED
Databases:
PROD - Primary database
STDBY - Physical standby database
Current status for "PROD":
SUCCESS
DGMGRL> enable database STDBY;
Enabled.
DGMGRL> SHOW DATABASE VERBOSE STDBY;
Database
Name: STDBY
Role: PHYSICAL STANDBY
Enabled: YES
Intended State: ONLINE
Instance(s):
STDBY
Properties:
InitialConnectIdentifier = 'STDBY'
LogXptMode = 'ARCH'
Dependency = ''
DelayMins = '0'
Binding = 'OPTIONAL'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '180'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'auto'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '30'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = '/u01/app/oracle/oradata/PROD/, /u01/app/oracle/oradata/STDBY/'
LogFileNameConvert = '/u01/app/oracle/oradata/PROD/, /u01/app/oracle/oradata/STDBY/'
FastStartFailoverTarget = ''
StatusReport = '(monitor)'
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
HostName = 'rac2'
SidName = 'STDBY'
LocalListenerAddress = '(ADDRESS=(PROTOCOL=TCP)(HOST=rac2.localdomain)(PORT=1521))'
StandbyArchiveLocation = '/u01/app/oracle/oradata/STDBY/arch/'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.arc'
LatestLog = '(monitor)'
TopWaitEvents = '(monitor)'
Current status for "STDBY":
SUCCESS
Enabling the configuration and databases
DGMGRL> enable configuration;
Enabled.
DGMGRL> show configuration;
Configuration
Name: PROD
Enabled: YES
Protection Mode: MaxPerformance
Fast-Start Failover: DISABLED
Databases:
PROD - Primary database
STDBY - Physical standby database
Current status for "PROD":
SUCCESS
DGMGRL> enable database STDBY;
Enabled.
DGMGRL> SHOW DATABASE VERBOSE STDBY;
Database
Name: STDBY
Role: PHYSICAL STANDBY
Enabled: YES
Intended State: ONLINE
Instance(s):
STDBY
Properties:
InitialConnectIdentifier = 'STDBY'
LogXptMode = 'ARCH'
Dependency = ''
DelayMins = '0'
Binding = 'OPTIONAL'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '180'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'auto'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '30'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = '/u01/app/oracle/oradata/PROD/, /u01/app/oracle/oradata/STDBY/'
LogFileNameConvert = '/u01/app/oracle/oradata/PROD/, /u01/app/oracle/oradata/STDBY/'
FastStartFailoverTarget = ''
StatusReport = '(monitor)'
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
HostName = 'rac2'
SidName = 'STDBY'
LocalListenerAddress = '(ADDRESS=(PROTOCOL=TCP)(HOST=rac2.localdomain)(PORT=1521))'
StandbyArchiveLocation = '/u01/app/oracle/oradata/STDBY/arch/'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.arc'
LatestLog = '(monitor)'
TopWaitEvents = '(monitor)'
Current status for "STDBY":
SUCCESS
Enabling Fast Start Failover and the Observer
These are the steps required to enable and check Fast Start Failover and the Observer:
1. Ensure standby
redologs are configured on all databases.
on primary:
SQL>
SELECT TYPE,MEMBER FROM V$LOGFILE;
TYPE MEMBER
------- --------------------------------------------------
ONLINE /u01/app/oracle/oradata/PROD/redo03.log
ONLINE /u01/app/oracle/oradata/PROD/redo02.log
ONLINE /u01/app/oracle/oradata/PROD/redo01.log
STANDBY /u01/app/oracle/oradata/PROD/redoby04.log
STANDBY /u01/app/oracle/oradata/PROD/redoby05.log
STANDBY /u01/app/oracle/oradata/PROD/redoby06.log
TYPE MEMBER
------- --------------------------------------------------
ONLINE /u01/app/oracle/oradata/PROD/redo03.log
ONLINE /u01/app/oracle/oradata/PROD/redo02.log
ONLINE /u01/app/oracle/oradata/PROD/redo01.log
STANDBY /u01/app/oracle/oradata/PROD/redoby04.log
STANDBY /u01/app/oracle/oradata/PROD/redoby05.log
STANDBY /u01/app/oracle/oradata/PROD/redoby06.log
On standby:
SQL> SELECT TYPE,MEMBER FROM V$LOGFILE;
TYPE MEMBER
---------- --------------------------------------------------
ONLINE /u01/app/oracle/oradata/STDBY/redo03.log
ONLINE /u01/app/oracle/oradata/STDBY/redo02.log
ONLINE /u01/app/oracle/oradata/STDBY/redo01.log
STANDBY /u01/app/oracle/oradata/STDBY/redoby04.log
STANDBY /u01/app/oracle/oradata/STDBY/redoby05.log
STANDBY /u01/app/oracle/oradata/STDBY/redoby06.log
2. Ensure the LogXptMode Property is set to SYNC.
Note: These commands will succeed only if database is configured with standby redo logs.
DGMGRL> EDIT DATABASE PROD SET PROPERTY 'LogXptMode'='SYNC';
Property "LogXptMode" updated
DGMGRL> EDIT DATABASE STDBY SET PROPERTY 'LogXptMode'='SYNC';
Property "LogXptMode" updated
3.Specify the FastStartFailoverTarget property
DGMGRL> EDIT DATABASE PROD SET PROPERTY FastStartFailoverTarget='STDBY';
Property "faststartfailovertarget" updated
DGMGRL> EDIT DATABASE STDBY SET PROPERTY FastStartFailoverTarget='PROD';
Property "faststartfailovertarget" updated
4.Upgrade the protection mode to MAXAVAILABILITY, if necessary.
DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;
Operation requires shutdown of instance "PROD" on database "PROD"
Shutting down instance "PROD"...
Database closed.
Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "PROD" on database "PROD"
Starting instance "PROD"...
ORACLE instance started.
Database mounted.
note: if ORA-12514: TNS:listener does not currently know of service
requested in connect descriptor Failed.
You are no longer connected to ORACLE
Please connect again.
You are no longer connected to ORACLE
Please connect again.
you
must start instance (primary database) manually
SQL> conn / as sysdba
SQL> startup mount;
SQL> conn / as sysdba
SQL> startup mount;
5. Enable Flashback Database on the Primary and Standby
Databases.
On
Both databases
To enter the standby into Flashback mode you must shutdown the both databases, then while the primary is down execute the
following commands on the standby:
SQL> ALTER SYSTEM SET UNDO_RETENTION=3600 SCOPE=SPFILE;
System altered.
SQL> ALTER SYSTEM SET UNDO_MANAGEMENT='AUTO' SCOPE=SPFILE;
System altered.
SQL> startup mount;
To enter the standby into Flashback mode you must shutdown the both databases, then while the primary is down execute the
following commands on the standby:
SQL> ALTER SYSTEM SET UNDO_RETENTION=3600 SCOPE=SPFILE;
System altered.
SQL> ALTER SYSTEM SET UNDO_MANAGEMENT='AUTO' SCOPE=SPFILE;
System altered.
SQL> startup mount;
SQL> ALTER DATABASE FLASHBACK ON;
Enable fast start failover
[oracle@rac1 ~]$ dgmgrl
DGMGRL for Linux: Version 10.2.0.1.0 - Production
Copyright (c) 2000, 2005, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL for Linux: Version 10.2.0.1.0 - Production
Copyright (c) 2000, 2005, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/oracle@PROD;
Connected.
Connected.
DGMGRL> show configuration verbose;
Configuration
Name: PROD
Enabled: YES
Protection Mode: MaxAvailability
Fast-Start Failover: DISABLED
Databases:
PROD - Primary database
STDBY - Physical standby database
Current status for "PROD":
SUCCESS
DGMGRL> show database STDBY;
Database
Name: STDBY
Role: PHYSICAL STANDBY
Enabled: YES
Intended State: ONLINE
Instance(s): STDBY
Current status for "STDBY":
SUCCESS
DGMGRL> ENABLE FAST_START FAILOVER;
Enabled.
Configuration
Name: PROD
Enabled: YES
Protection Mode: MaxAvailability
Fast-Start Failover: DISABLED
Databases:
PROD - Primary database
STDBY - Physical standby database
Current status for "PROD":
SUCCESS
DGMGRL> show database STDBY;
Database
Name: STDBY
Role: PHYSICAL STANDBY
Enabled: YES
Intended State: ONLINE
Instance(s): STDBY
Current status for "STDBY":
SUCCESS
DGMGRL> ENABLE FAST_START FAILOVER;
Enabled.
start the observer
Start the observer from a
third server on background. You may use a script like this:
---------------- script
start on next line --------------------
#!/bin/ksh
# startobserver
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
export BASE_PATH=/u01/app/oracle/oracle/scripts/general:/opt/CTEact/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/bin:/etc:/usr/local/maint/oracle:/usr/ccs/bin:/usr/openwin/bin:/usr/dt/bin:/usr/local/bin:.
export PATH=$ORACLE_HOME/bin:$BASE_PATH
dgmgrl << eof
connect sys/oracle@PROD
START OBSERVER;
eof
---------------- script end on previous line --------------------
#!/bin/ksh
# startobserver
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
export BASE_PATH=/u01/app/oracle/oracle/scripts/general:/opt/CTEact/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/bin:/etc:/usr/local/maint/oracle:/usr/ccs/bin:/usr/openwin/bin:/usr/dt/bin:/usr/local/bin:.
export PATH=$ORACLE_HOME/bin:$BASE_PATH
dgmgrl << eof
connect sys/oracle@PROD
START OBSERVER;
eof
---------------- script end on previous line --------------------
[oracle@rac3 ~]$ nohup ./startobserver &
nohup: appending output to `nohup.out'
[1] 27392
nohup: appending output to `nohup.out'
[1] 27392
Verify the fast-start failover configuration.
[oracle@rac3 ~]$ dgmgrl
DGMGRL for Linux: Version 10.2.0.1.0 - Production
Copyright (c) 2000, 2005, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/oracle@PROD
Connected.
[oracle@rac3 ~]$ dgmgrl
DGMGRL for Linux: Version 10.2.0.1.0 - Production
Copyright (c) 2000, 2005, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/oracle@PROD
Connected.
DGMGRL> show configuration verbose
Configuration
Name: PROD
Enabled: YES
Protection Mode: MaxAvailability
Fast-Start Failover: ENABLED
Databases:
PROD - Primary database
STDBY - Physical standby database
- Fast-Start Failover target
Fast-Start Failover
Threshold: 30 seconds
Observer: rac1
Current status for "PROD":
SUCCESS
Check that primary and standby are healthy
This check must return 'SUCCESS' as the status for both databases, otherwise it means there is a configuration problem.
DGMGRL> show database PROD
Database
Name: PROD
Role: PRIMARY
Enabled: YES
Intended State: ONLINE
Instance(s): PROD
Current status for "PROD":SUCCESS
DGMGRL> show database STDBY
Database
Name: STDBY
Role: PHYSICAL STANDBY
Enabled: YES
Intended State: ONLINE
Instance(s): STDBY
Current status for "STDBY":SUCCESS
DGMGRL>
EXECUTE THE SWITCHOVER:
DGMGRL> SWITCHOVER TO STDBY;
Performing switchover NOW, please wait...
Operation requires shutdown of instance "PROD" on database "PROD"
Shutting down instance "PROD"...
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
Operation requires shutdown of instance "STDBY" on database "STDBY"
Shutting down instance "STDBY"...
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "PROD" on database "PROD"
Starting instance "PROD"...
ORACLE instance started.
Database mounted.
Operation requires startup of instance "STDBY" on database "STDBY"
Starting instance "STDBY"...
ORACLE instance started.
Database mounted.
Switchover succeeded, new primary is "STDBY"
DGMGRL>
DGMGRL> show configuration verbose
Configuration
Name: PROD
Enabled: YES
Protection Mode: MaxAvailability
Fast-Start Failover: ENABLED
Databases:
PROD - Physical standby database
- Fast-Start Failover target
STDBY - Primary database
Fast-Start Failover
Threshold: 30 seconds
Observer: rac1
Current status for "PROD":
SUCCESS
DGMGRL> show database STDBY
Database
Name: STDBY
Role: PRIMARY
Enabled: YES
Intended State: ONLINE
Instance(s): STDBY
Current status for "STDBY":
SUCCESS
DGMGRL> show database PROD
Database
Name: PROD
Role: PHYSICAL STANDBY
Enabled: YES
Intended State: ONLINE
Instance(s): PROD
Current status for "PROD":
SUCCESS
----------------- PROBLEMS --------------------
DGMGRL> connect sys/oracle@PROD
Connected.
DGMGRL> show configuration stdby
Error: ORA-16606: unable to find property "stdby"
Error: ORA-16501: the Data Guard broker operation failed
DGMGRL> show configuration PROD
Error: ORA-16606: unable to find property "prod"
Error: ORA-16501: the Data Guard
broker operation failed
------------------ SOLUTIONS -----------------------
SQL> alter system set log_archive_dest_2=defer
scope=spfile;
alter system set log_archive_dest_2=defer scope=spfile
*
ERROR at line 1:
ORA-32017: failure in updating SPFILE
ORA-16179: incremental changes to
"log_archive_dest_2" not allowed with SPFILE
SQL> alter system set log_archive_dest_2='';
System altered.
SQL> show parameter log_archive_dest_2
NAME TYPE VALUE
------------------------------------ -----------
------------------------------
log_archive_dest_2 string
alter system set log_archive_dest_2='service=stdby LGWR SYNC
AFFIRM db_unique_name=stdby
valid_for=(online_logfile,primary_role)' scope=both;
----- /app/oracle/product/10.2.0/db_1/dbs/ ------
dr1stdby.dat
dr2stdby.dat -------
not available .then rename and recreate configuration file.
RELATED TOPIC:
http://oraclegurukul.blogspot.in/2014/07/warning-you-are-no-longer-connected-to_18.html
http://oraclegurukul.blogspot.in/2014/07/creating-dataguard-broker-configuration.html
http://oraclegurukul.blogspot.in/2014/07/applying-cpupsuopatch-with-dgmgrl-in.html
http://oraclegurukul.blogspot.in/2014/07/converting-physical-standby-to-snapshot.html
http://oraclegurukul.blogspot.in/2014/07/configuration-protection-mode-with.html
http://oraclegurukul.blogspot.in/2014/07/enabling-fast-start-failover-and.html
http://oraclegurukul.blogspot.in/2014/07/performing-manual-failover-operation.html
http://oraclegurukul.blogspot.in/2014/07/reinstating-failed-primary-database.html
No comments:
Post a Comment