Académique Documents
Professionnel Documents
Culture Documents
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 ANTONY
Standby database JOHN
Setup the Local_Listener parameter on both the Primary and Standby databases
SQL> ALTER SYSTEM SET LOCAL_LISTENER='LISTENER_VMRACTEST' 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 = antony)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1 )
(SID_NAME = antony)
)
(SID_DESC =
(SID_NAME= antony)
(GLOBAL_DBNAME = antony_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 = john)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1 )
(SID_NAME = john)
)
(SID_DESC =
(SID_NAME= john)
(GLOBAL_DBNAME = john_DGMGRL)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1 )
)
)
Tnsnames.ora on Node 1, 2 and the observer node
ANTONY =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = antony_DGMGRL)
)
)
JOHN =
(DESCRIPTION =
NAME
TYPE
VALUE
string
/u01/app/oracle/product/10.2.0
/db_1/dbs/dr1antony.dat
dg_broker_config_file2
string
/u01/app/oracle/product/10.2.0
/db_1/dbs/dr2antony.dat
On standby:
SQL> SHOW PARAMETERS DG_BROKER_CONFIG
NAME
TYPE
VALUE
string
/u01/app/oracle/product/10.2.0
/db_1/dbs/dr1john.dat
dg_broker_config_file2
string
/u01/app/oracle/product/10.2.0
/db_1/dbs/dr2john.dat
Configuration
Name:
antony
Enabled:
NO
Protection Mode:
MaxPerformance
Database
Name:
Role:
john
PHYSICAL STANDBY
Enabled:
NO
Properties:
InitialConnectIdentifier
= 'john'
LogXptMode
= 'ARCH'
Dependency
= ''
DelayMins
Binding
MaxFailure
MaxConnections
ReopenSecs
= '0'
= 'OPTIONAL'
= '0'
= '1'
= '300'
NetTimeout
= '180'
LogShipping
= 'ON'
PreferredApplyInstance
= ''
ApplyInstanceTimeout
= '0'
ApplyParallel
= 'AUTO'
StandbyFileManagement
= 'auto'
ArchiveLagTarget
= '0'
LogArchiveMaxProcesses
= '30'
LogArchiveMinSucceedDest
= '1'
DbFileNameConvert
/oracle/oradata/john/'
= '/u01/app/oracle/oradata/antony/, /u01/app
LogFileNameConvert
/oracle/oradata/john/'
= '/u01/app/oracle/oradata/antony/, /u01/app
FastStartFailoverTarget
StatusReport
InconsistentProperties
InconsistentLogXptProps
= ''
= '(monitor)'
= '(monitor)'
= '(monitor)'
SendQEntries
= '(monitor)'
LogXptStatus
= '(monitor)'
RecvQEntries
= '(monitor)'
HostName
= 'rac2'
SidName
LocalListenerAddress
(PORT=1521))'
StandbyArchiveLocation
= 'john'
= '(ADDRESS=(PROTOCOL=TCP)(HOST=rac2.localdo main)
= '/u01/app/oracle/oradata/john/arch/'
AlternateLocation
= ''
LogArchiveTrace
= '0'
LogArchiveFormat
LatestLog
TopWaitEvents
= '%t_%s_%r.arc'
= '(monitor)'
= '(monitor)'
Database
Name:
Role:
antony
PRIMARY
Enabled:
NO
Properties:
InitialConnectIdentifier
= 'antony'
LogXptMode
= 'ASYNC'
Dependency
= ''
DelayMins
Binding
MaxFailure
MaxConnections
= '0'
= 'OPTIONAL'
= '0'
= '1'
ReopenSecs
= '300'
NetTimeout
= '180'
LogShipping
= 'ON'
PreferredApplyInstance
= ''
ApplyInstanceTimeout
= '0'
ApplyParallel
StandbyFileManagement
= 'AUTO'
= 'auto'
ArchiveLagTarget
= '0'
LogArchiveMaxProcesses
= '30'
LogArchiveMinSucceedDest
= '1'
DbFileNameConvert
racle/oradata/antony/'
= '/u01/app/oracle/oradata/john/, /u01/app/o
LogFileNameConvert
FastStartFailoverTarget
StatusReport
= ''
= '(monitor)'
InconsistentProperties
= '(monitor)'
InconsistentLogXptProps
= '(monitor)'
SendQEntries
= '(monitor)'
LogXptStatus
= '(monitor)'
RecvQEntries
= '(monitor)'
HostName
= 'rac1'
SidName
= 'antony'
LocalListenerAddress
(PORT=1521))'
= '(ADDRESS=(PROTOCOL=TCP)(HOST=rac1.localdo main)
StandbyArchiveLocation
= '/u01/app/oracle/oradata/antony/arch/'
AlternateLocation
= ''
LogArchiveTrace
= '0'
LogArchiveFormat
LatestLog
TopWaitEvents
= '%t_%s_%r.arc'
= '(monitor)'
= '(monitor)'
Configuration
Name:
antony
Enabled:
YES
Protection Mode:
MaxPerformance
Database
Name:
Role:
john
PHYSICAL STANDBY
Enabled:
YES
Properties:
InitialConnectIdentifier
= 'john'
LogXptMode
= 'ARCH'
Dependency
= ''
DelayMins
Binding
MaxFailure
= '0'
= 'OPTIONAL'
= '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/antony/, /u01/app/oracle/oradata/john/'
LogFileNameConvert
= '/u01/app/oracle/oradata/antony/, /u01/app/oracle/oradata/john/'
FastStartFailoverTarget
StatusReport
InconsistentProperties
InconsistentLogXptProps
= ''
= '(monitor)'
= '(monitor)'
= '(monitor)'
SendQEntries
= '(monitor)'
LogXptStatus
= '(monitor)'
RecvQEntries
= '(monitor)'
HostName
= 'rac2'
SidName
LocalListenerAddress
(PORT=1521))'
StandbyArchiveLocation
AlternateLocation
= 'john'
= '(ADDRESS=(PROTOCOL=TCP)(HOST=rac2.localdomain)
= '/u01/app/oracle/oradata/john/arch/'
= ''
LogArchiveTrace
= '0'
LogArchiveFormat
= '%t_%s_%r.arc'
LatestLog
= '(monitor)'
TopWaitEvents
= '(monitor)'
Configuration
Name:
antony
Enabled:
YES
Protection Mode:
MaxPerformance
Database
Name:
Role:
john
PHYSICAL STANDBY
Enabled:
YES
Properties:
InitialConnectIdentifier
= 'john'
LogXptMode
= 'ARCH'
Dependency
= ''
DelayMins
Binding
MaxFailure
= '0'
= 'OPTIONAL'
= '0'
MaxConnections
= '1'
ReopenSecs
= '300'
NetTimeout
= '180'
LogShipping
= 'ON'
PreferredApplyInstance
= ''
ApplyInstanceTimeout
= '0'
ApplyParallel
= 'AUTO'
StandbyFileManagement
ArchiveLagTarget
LogArchiveMaxProcesses
= 'auto'
= '0'
= '30'
LogArchiveMinSucceedDest
= '1'
DbFileNameConvert
= '/u01/app/oracle/oradata/antony/, /u01/app/oracle/oradata/john/'
LogFileNameConvert
= '/u01/app/oracle/oradata/antony/, /u01/app/oracle/oradata/john/'
FastStartFailoverTarget
= ''
StatusReport
InconsistentProperties
InconsistentLogXptProps
= '(monitor)'
= '(monitor)'
= '(monitor)'
SendQEntries
= '(monitor)'
LogXptStatus
= '(monitor)'
RecvQEntries
= '(monitor)'
HostName
= 'rac2'
SidName
LocalListenerAddress
(PORT=1521))'
StandbyArchiveLocation
= 'john'
= '(ADDRESS=(PROTOCOL=TCP)(HOST=rac2.localdomain)
= '/u01/app/oracle/oradata/john/arch/'
AlternateLocation
= ''
LogArchiveTrace
= '0'
LogArchiveFormat
LatestLog
TopWaitEvents
= '%t_%s_%r.arc'
= '(monitor)'
= '(monitor)'
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/antony/redo03.log
ONLINE /u01/app/oracle/oradata/antony/redo02.log
ONLINE /u01/app/oracle/oradata/antony/redo01.log
STANDBY /u01/app/oracle/oradata/antony/redoby04.log
STANDBY /u01/app/oracle/oradata/antony/redoby05.log
STANDBY /u01/app/oracle/oradata/antony/redoby06.log
On standby:
TYPE
MEMBER
---------- -------------------------------------------------ONLINE
/u01/app/oracle/oradata/john/redo03.log
ONLINE
/u01/app/oracle/oradata/john/redo02.log
ONLINE
/u01/app/oracle/oradata/john/redo01.log
STANDBY
/u01/app/oracle/oradata/john/redoby04.log
STANDBY
/u01/app/oracle/oradata/john/redoby05.log
STANDBY
/u01/app/oracle/oradata/john/redoby06.log
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 must start instance (primary database) manually
SQL> conn / as sysdba
SQL> startup mount;
Configuration
Name:
antony
Enabled:
YES
Protection Mode:
MaxAvailability
Database
Name:
Role:
john
PHYSICAL STANDBY
Enabled:
YES
Configuration
Name:
antony
Enabled:
YES
Protection Mode:
MaxAvailability
Fast-Start Failover
Threshold: 30 seconds
Observer: rac1
Database
Name:
Role:
Enabled:
antony
PRIMARY
YES
Database
Name:
Role:
john
PHYSICAL STANDBY
Enabled:
YES
DGMGRL>
Database dismounted.
ORACLE instance shut down.
Operation requires shutdown of instance "john" on database "john"
Shutting down instance "john"...
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "antony" on database "antony"
Starting instance "antony"...
ORACLE instance started.
Database mounted.
Operation requires startup of instance "john" on database "john"
Starting instance "john"...
ORACLE instance started.
Database mounted.
Switchover succeeded, new primary is "john"
DGMGRL>
Configuration
Name:
antony
Enabled:
YES
Protection Mode:
MaxAvailability
- Primary database
Fast-Start Failover
Threshold: 30 seconds
Observer: rac1
Database
Name:
Role:
Enabled:
john
PRIMARY
YES
Database
Name:
Role:
Enabled:
antony
PHYSICAL STANDBY
YES
Reference:
Oracle Data Guard Concepts and Administration
10g Release 2 (10.2)
Part Number B14239-04
http://download.oracle.com/docs/cd/B19306_01/server.102/b14230/cli.htm#BGBFEAFG