您的位置:首页 > 其它

查看Data Guard同步--使用Broker

2016-03-14 14:38 190 查看
对客户来说,使用命令行的方式对同步状态进行查看不大现实,Oracle提供了很便捷的工具Broker;

配置Broker的好处是可以在目标端数据库打开后自动启动redo apply,无须手动执行recover命令;同时可以在Broker界面对当前日志应用情况及主备两端数据库情况快速了解

配置Broker需要对数据库做出的修改

1. 修改参数dg_broker_start为true

2. 主库(RAC)修改dg_broker_config_file1,dg_broker_config_file2为共享存储‘+DATA’(需指定具体路径)

3. 源端主库添加一组standbyredo log,这样在查看configuration的时候不会有warnings

在主备库查看 dg_broker_start 参数:

该参数默认会被设为FALSE,设为TRUE会随数据库实例而自动启动

该参数只能在Broker未处于运行状态时进行修改

DMON进程是被Broker管理的Oracle后台进程,Broker启动后,DMON进程也就被随之创建

SQL> SHOW PARAMETER DG

NAME TYPE VALUE

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

dg_broker_config_file1 string ….

dg_broker_config_file2 string ….

dg_broker_start boolean TRUE

通过Broker查看DG配置及同步情况

切到oracle用户执行

su – oracle

通过该命令进入OA数据库的Broker管理会话:dgmgrl sys/oracle@oa_std

oa_std 为连接oa数据库目标端的tnsname

[oracle@goldengate dbs]$ dgmgrl sys/oracle@oa_std

DGMGRL for Linux: Version 11.2.0.3.0 - 64bit Production

Copyright (c) 2000, 2009, Oracle. All rightsreserved.

Welcome to DGMGRL, type "help" forinformation.

Connected.

DGMGRL> show configuration(查看当前配置及同步状态)

Configuration - OA

ProtectionMode: MaxPerformance

Databases:

oa - Primary database

oa_std -Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:

SUCCESS

查看详细配置

[oracle@ goldengate dbs ~]$ dgmgrl

DGMGRL for Linux: Version 10.2.0.1.0 - 64bitProduction

Copyright (c) 2000, 2005, Oracle. All rightsreserved.

Welcome to DGMGRL, type "help" forinformation.

DGMGRL> connect sys/oracle@oa_std

Connected.

DGMGRL> show configuration verbose(verbose:详细的)

Configuration

Name: OA

Enabled: YES

ProtectionMode: MaxPerformance

Fast-StartFailover: DISABLED

Databases:

… -Primary database

… -Physical standby database

Fast-Start Failover

Threshold: …seconds

Observer: ..

Current status for "OA":

SUCCESS

DGMGRL> show database verbose oa

Database

Name: ..

Role: PRIMARY

Enabled: YES

IntendedState: ONLINE

Instance(s):

..

Properties:

InitialConnectIdentifier ='..'

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 ='2'

LogArchiveMinSucceedDest ='1'

DbFileNameConvert =''

LogFileNameConvert =''

FastStartFailoverTarget ='standby'

StatusReport ='(monitor)'

InconsistentProperties ='(monitor)'

InconsistentLogXptProps ='(monitor)'

SendQEntries ='(monitor)'

LogXptStatus ='(monitor)'

RecvQEntries = '(monitor)'

HostName ='..'

SidName ='..'

LocalListenerAddress ='..'

StandbyArchiveLocation ='..'

AlternateLocation =''

LogArchiveTrace ='0'

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

LatestLog ='(monitor)'

TopWaitEvents ='(monitor)'

Current status for "…":

SUCCESS

DGMGRL> show database verbose oa_std

Database

Name: standby

Role: PHYSICAL STANDBY

Enabled: YES

IntendedState: ONLINE

Instance(s):

..

Properties:

InitialConnectIdentifier ='standby'

LogXptMode = 'ASYNC'

Dependency =''

DelayMins ='0'

Binding ='OPTIONAL'

MaxFailure ='0'

MaxConnections ='1'

ReopenSecs ='300'

NetTimeout ='30'

LogShipping ='ON'

PreferredApplyInstance =''

ApplyInstanceTimeout ='0'

ApplyParallel ='AUTO'

StandbyFileManagement = 'auto'

ArchiveLagTarget ='0'

LogArchiveMaxProcesses ='2'

LogArchiveMinSucceedDest ='1'

DbFileNameConvert =''

LogFileNameConvert =''

FastStartFailoverTarget = 'primary'

StatusReport ='(monitor)'

InconsistentProperties ='(monitor)'

InconsistentLogXptProps ='(monitor)'

SendQEntries ='(monitor)'

LogXptStatus = '(monitor)'

RecvQEntries ='(monitor)'

HostName ='node2'

SidName ='king'

LocalListenerAddress = '..'

StandbyArchiveLocation = '..'

AlternateLocation =''

LogArchiveTrace ='0'

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

LatestLog ='(monitor)'

TopWaitEvents ='(monitor)'

Current status for "…":

SUCCESS

通过showconfiguration verbose及showdatabase verbose可以看到数据库一些参数的详细配置及Broker配置的具体配置。

日志同步异常的情况下信息对比

取3个同步异常下的信息与配置正常的信息进行对比:

1 DGMGRL> show configuration

Configuration– OA

Protection Mode: MaxPerformance

Databases:

oa - Primary database

Error: ORA-16724: cannot resolve gap for one ormore standby databases

Oa_std - Physical standby database

Fast-StartFailover: DISABLED

ConfigurationStatus:

ERROR

-------这种情况是由于gap引起的,接收到的归档日志断档,需要找到中间序列号中断的日志,恢复到归档目录,会自动重新send及receive,apply

2 DGMGRL> show configuration;

Configuration– oa

Protection Mode: MaxPerformance

Databases:

oa - Primary database

oa_std - Physical standby database

Error: ORA-16766: Redo Apply is stopped

Fast-StartFailover: DISABLED

ConfigurationStatus:

ERROR

-----当前提示redoapply失败,需要对数据库进行排查,可能会由于网络、监听、参数、磁盘空间等多方面导致的日志应用失败。

3 DGMGRL> show configuration;

Configuration– oa

Protection Mode: MaxPerformance

Databases:

oa - Primary database

oa_std - Physical standby database (disabled)

Fast-StartFailover: DISABLED

ConfigurationStatus:

SUCCESS

-----这种情况出现几率较小,一般可能会在刚createconfiguration的时候出现,如果enabledatabase失败,需要对configuration进行重建。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: