对GoldenGate实例进行监控,可以公国简单高效的方式GGSCI命令进行监控,并查看返回的信息,判断GoldenGate运行情况是否正常
1. 使用GGSCI命令监控
2. 通过ggserr.log日志监控
3. 通过进入report目录文件监控
4. 日常运维监控自动化脚本
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