Posts for all those DBAs out there, who are more fond of google than metalink :)

Wednesday, September 30, 2009

DataBroker Demystified


Assumptions:

Primary IP – 10.0.0.1
Standby IP – 10.0.0.2

Changes/Additions to Primary Listener.ora:

SID_LIST_PRIMARY =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME= /mnt/primarydb/10.2.0)
(SID_NAME = PRIMARY)
(GLOBAL_DBNAME = PRIMARY)
)
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /mnt/primarydb/10.2.0)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = PRIMARY)
(GLOBAL_DBNAME = PRIMARY_DGMGRL)
(ORACLE_HOME = /mnt/primarydb/10.2.0)
)
(SID_DESC =
(SID_NAME = PRIMARY)
(GLOBAL_DBNAME = PRIMARY_XPT)
(ORACLE_HOME = /mnt/primarydb/10.2.0)
)
)

Changes/Additions to Standby Listener.ora:

SID_LIST_PRIMARY =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME= /mnt/standbydb/10.2.0)
(SID_NAME = PRIMARY)
)
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /mnt/standbydb/10.2.0)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = PRIMARY)
(GLOBAL_DBNAME = STANDBY_DGMGRL)
(ORACLE_HOME = /mnt/standbydb/10.2.0)
)
(SID_DESC =
(SID_NAME = PRIMARY)
(GLOBAL_DBNAME = STANDBY_XPT)
(ORACLE_HOME = /mnt/standbydb/10.2.0)
)
)

To Enable DG Broker Service:

alter system set dg_broker_start=true;

To Bounce DG Broker Service:

alter system set dg_broker_start=false;
alter system set dg_broker_start=true;

Steps to create DRC(Disaster Recovery Configuration):

At Primary

DGMGRL> CONNECT sys/manager@primary
Connected.
DGMGRL> CREATE CONFIGURATION PRIMARY AS
> PRIMARY DATABASE IS primary
> CONNECT IDENTIFIER IS primary;

Configuration "primary" created with primary database "primary"

DGMGRL> ADD DATABASE standby AS
> CONNECT IDENTIFIER IS standby
> MAINTAINED AS PHYSICAL;

Database "standby" added

DGMGRL> enable configuration;
Enabled.

DGMGRL> show configuration;

Configuration
Name: primary
Enabled: YES
Protection Mode: MaxPerformance
Fast-Start Failover: DISABLED
Databases:
primary - Primary database
standby - Physical standby database

Current status for "primary":
SUCCESS

DGMGRL> show database verbose standby;

Database
Name: standby
Role: PHYSICAL STANDBY
Enabled: YES
Intended State: ONLINE
Instance(s):
PRIMARY

Properties:
InitialConnectIdentifier = 'standby'
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 = '5'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = ''
LogFileNameConvert = ''
FastStartFailoverTarget = ''
StatusReport = '(monitor)'
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
HostName = 'hostname'
SidName = 'PRIMARY'
LocalListenerAddress = '(ADDRESS=(PROTOCOL=tcp)(HOST=10.0.0.2)(PORT=1521))'
StandbyArchiveLocation = '/mnt/standbydb/10.2.0/dbs/arch/'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.dbf'
LatestLog = '(monitor)'
TopWaitEvents = '(monitor)'

Current status for "standby":
SUCCESS

DGMGRL> show database verbose primary;

Database
Name: primary
Role: PRIMARY
Enabled: YES
Intended State: ONLINE
Instance(s):
PRIMARY

Properties:
InitialConnectIdentifier = 'primary'
LogXptMode = 'ARCH'
Dependency = ''
DelayMins = '0'
Binding = 'OPTIONAL'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '180'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'manual'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '5'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = ''
LogFileNameConvert = ''
FastStartFailoverTarget = ''
StatusReport = '(monitor)'
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
HostName = 'hostname'
SidName = 'PRIMARY'
LocalListenerAddress = '(ADDRESS=(PROTOCOL=tcp)(HOST=10.0.0.1)(PORT=1521))'
StandbyArchiveLocation = '/mnt/primarydb/10.2.0/dbs/arch/'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.dbf'
LatestLog = '(monitor)'
TopWaitEvents = '(monitor)'

Current status for "primary":
SUCCESS

In case some database property is not set properly, use the following example to set it:

DGMGRL> edit database "standby" set property 'LocalListenerAddress'='(ADDRESS=(PROTOCOL=tcp)(HOST=10.0.0.2)(PORT=1521))';
Error: ORA-16703: cannot set property while the database is enabled

Failed.
DGMGRL> disable database standby;
Disabled.
DGMGRL> edit database "standby" set property 'LocalListenerAddress'='(ADDRESS=(PROTOCOL=tcp)(HOST=10.0.0.2)(PORT=1521))';
Property "LocalListenerAddress" updated

Important Logs:

1. $ORACLE_HOME/admin//bdump/drc.log
2. $ORACLE_HOME/admin//bdump/alter_.log



No comments:

Post a Comment