OGG_GoldenGate日常监控(案例)
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 all Program Status Group Lag at Chkpt Time Since Chkpt MANAGER 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 EXT1 extract ext1 userid ggate@gavinprod, password oracle rmthost odellprod.com, mgrport 7809 rmttrail /opt/oracle/ggate/dirdat/lt ddl include mapped objname sender.*; table sender.*;
3. info process
(1). 作用:查看进程的信息性,包括进程的状态、Checkpoint信息、延时等
(2). 示例
GGSCI (gavinprod.com) 7> info EXT1 EXTRACT EXT1 Last Started 2015-01-28 05:31 Status RUNNING Checkpoint 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 detail EXTRACT EXT1 Last Started 2015-01-28 05:31 Status RUNNING Checkpoint 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:23 Current directory /opt/oracle/ggate Report file /opt/oracle/ggate/dirrpt/EXT1.rpt Parameter file /opt/oracle/ggate/dirprm/ext1.prm Checkpoint file /opt/oracle/ggate/dirchk/EXT1.cpe Process file /opt/oracle/ggate/dirpcs/EXT1.pce Stdout file /opt/oracle/ggate/dirout/EXT1.out Error 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 showch EXTRACT EXT1 Last Started 2015-01-28 05:31 Status RUNNING Checkpoint 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.log Write 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/lt CSN 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.894 Header: Version = 2 Record Source = A Type = 10 # Input Checkpoints = 1 # Output Checkpoints = 1 File Information: Block Size = 2048 Max Blocks = 100 Record Length = 2048 Current Offset = 0 Configuration: Data Source = 3 Transaction Integrity = 1 Task Type = 0 Status: 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 EXT1 Sending 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, total Sending 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.00 Output 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:16 Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved. Starting at 2015-01-28 05:31:33 *********************************************************************** Operating System Version: Linux Version #1 SMP Mon Nov 12 02:14:55 EST 2007, Release 2.6.18-53.el5 Node: gavinprod.com Machine: x86_64 soft limit hard limit Address Space Size : unlimited unlimited Heap Size : unlimited unlimited File Size : unlimited unlimited CPU Time : unlimited unlimited Process id: 5097 Description: *********************************************************************** ** 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 ext1 userid 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 7809 rmttrail /opt/oracle/ggate/dirdat/lt
三、通过ggserr.log日志监控
1. ggserr.log可以查看到的内容
(1). GGSCI命令的历史记录
(2). GoldenGate进程的启动和停止
(3). 已执行的处理
(4). 发生的错误
(5). 信息和警告消息
2. 如何查看 - 通过ggsevt命令
GGSCI (gavinprod.com) 14> view ggsevt 2014-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:03 2014-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.log ggserr.log
四、通过进入report目录文件监控
1. 通过report文件
[ggate@gavinprod dirrpt]$ pwd /opt/oracle/ggate/dirrpt [ggate@gavinprod dirrpt]$ ls -ltr total 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 *dsc REP1.dsc [ggate@gavinprod dirrpt] $ cat REP1.dsc OCI Error ORA-00001: unique constraint (RECEIVER.GAVIN_TEST) violated (status = 1),
SQL <INSERT INTO "RECEIVER"."GAVIN_TEST" ("ID","TEST_DATE","TEST_DESCRIPTION") VALUES (:a0,:a1,:a2)> Operation failed at seqno 388 rba 41327974 Discarding record on action DISCARD on error 1 Problem replicating SENDER.GAVIN_TEST to RECEIVER.GAVIN_TEST Mapping problem with insert record (target format)... * ID = 1 TEST_DATE = 2015-01-24 20:29:12 TEST_DESCRIPTION = GAVIN TEST OGG DISCARD *
五、日常运维监控自动化脚本
GoldenGate可运行监控脚本,用以监控OGG日常状态,和当前以及需要的归档号码
Thanks and Regards
技术交流,技术讨论,欢迎加入
Technology Blog Created By Oracle ERP - 鲍新建