博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
OGG_GoldenGate日常监控(案例)
阅读量:6565 次
发布时间:2019-06-24

本文共 10804 字,大约阅读时间需要 36 分钟。

2014-03-11 Created By BaoXinjian

 一、摘要


对GoldenGate实例进行监控,可以公国简单高效的方式GGSCI命令进行监控,并查看返回的信息,判断GoldenGate运行情况是否正常

1. 使用GGSCI命令监控

2. 通过ggserr.log日志监控

3. 通过进入report目录文件监控

4. 日常运维监控自动化脚本

 

 二、使用GGSCI命令监控


1. info all

(1). 作用:查看整体的运行情况

(2). 示例

GGSCI (gavinprod.com) 5> info allProgram     Status      Group       Lag at Chkpt  Time Since ChkptMANAGER     RUNNING                                           EXTRACT     RUNNING     DMP2        842:45:01     00:00:09    EXTRACT     RUNNING     EXT1        841:19:24     00:00:04    EXTRACT     RUNNING     EXT2        529:12:40     00:00:00

2. view params process

(1). 作用:查看进程的参数设置

(2). 示例

GGSCI (gavinprod.com) 6> view params EXT1extract ext1userid ggate@gavinprod, password oraclermthost odellprod.com, mgrport 7809rmttrail /opt/oracle/ggate/dirdat/ltddl include mapped objname sender.*;table sender.*;

3. info process

(1). 作用:查看进程的信息性,包括进程的状态、Checkpoint信息、延时等

(2). 示例

GGSCI (gavinprod.com) 7> info EXT1EXTRACT    EXT1      Last Started 2015-01-28 05:31   Status RUNNINGCheckpoint Lag       529:05:45 (updated 00:00:02 ago)Log Read Checkpoint  Oracle Redo Logs                     2015-01-06 04:27:03  Seqno 24, RBA 18464196                     SCN 0.1440415 (1440415)

4. info process detail

(1). 作用:查看更加详细的信息,包括所使用的trail文件、参数文件、报告文件、警告文件的位置

(2). 示例

GGSCI (gavinprod.com) 8> info EXT1 detailEXTRACT    EXT1      Last Started 2015-01-28 05:31   Status RUNNINGCheckpoint Lag       431:32:57 (updated 00:00:04 ago)Log Read Checkpoint  Oracle Redo Logs                     2015-01-10 06:00:18  Seqno 31, RBA 40079092                     SCN 0.1553661 (1553661)  Target Extract Trails:  Remote Trail Name                                Seqno        RBA     Max MB  /opt/oracle/ggate/dirdat/lt                          1       1105        100  Extract Source                          Begin             End               /opt/oracle/flash_recovery_area/GAVINPROD/archivelog/2015_01_10/o1_mf_1_31_bc2d3p27_.arc  2014-12-24 04:12  2015-01-10 06:00  /opt/oracle/oradata/gavinprod/redo01.log  2014-12-24 00:23  2014-12-24 04:12  Not Available                           * Initialized *   2014-12-24 00:23Current directory    /opt/oracle/ggateReport file          /opt/oracle/ggate/dirrpt/EXT1.rptParameter file       /opt/oracle/ggate/dirprm/ext1.prmCheckpoint file      /opt/oracle/ggate/dirchk/EXT1.cpeProcess file         /opt/oracle/ggate/dirpcs/EXT1.pceStdout file          /opt/oracle/ggate/dirout/EXT1.outError log            /opt/oracle/ggate/ggserr.log

5. info process showch

(1). 作用:查看详细的关于checkpoint的细心你想,用于查询GoldenGate进行处理过的事物记录

Extract进程的Recovery checkpoing,他标识源数据最早的未被处理事物,可以查到该事物的redo log位于哪个日志文件以及该日志文件的序列号,所有序列号比它大得日志文件都需保留

(2). 示例

