查看Data Guard同步--使用Broker

来源:互联网 发布:电商产品数据分析 编辑:程序博客网 时间:2024/05/19 20:22

对客户来说,使用命令行的方式对同步状态进行查看不大现实,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进程也就被随之创建

<span style="font-family:Courier New;">SQL> SHOW PARAMETER DG NAME                           TYPE VALUE------------------------------------ -----------------------------------------dg_broker_config_file1               string  ….dg_broker_config_file2               string  ….dg_broker_start                    boolean      TRUE</span>

 

 

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

 

切到oracle用户执行

#su – oracle

 

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


 

 

<span style="font-family:Courier New;">[oracle@node1 dbs]$ dgmgrl sys/oracle@oa_stdDGMGRL for Linux: Version 11.2.0.3.0 - 64bit ProductionCopyright (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: DISABLEDConfiguration Status:SUCCESS</span>


 

查看详细配置

 

<span style="font-family:Courier New;">[oracle@ node1 dbs ~]$ dgmgrlDGMGRL for Linux: Version 10.2.0.1.0 - 64bitProductionCopyright (c) 2000, 2005, Oracle. All rightsreserved.Welcome to DGMGRL, type "help" forinformation.DGMGRL> connect sys/oracle@oa_stdConnected.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":SUCCESSDGMGRL> show database verbose oaDatabase    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_stdDatabase  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</span>

 

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

 

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

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

 

<span style="font-family:Courier New;">DGMGRL> show configurationConfiguration– OA  Protection Mode: MaxPerformance  Databases:    oa     - Primary database        Error: ORA-16724: cannot resolve gap for one ormore standby databases       oa_std - Physical standby databaseFast-StartFailover: DISABLEDConfigurationStatus: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 stoppedFast-StartFailover: DISABLEDConfigurationStatus:ERROR -----当前提示redoapply失败,需要对数据库进行排查,可能会由于网络、监听、参数、磁盘空间等多方面导致的日志应用失败。3  DGMGRL> show configuration;Configuration– oa  Protection Mode: MaxPerformance  Databases:    oa     - Primary database     oa_std - Physical standby database (disabled)Fast-StartFailover: DISABLEDConfigurationStatus:SUCCESS</span>


 

-----这种情况出现几率较小,一般可能会在刚create configuration的时候出现,如果enable database失败,则可能需要对configuration进行重建。


0 0
原创粉丝点击