GGSCI (gavinprod.com) 9> info EXT1 showchEXTRACT    EXT1      Last Started 2015-01-28 05:31   Status RUNNINGCheckpoint Lag       00:00:00 (updated 00:00:06 ago)Log Read Checkpoint  Oracle Redo Logs                     2015-01-28 05:33:32  Seqno 42, RBA 2548736                     SCN 0.1750257 (1750257)Current Checkpoint Detail:Read Checkpoint #1  Oracle Redo Log  Startup Checkpoint (starting position in the data source):    Thread #: 1    Sequence #: 19    RBA: 37158416    Timestamp: 2014-12-24 04:12:21.000000    SCN: 0.1341390 (1341390)    Redo File: /opt/oracle/oradata/gavinprod/redo01.log  Recovery Checkpoint (position of oldest unprocessed transaction in the data source):    Thread #: 1    Sequence #: 42    RBA: 2504208    Timestamp: 2015-01-28 05:33:32.000000    SCN: 0.1750256 (1750256)    Redo File: /opt/oracle/oradata/gavinprod/redo03.log  Current Checkpoint (position of last record read in the data source):    Thread #: 1    Sequence #: 42    RBA: 2548736    Timestamp: 2015-01-28 05:33:32.000000    SCN: 0.1750257 (1750257)    Redo File: /opt/oracle/oradata/gavinprod/redo03.logWrite Checkpoint #1  GGS Log Trail  Current Checkpoint (current write position):    Sequence #: 1    RBA: 1105    Timestamp: 2015-01-28 05:33:46.462178    Extract Trail: /opt/oracle/ggate/dirdat/ltCSN state information:  CRC: A4-7E-18-EE  Latest CSN: 1749736  Latest TXN: 7.29.894  Latest CSN of finished TXNs: 1749736  Completed TXNs: 7.29.894Header:  Version = 2  Record Source = A  Type = 10  # Input Checkpoints = 1  # Output Checkpoints = 1File Information:  Block Size = 2048  Max Blocks = 100  Record Length = 2048  Current Offset = 0Configuration:  Data Source = 3  Transaction Integrity = 1  Task Type = 0Status:  Start Time = 2015-01-28 05:31:39  Last Update Time = 2015-01-28 05:33:46  Stop Status = A  Last Result = 400

6. lag process

(1). 作用:查看详细的延时信息

(2). 示例

GGSCI (gavinprod.com) 10> lag EXT1Sending GETLAG request to EXTRACT EXT1 ...Last record lag: 23 seconds.At EOF, no more records to process.

7. stats

(1). 作用:查看进程处理的记录数

(2). 示例

GGSCI (gavinprod.com) 13> stats EXT1, totalSending STATS request to EXTRACT EXT1 ...Start of Statistics at 2015-01-28 05:37:59.DDL replication statistics (for all trails):*** Total statistics since extract started     ***        Operations                                      2899.00        Mapped operations                                  0.00        Unmapped operations                             2809.00        Other operations                                  90.00        Excluded operations                             2899.00Output to /opt/oracle/ggate/dirdat/lt:Extracting from GGATE.GGS_MARKER to GGATE.GGS_MARKER:*** Total statistics since 2015-01-28 05:31:45 ***        No database operations have been performed.End of Statistics.

8. view report process

(1). 作用:查看对应的报告文件

(2). 示例

GGSCI (gavinprod.com) 11> view report EXT1 ***********************************************************************                 Oracle GoldenGate Capture for Oracle    Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO   Linux, x64, 64bit (optimized), Oracle 11g on Apr 23 2012 08:42:16Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.                    Starting at 2015-01-28 05:31:33***********************************************************************Operating System Version:LinuxVersion #1 SMP Mon Nov 12 02:14:55 EST 2007, Release 2.6.18-53.el5Node: gavinprod.comMachine: x86_64                         soft limit   hard limitAddress Space Size   :    unlimited    unlimitedHeap Size            :    unlimited    unlimitedFile Size            :    unlimited    unlimitedCPU Time             :    unlimited    unlimitedProcess id: 5097Description: *************************************************************************            Running with the following parameters                  *************************************************************************2015-01-28 05:31:33  INFO    OGG-03035  Operating system character set identified as UTF-8. Locale: en_US, LC_ALL:.extract ext1userid ggate@gavinprod, password ******2015-01-28 05:31:35  INFO    OGG-03500  WARNING: NLS_LANG environment variable does not match database character set, or not set. Using database character set value of AL32UTF8.rmthost odellprod.com, mgrport 7809rmttrail /opt/oracle/ggate/dirdat/lt

 

 三、通过ggserr.log日志监控


1. ggserr.log可以查看到的内容

(1). GGSCI命令的历史记录

(2). GoldenGate进程的启动和停止

(3). 已执行的处理

(4). 发生的错误

(5). 信息和警告消息

2. 如何查看 - 通过ggsevt命令

GGSCI (gavinprod.com) 14> view ggsevt2014-09-10 01:26:35  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (ggate): edit params mgr.2014-09-10 01:27:16  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (ggate): edit params mgr.2014-09-10 01:27:27  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (ggate): start manager.2014-09-10 01:27:28  INFO    OGG-00983  Oracle GoldenGate Manager for Oracle, mgr.prm:  Manager started (port 7809).2014-09-10 01:27:40  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (ggate): add extract ext1  tranlog, begin now.2014-09-10 01:29:24  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (ggate): add exttrail2014-09-10 02:24:032014-09-10 02:24:03  INFO    OGG-00983  Oracle GoldenGate Manager for Oracle, mgr.prm:  Manager started (port 7809).2014-09-10 02:24:07  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (ggate): start EXT1.2014-09-10 02:24:07  INFO    OGG-00963  Oracle GoldenGate Manager for Oracle, mgr.prm:  Command received from GGSCI on host gavinprod.com 2014-09-10 02:24:07  INFO    OGG-00975  Oracle GoldenGate Manager for Oracle, mgr.prm:  EXTRACT EXT1 starting.2014-09-10 02:24:08  INFO    OGG-00992  Oracle GoldenGate Capture for Oracle, ext1.prm:  EXTRACT EXT1 starting.2014-09-10 02:24:08  INFO    OGG-03035  Oracle GoldenGate Capture for Oracle, ext1.prm:  Operating system character set identified as UTF-8. 2014-09-10 02:24:19  INFO    OGG-01635  Oracle GoldenGate Capture for Oracle, ext1.prm:  BOUNDED RECOVERY: reset to initial or altered checkpoint.2014-09-10 02:24:19  INFO    OGG-01815  Oracle GoldenGate Capture for Oracle, ext1.prm:  Virtual Memory Facilities for: BR    anon alloc: mmap(MAP_ANON)  anon free: munmap    file alloc: mmap(MAP_SHARED)  file free: munmap    target directories:    /opt/oracle/ggate/BR/EXT1.2014-09-10 02:24:19  INFO    OGG-01815  Oracle GoldenGate Capture for Oracle, ext1.prm:  Virtual Memory Facilities for: COM    anon alloc: mmap(MAP_ANON)  anon free: munmap    file alloc: mmap(MAP_SHARED)  file free: munmap    target directories:    /opt/oracle/ggate/dirtmp.2014-09-10 02:24:20  WARNING OGG-01423  Oracle GoldenGate Capture for Oracle, ext1.prm:  No valid default archive log destination directory found

3. 如可查看 - 通过gserr.log文件

[ggate@gavinprod ggate]$ pwd/opt/oracle/ggate[ggate@gavinprod ggate]$ ls ggserr.logggserr.log

 

 四、通过进入report目录文件监控


1. 通过report文件

[ggate@gavinprod dirrpt]$ pwd/opt/oracle/ggate/dirrpt[ggate@gavinprod dirrpt]$ ls -ltrtotal 260-rw-rw-rw- 1 ggate  oinstall  1182 Sep 10 01:27 MGR3.rpt-rw-rw-rw- 1 ggate  oinstall  1721 Sep 10 02:24 MGR2.rpt-rw-rw-rw- 1 ggate  oinstall  1721 Sep 16 19:06 MGR1.rpt-rw-rw-rw- 1 ggate  oinstall  4242 Sep 16 19:06 EXT19.rpt-rw-rw-rw- 1 oracle oinstall 21926 Dec 23 23:52 EXT18.rpt-rw-rw-rw- 1 oracle oinstall 20432 Dec 23 23:56 EXT17.rpt

2. 通过discard文件

[ggate@gavinprod dirrpt] $ pwd/opt/oracle/ggate/dirrpt[ggate@gavinprod dirrpt] $ ls *dscREP1.dsc[ggate@gavinprod dirrpt] $ cat REP1.dscOCI Error ORA-00001: unique constraint (RECEIVER.GAVIN_TEST) violated (status = 1), SQL 
Operation failed at seqno 388 rba 41327974Discarding record on action DISCARD on error 1Problem replicating SENDER.GAVIN_TEST to RECEIVER.GAVIN_TESTMapping problem with insert record (target format)...*ID = 1TEST_DATE = 2015-01-24 20:29:12TEST_DESCRIPTION = GAVIN TEST OGG DISCARD*

 

 五、日常运维监控自动化脚本


 GoldenGate可运行监控脚本,用以监控OGG日常状态,和当前以及需要的归档号码

 

Thanks and Regards

转载地址:http://ucdjo.baihongyu.com/

你可能感兴趣的文章
C99规范
查看>>
常用Git代码托管服务分享
查看>>
[转] 电子技术·笔记1(9月份)
查看>>
常用的服务
查看>>
BZOJ3799 : 字符串重组
查看>>
用纯JS做俄罗斯方块 - 简要思路介绍(1)
查看>>
blog摘录--测试感触
查看>>
数据持久化的复习
查看>>
【DeepLearning】Exercise:Sparse Autoencoder
查看>>
Util应用程序框架公共操作类(八):Lambda表达式公共操作类(二)
查看>>
android 设置布局横屏竖屏
查看>>
ThreadLocal
查看>>
FormsAuthentication详解
查看>>
Canvas createRadialGradient API
查看>>
什么是 Delta 文件
查看>>
windows下一个,OracleServiceXXX和Oracle 关系实例
查看>>
【LeetCode】241. Different Ways to Add Parentheses
查看>>
风清杨之Oracle的安装与说明
查看>>
thinkphp查询
查看>>
Eclipse使用技巧收集
查看>>