暂无图片
暂无图片
1
暂无图片
暂无图片
暂无图片

030000.使用命令监控 Goldengate

原创 liketoochao 2024-04-28
1033

Oracle GoldenGate是一种基于实时数据集成技术的数据库复制工具,可以实现源(源数据库)到目的地(目标数据库)的实时数据同步。而Oracle GoldenGate监控则是基于Oracle GoldenGate实现的一种监控方法,用于监控Oracle GoldenGate复制进程的运行状态。

OGG监控主要包括以下内容:

  1. 进程监控:对GoldenGate进程进行监控,可以对进程的状态进行实时了解,确保进程始终运行在预期的状态下;
  2. 数据同步监控:对数据同步进行实时监控,可以检测数据同步是否正常,以及出现异常时及时发出告警;
  3. 性能监控:对GoldenGate运行的性能进行监控,可以发现性能瓶颈和优化方案;

如何实现Oracle GoldenGate的监控呢?

  1. 使用OGG自带的监控工具
    Oracle GoldenGate自带了一个名为”ggsci”的命令行工具,可以实现对进程运行状态的监控。
  2. 使用第三方监控工具
    目前市面上也有很多的OGG监控工具,如Splunk、Nagios、Zabbix等。可以从中选择一个适合自己的工具来实现数据的安全监控。下面以Splunk为例进行讲解。
    (1)下载及安装Splunk
    下载地址:https://www.splunk.com/page/download_track

安装及配置如下:

tar xvf /tmp/splunk-7.x.x-xxxxxxx-linux-xxx.tgz -C /opt

cd /opt/
mv splunk splunk7

/opt/splunk7/bin/Splunk start –accept-license
/opt/splunk7/bin/Splunk enable boot-start
/opt/splunk7/bin/Splunk set web-port 8000

(2)安装GoldenGate App
通过下载GoldenGate App,可以快速的将GoldenGate的数据导入Splunk中。下载地址如下:
https://splunkbase.splunk.com/app/2638/#/detls

(3)监控数据
通过GoldenGate App,将GoldenGate的数据导入Splunk中,就可以对数据进行实时监控了。

1.Oracle GoldenGate监控延迟

在Oracle GoldenGate中,可以通过取数点(Extract)和写入点(Replicate)来监控数据同步延迟,同时也可以通过GoldenGate的追踪机制得到关键SQL在GoldenGate整个处理过程中的运行情况,从而更好地对GoldenGate进行监控和优化。

下面是通过GoldenGate取数点和写入点监控GoldenGate同步延迟的示例:

VIEW REPORTINGLAG
------------------
TRANSACTION HISTORY
BEGIN                               END                                INTERVAL                  LAG
------------------- ------------------- ------------------ --------------------------------------------------
2019-12-20 17:40:21 2019-12-20 17:40:31 +000000000 00:00:10.228285 00:00:00.013605
2019-12-20 17:40:31 2019-12-20 17:40:41 +000000000 00:00:10.236374 00:00:00.010089
2019-12-20 17:40:41 2019-12-20 17:40:51 +000000000 00:00:10.236517 00:00:00.000143
2019-12-20 17:40:51 2019-12-20 17:41:01 +000000000 00:00:10.236555 00:00:00.000038
2019-12-20 17:41:01 2019-12-20 17:41:11 +000000000 00:00:10.236560 00:00:00.000005
2019-12-20 17:41:11 2019-12-20 17:41:21 +000000000 00:00:10.236584 00:00:00.000024

上述示例中通过REPORTINGLAG视图查看了GoldenGate同步延迟,其中INTERVAL列表示该记录的时间间隔,LAG表示该记录的同步延迟。

Oracle GoldenGate数据同步实现原理

Oracle GoldenGate的数据同步实现原理主要有以下几个步骤:

  1. 采集数据:GoldenGate的采集过程基于数据库的日志,通过Extract进程读取源数据库的日志,将采集到的变更数据记录保存到源端的Trail文件中。
  2. 数据转换:GoldenGate的转换过程可以进行格式转换、列过滤、行过滤、数据处理等操作,可以根据需要对目标端的数据进行各种转换处理,如数据加密解密、数据脱敏、数据迁移等。
  3. 数据传递:GoldenGate的数据传递过程通过Replicat进程将Trail文件中的变更数据应用到目标端的数据库中,并确保变更数据的原子性和一致性,保证数据同步的可靠性。

下面是通过GoldenGate实现Oracle数据库双向同步的示例:
Oracle GoldenGate实现Oracle数据库双向同步

SOURCE ----> T-REPLICAT ---->TARGET
SOURCE <---- R-REPLICAT <----TARGET

2.使用GGSCI命令监控

info all

进入 GoldenGate安装目录,运行GGSCI,然后查看整体的运行状况

# 源端
GGSCI (source) 3> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
EXTRACT     RUNNING     DPEA2T1     00:00:00      00:00:04    
EXTRACT     STOPPED     EXTA2T1     00:00:00      66:56:41    

GGSCI (source) 4>

# 目标端
GGSCI (target) 3> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
REPLICAT    RUNNING     REPA2T1     00:00:00      00:00:03    

GGSCI (target) 4> 
  1. Group表示进程的名称(MGR进程不显示名字);
  2. Lag表示进程的延时;
  3. Status表示进程的状态,有4种状态:
  • STARTING 表示正在启动过程中。
  • RUNNING 表示进程正常运行。
  • STOPPED 表示进程被正常关闭。
  • ABENDED 表示进程非正常关闭,需要进一步调查原因。

正常情况下,所有进程的状态应该为RUNNING,且Lag应该在一个合理的范围内。

view params <Process Name>

使用 view params <Process Name> 可以查看进程的参数设置,该命令支持通配符 *

源端:

GGSCI (source) 4> view param mgr

PORT 7809

GGSCI (source) 5> view param exta2t1

EXTRACT exta2t1
setenv (NLS_LANG = AMERICAN_AMERICA.AL32UTF8)
setenv (ORACLE_SID = big)
USERID goldengate, PASSWORD admin123
rmthost 192.168.10.33, mgrport 7809
rmttrail /u01/app/oracle/middleware/goldengate/dirdat/ra
--dynamicresolution
--GETUPDATEBEFORES 
--NOCOMPRESSDELETES 
table admin.t1;

GGSCI (source) 6> 
GGSCI (source) 6> view param dpea2t1

extract dpea2t1
setenv ( NLS_LANG = AMERICAN_AMERICA.ZHS16GBK )
passthru
--REPORT AT 01:59
--reportrollover at 02:00
rmthost 192.168.10.33,mgrport 7809, compress
rmttrail /u01/app/oracle/middleware/goldengate/dirdat/la
--dynamicresolution
TABLE admiin.t1;

GGSCI (source) 7>

目标端:

GGSCI (target) 4> view param mgr

PORT 7809

GGSCI (target) 5> view param repa2t1

replicat repa2t1
setenv (NLS_LANG = AMERICAN_AMERICA.ZHS16GBK) 
setenv (ORACLE_SID = fish)
userid goldengate@fish, password admin123
--REPORT AT 01:59 
--reportrollover at 02:00 
reperror default, abend 
discardfile D:\app\Administrator\middleware\goldengate\dirrpt\repa.dsc,append, megabytes 10 
assumetargetdefs 
--allownoopupdates 
--INSERTALLRECORDS 
map admin.t1, target admin.t1;

GGSCI (target) 6> 

info <Process Name>

使用 info <Process Name> 命令可以查看进程信息,可以查看到的信息包括进程状态、checkpoint信息、延时等

GGSCI (source) 7> info exta2t1

EXTRACT    EXTA2T1   Initialized   2023-12-08 16:11   Status STOPPED
Checkpoint Lag       00:00:00 (updated 66:59:06 ago)
Log Read Checkpoint  Oracle Integrated Redo Logs
                     2023-12-08 16:25:08
                     SCN 0.1023118 (1023118)

GGSCI (source) 8> info dpea2t1

EXTRACT    DPEA2T1   Last Started 2023-12-08 16:12   Status RUNNING
Checkpoint Lag       00:00:00 (updated 00:00:04 ago)
Process ID           10527
Log Read Checkpoint  File /u01/app/oracle/middleware/goldengate/dirdat/la000000000
                     First Record  RBA 0

GGSCI (source) 9> 

info <Process Name> detail

可以使用info <Process Name> detail 命令查看更详细的信息,包括所使用的trail文件、参数文件、报告文件、警告日志的位置等

GGSCI (source) 9> info exta2t1 detail

EXTRACT    EXTA2T1   Initialized   2023-12-08 16:11   Status STOPPED
Checkpoint Lag       00:00:00 (updated 67:00:20 ago)
Log Read Checkpoint  Oracle Integrated Redo Logs
                     2023-12-08 16:25:08
                     SCN 0.1023118 (1023118)

  Target Extract Trails:

  Trail Name                                       Seqno        RBA     Max MB Trail Type

  /u01/app/oracle/middleware/goldengate/dirdat/la          0          0         20 EXTTRAIL  
  /u01/app/oracle/middleware/goldengate/dirdat/ra          2       1507        500 RMTTRAIL  


Integrated Extract outbound server first scn: Unavailable.Need DBLOGIN.

Integrated Extract outbound server filtering start scn: Unavailable.Need DBLOGIN.

  Extract Source                          Begin             End             

  /u01/app/oracle/oradata/big/redo03.log  * Initialized *   2023-12-08 16:25
  /u01/app/oracle/oradata/big/redo03.log  * Initialized *   2023-12-08 16:25
  /u01/app/oracle/oradata/big/redo03.log  * Initialized *   2023-12-08 16:25
  /u01/app/oracle/oradata/big/redo03.log  2023-12-08 16:03  2023-12-08 16:25
  /u01/app/oracle/oradata/big/redo03.log  2023-12-07 18:29  2023-12-08 16:04
  /u01/app/oracle/oradata/big/redo03.log  2023-12-07 18:29  2023-12-08 16:04
  /u01/app/oracle/oradata/big/redo01.log  * Initialized *   2023-12-07 18:29
  /u01/app/oracle/oradata/big/redo01.log  * Initialized *   2023-12-07 18:29
  /u01/app/oracle/oradata/big/redo01.log  2023-12-07 18:29  2023-12-07 18:29
  /u01/app/oracle/oradata/big/redo01.log  2023-12-07 18:29  2023-12-07 18:29
  /u01/app/oracle/oradata/big/redo01.log  2023-12-07 18:29  2023-12-07 18:29
  /u01/app/oracle/oradata/big/redo01.log  2023-12-07 18:29  2023-12-07 18:29
  Not Available                           * Initialized *   2023-12-07 18:29
  Not Available                           * Initialized *   2023-12-07 18:29
  Not Available                           * Initialized *   2023-12-07 18:29

Current directory    /u01/app/oracle/middleware/goldengate

Report file          /u01/app/oracle/middleware/goldengate/dirrpt/EXTA2T1.rpt
Parameter file       /u01/app/oracle/middleware/goldengate/dirprm/exta2t1.prm
Checkpoint file      /u01/app/oracle/middleware/goldengate/dirchk/EXTA2T1.cpe
Process file         /u01/app/oracle/middleware/goldengate/dirpcs/EXTA2T1.pce
Error log            /u01/app/oracle/middleware/goldengate/ggserr.log

GGSCI (source) 10> info dpea2t1 detail

EXTRACT    DPEA2T1   Last Started 2023-12-08 16:12   Status RUNNING
Checkpoint Lag       00:00:00 (updated 00:00:09 ago)
Process ID           10527
Log Read Checkpoint  File /u01/app/oracle/middleware/goldengate/dirdat/la000000000
                     First Record  RBA 0

  Target Extract Trails:

  Trail Name                                       Seqno        RBA     Max MB Trail Type

  /u01/app/oracle/middleware/goldengate/dirdat/ra          0          0        500 RMTTRAIL  
  /u01/app/oracle/middleware/goldengate/dirdat/la          0          0        500 RMTTRAIL  

  Extract Source                          Begin             End             

  /u01/app/oracle/middleware/goldengate/dirdat/la000000000  * Initialized *   First Record    
  /u01/app/oracle/middleware/goldengate/dirdat/la000000000  * Initialized *   First Record    
  /u01/app/oracle/middleware/goldengate/dirdat/la000000000  * Initialized *   First Record    
  /u01/app/oracle/middleware/goldengate/dirdat/la000000000  * Initialized *   First Record    
  /u01/app/oracle/middleware/goldengate/dirdat/la000000000  * Initialized *   First Record    
  /u01/app/oracle/middleware/goldengate/dirdat/la000000000  * Initialized *   First Record   

Current directory    /u01/app/oracle/middleware/goldengate

Report file          /u01/app/oracle/middleware/goldengate/dirrpt/DPEA2T1.rpt
Parameter file       /u01/app/oracle/middleware/goldengate/dirprm/dpea2t1.prm
Checkpoint file      /u01/app/oracle/middleware/goldengate/dirchk/DPEA2T1.cpe
Process file         /u01/app/oracle/middleware/goldengate/dirpcs/DPEA2T1.pce
Error log            /u01/app/oracle/middleware/goldengate/ggserr.log

GGSCI (source) 11> 

info <Process Name> showch

使用info <Process Name> showch 命令可以查看到详细的关于checkpoint的信息,用于查看GoldenGate进程处理过的事务记录

GGSCI (source) 13> info exta2t1 showch

EXTRACT    EXTA2T1   Initialized   2023-12-08 16:11   Status STOPPED
Checkpoint Lag       00:00:00 (updated 67:02:21 ago)
Log Read Checkpoint  Oracle Integrated Redo Logs
                     2023-12-08 16:25:08
                     SCN 0.1023118 (1023118)


Current Checkpoint Detail:

Read Checkpoint #1

  Oracle Integrated Redo Log

  Startup Checkpoint (starting position in the data source):
    Timestamp: 2023-12-08 16:03:02.000000
    SCN: 0.1007885 (1007885)

  Recovery Checkpoint (position of oldest unprocessed transaction in the data source):
    Timestamp: 2023-12-08 16:24:56.000000
    SCN: 0.1023112 (1023112)

  Current Checkpoint (position of last record read in the data source):
    Timestamp: 2023-12-08 16:25:08.000000
    SCN: 0.1023118 (1023118)

Write Checkpoint #1

  GGS Log Trail

  Current Checkpoint (current write position):
    Sequence #: 0
    RBA: 0
    Timestamp: 2023-12-07 18:31:06.787730
    Extract Trail: /u01/app/oracle/middleware/goldengate/dirdat/la
    Seqno Length: 6
    Flip Seqno Length: Yes
    Trail Type: EXTTRAIL

Write Checkpoint #2

  GGS Log Trail

  Current Checkpoint (current write position):
    Sequence #: 2
    RBA: 1507
    Timestamp: 2023-12-08 16:25:11.856446
    Extract Trail: /u01/app/oracle/middleware/goldengate/dirdat/ra
    Seqno Length: 9
    Flip Seqno Length: No
    Trail Type: RMTTRAIL

Header:
  Version = 2
  Record Source = U
  Type = 13
  # Input Checkpoints = 1
  # Output Checkpoints = 2

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 = 2023-12-08 16:11:10
  Last Update Time = 2023-12-08 16:25:11
  Stop Status = G
  Last Result = 400

GGSCI (source) 14> 

其中比较重要的是Extract进程的recovery checkpoint,它表示源数据中最早的未被处理的事务;通过recovery checkpoint可以查看到该事务的redo log位于哪个日志文件以及该日志文件的序列号。

所有序列号比它大的日志文件,均需要保留。

lag <Process Name>

lag <Process Name> 可以查看详细的延时信息

GGSCI (target) 7> lag repa2t1

2023-12-11 11:29:34  INFO    OGG-14054  Lag from heartbeat table requires DBLOGIN.

Sending GETLAG request to Replicat group REPA2T1 ...
Last record lag 4 seconds.
At EOF, no more records to process

GGSCI (target) 8> 

stats

stats 可以查看进程处理的记录数:
该报告会详细地列出处理的类型和记录数,例如:

stats <进程名称>,<时间频度>,table \<owner name>.\<table name>

列出自进程启动以来处理的所有记录数

GGSCI (target) 8> stats repa2t1,total

Sending STATS request to Replicat group REPA2T1 ...

Start of statistics at 2023-12-11 11:31:05.

Replicating from ADMIN.T1 to ADMIN.T1:

*** Total statistics since 2023-12-07 18:41:45 ***
    Total inserts                              6.00
    Total updates                              0.00
    Total deletes                              0.00
    Total upserts                              0.00
    Total discards                             0.00
    Total operations                           6.00

End of statistics.

GGSCI (target) 9> 

列出当天以来处理的有关 admin.t1 表的所有记录数。

GGSCI (target) 9> stats repa2t1,daily, table admin.t1

Sending STATS request to Replicat group REPA2T1 ...

Start of statistics at 2023-12-11 11:34:02.

Replicating from ADMIN.T1 to ADMIN.T1:

*** Daily statistics since 2023-12-11 00:00:00 ***

	No database operations have been performed.

End of statistics.

STATUS
STATS 指静态的信息,而 STATUS 是运行时的信息。

GGSCI (target) 10> status repa2t1
REPLICAT REPA2T1: RUNNING

GGSCI (target) 11> 

view report <Process Name>

view report <Process Name> 可以查看运行报告

GGSCI (source) 25> view report exta2t1


***********************************************************************
                 Oracle GoldenGate Capture for Oracle
    Version 12.3.0.1.4 OGGCORE_12.3.0.1.0_PLATFORMS_180415.0359_FBO
   Linux, x64, 64bit (optimized), Oracle 11g on Apr 15 2018 21:22:44
 
Copyright (C) 1995, 2018, Oracle and/or its affiliates. All rights reserved.


                    Starting at 2023-12-11 11:28:58
***********************************************************************

Operating System Version:
Linux
Version #2 SMP Thu Jun 14 18:55:52 PDT 2018, Release 4.1.12-124.16.4.el6uek.x86_64
Node: source
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: 18672

Description: 

***********************************************************************
**            Running with the following parameters                  **
***********************************************************************

2023-12-11 11:28:58  INFO    OGG-03059  Operating system character set identified as UTF-8.

2023-12-11 11:28:58  INFO    OGG-02695  ANSI SQL parameter syntax is used for parameter parsing.

2023-12-11 11:28:58  INFO    OGG-02095  Successfully set environment variable NLS_LANG=AMERICAN_AMERICA.AL32UTF8.

2023-12-11 11:28:58  INFO    OGG-02095  Successfully set environment variable ORACLE_SID=big.

2023-12-11 11:28:58  INFO    OGG-01360  EXTRACT is running in Integrated mode.

2023-12-11 11:28:58  INFO    OGG-01889  Flush size (max message size) is set to 27,985.
EXTRACT exta2t1
setenv (NLS_LANG = AMERICAN_AMERICA.AL32UTF8)
setenv (ORACLE_SID = big)
USERID goldengate, PASSWORD ***

2023-12-11 11:28:58  INFO    OGG-03522  Setting session time zone to source database time zone 'GMT'.
rmthost 192.168.10.33, mgrport 7809
rmttrail /u01/app/oracle/middleware/goldengate/dirdat/ra
table admin.t1;

2023-12-11 11:28:58  INFO    OGG-01635  BOUNDED RECOVERY: reset to initial or altered checkpoint.

2023-12-11 11:28:58  INFO    OGG-01815  Virtual Memory Facilities for: BR
    anon alloc: mmap(MAP_ANON)  anon free: munmap
    file alloc: mmap(MAP_SHARED)  file free: munmap
    target directories:
    /u01/app/oracle/middleware/goldengate/BR/EXTA2T1.

Bounded Recovery Parameter:
BRINTERVAL = 4HOURS
BRDIR      = /u01/app/oracle/middleware/goldengate/

2023-12-11 11:28:58  INFO    OGG-01851  filecaching started: thread ID: 140054108301056.

2023-12-11 11:28:58  INFO    OGG-01815  Virtual Memory Facilities for: COM
    anon alloc: mmap(MAP_ANON)  anon free: munmap
    file alloc: mmap(MAP_SHARED)  file free: munmap
    target directories:
    /u01/app/oracle/middleware/goldengate/dirtmp.

Database Version:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE	11.2.0.4.0	Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production

Database Language and Character Set:
NLS_LANGUAGE     = "AMERICAN" 
NLS_TERRITORY    = "AMERICA" 
NLS_CHARACTERSET = "WE8MSWIN1252" 

2023-12-11 11:28:59  INFO    OGG-03522  Setting session time zone to source database time zone 'GMT'.

2023-12-11 11:28:59  INFO    OGG-06604  Database BIG CPU info: CPU Count 4, CPU Core Count 4, CPU Socket Count 2.

2023-12-11 11:29:00  WARNING OGG-02045  Database does not have streams_pool_size initialization parameter configured.

2023-12-11 11:29:00  INFO    OGG-02248  Logmining server DDL filtering enabled.

2023-12-11 11:29:01  INFO    OGG-02068  Integrated capture successfully attached to logmining server OGG$CAP_EXTA2T1 using OGGCapture API.

2023-12-11 11:29:01  INFO    OGG-02089  Source redo compatibility version is: 11.2.0.4.0.

2023-12-11 11:29:01  INFO    OGG-02086  Integrated Dictionary will be used.

2023-12-11 11:29:01  WARNING OGG-02901  Replication of UDT and ANYDATA from redo logs is not supported with the Oracle compatible parameter setting. Using fetch instead.

Source Context :
  SourceModule            : [ggdb.ora.ddl]
  SourceID                : [/scratch/aime/adestore/views/aime_adc00jza/oggcore/OpenSys/src/gglib/ggdbora/ddlora.c]
  SourceMethod            : [metadata_from_logminer]
  SourceLine              : [983]
  ThreadBacktrace         : [15] elements
                          : [/u01/app/oracle/middleware/goldengate/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**))]
                          : [/u01/app/oracle/±]
                          : [/u01/app/oracle/middleware/goldengate/libgglog.so(_MSG_(CSourceContext*, int, CMessageFactory::MessageDisposition))]
                          : [/u01/app/oracle/middleware/goldengate/extract()]
                          : [/u01/app/oracle/middleware/goldengate/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**)+0xb5) [0x83e875]]
                          : [/u01/app/oracle/middleware/goldengate/extract(ggs::er::OraTranLogDataSource::setup())]
                          : [/u01/app/oracle/middleware/goldengate/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**))]
                          : [/u01/app/oracle/middleware/goldengate/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**))]
                          : [/u01/app/oracle/middleware/goldengate/extract()]
                          : [/u01/app/oracle/middleware/goldengate/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**))]
                          : [  : [/u01/app/oracle/middleware/ware/ngate/extract(ggs::gglib::Mib::Mhreading::MainThread::Run(iRun(iRun(iR)]
]
                          : [/u01/app/oracle/middleware/goldengate/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**))]
                          : [/u01/app/oracle/middleware/goldengate/extract(main)]
                          : [/u01/app/oracle/middleware/goldengate/extract()]
                          : [/u01/app/oracle/middleware/goldengate/extract()]

2023-12-11 11:29:01  ERROR   OGG-02912  Patch 17030189 is required on your Oracle mining database for trail format RELEASE 12.2 or later.

2023-12-11 11:29:01  ERROR   OGG-01668  PROCESS ABENDING.

3.ggserr.log日志监控

Error log 存放在GG 的安装目录下面:

[oracle@source goldengate]$ pwd
/u01/app/oracle/middleware/goldengate
[oracle@source goldengate]$ ls -la ggserr.log 
-rw-r----- 1 oracle oinstall 148998 Dec 11 14:13 ggserr.log
[oracle@source goldengate]$ 

使用GG error log可以查看一下信息:

  1. a history of GGSCI commands
  2. Oracle GoldenGate processesthat started and stopped
  3. processing that was performed
  4. errors that occurred
  5. informational and warningmessages

Because the error log shows events as they occurred in sequence, it is a good tool for detectingthe cause (or causes) of an error. For example, you might discover that:

  1. someone stopped a process
  2. a process failed to make aTCP/IP or database connection
  3. a process could not open a file

To view the error log

Use any of the following:

  1. Standard shell command to viewthe ggserr.log file within the root Oracle GoldenGate
  2. directory
  3. Oracle GoldenGate Director
  4. VIEW GGSEVT command in GGSCI
GGSCI (source) 27> view ggsevt
2023-12-07T12:45:47.737+0800  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle, oby.oby:  GGSCI command (oracle): CREATE SUBDIRS.
2023-12-07T12:45:48.809+0800  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle, oby.oby:  GGSCI command (oracle): START MGR.
2023-12-07T12:45:48.931+0800  WARNING OGG-01877  Oracle GoldenGate Manager for Oracle, mgr.prm:  Missing explicit accessrule for server collector.
2023-12-07T12:45:48.933+0800  INFO    OGG-00983  Oracle GoldenGate Manager for Oracle, mgr.prm:  Manager started (port 7809).
2023-12-07T12:45:49.811+0800  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle, oby.oby:  GGSCI command (oracle): CREATE DATASTORE.
2023-12-07T12:51:47.821+0800  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): create subdirs.
2023-12-07T12:52:28.202+0800  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): edit param mgr.
2023-12-07T12:53:12.991+0800  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): info mgr.
2023-12-07T12:53:22.104+0800  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): stop mgr.
2023-12-07T12:53:24.683+0800  INFO    OGG-00963  Oracle GoldenGate Manager for Oracle, mgr.prm:  Command received from GGSCI on host [192.168.10.32]:39318 (STOP).
2023-12-07T12:53:24.683+0800  WARNING OGG-00938  Oracle GoldenGate Manager for Oracle, mgr.prm:  Manager is stopping at user request.
......

在日志文件中可以查看到的内容如下。

  1. GGSCI命令的历史记录
  2. GoldenGate进程的启动与停止
  3. 已执行的处理
  4. 发生的错误
  5. 信息和警告消息

To filter the error log

The error logcan become very large, but you can filter it based on a keyword. For example, thisfilter show only errors:

$ moreggserr.log | grep ERROR

FQ 1:

目标端replicat进程启动异常

GGSCI (aix211) 16> info all
Program     Status      Group       Lag at Chkpt  Time Since Chkpt
MANAGER     RUNNING
REPLICAT    ABENDED     RORA_1      00:00:00      43:38:02

查看日志:

2014-09-25 16:03:42  INFO    OGG-01815  Oracle GoldenGate Delivery for Oracle, rora_1.prm:  Virtual Memory Facilities for: COM
    anon alloc: mmap(MAP_ANON)  anon free: munmap
    file alloc: mmap(MAP_SHARED)  file free: munmap
    target directories:
    /ogg/dirtmp.
2014-09-25 16:03:42  ERROR   OGG-00446  Oracle GoldenGate Delivery for Oracle, rora_1.prm:  Checkpoint table ogg.checkpoint does not exist.  Pleas
e create the table or recreate the RORA_1 group using the correct table.
2014-09-25 16:03:42  ERROR   OGG-01668  Oracle GoldenGate Delivery for Oracle, rora_1.prm:  PROCESS ABENDING.

无法找到checkpint table !

GGSCI (aix211) 2> delete checkpointtable

GGSCI (aix211) 3> edit param ./GLOBALS
CHECKPOINTTABLE ogg.checkpoint

GGSCI (aix211) 3>exit

必须退出ggsci,checkpoint table 才会生效

[oracle@rh6 ogg]$ ./ggsci
GGSCI (aix211) 1> dblogin userid ogg,password ogg
Successfully logged into database.
  
GGSCI (aix211) 2> add checkpointtable
No checkpoint table specified, using GLOBALS specification (ogg.checkpoint)...
Successfully created checkpoint table ogg.checkpoint.

重新启动replicat进程:

GGSCI (aix211) 16> info all
Program     Status      Group       Lag at Chkpt  Time Since Chkpt
MANAGER     RUNNING
REPLICAT    ABENDED     RORA_1      00:00:00      43:38:02

启动失败,查看日志!

[oracle@aix211 ogg]$tail ggserr.log 
2014-09-25 16:11:47  INFO    OGG-00975  Oracle GoldenGate Manager for Oracle, mgr.prm:  REPLICAT RORA_1 starting.
2014-09-25 16:11:48  INFO    OGG-00995  Oracle GoldenGate Delivery for Oracle, rora_1.prm:  REPLICAT RORA_1 starting.
2014-09-25 16:11:48  INFO    OGG-03035  Oracle GoldenGate Delivery for Oracle, rora_1.prm:  Operating system character set identified as ISO-8859-1. Locale: en_US_POSIX, LC_ALL:.
2014-09-25 16:11:48  INFO    OGG-01815  Oracle GoldenGate Delivery for Oracle, rora_1.prm:  Virtual Memory Facilities for: COM
    anon alloc: mmap(MAP_ANON)  anon free: munmap
    file alloc: mmap(MAP_SHARED)  file free: munmap
    target directories:
    /ogg/dirtmp.
2014-09-25 16:11:48  ERROR   OGG-00446  Oracle GoldenGate Delivery for Oracle, rora_1.prm:  No data selecting position from checkpoint table ogg.checkpoint for group 'RORA_1', key 1056363220 (0x3ef6d2d4), SQL <SELECT a.current_dir, a.seqno, a.rba, a.audit_ts, a.log_csn, a.log_xid, a.log_cmplt_csn, a.log_cmplt_xids, b.log_cmplt_xids FROM ogg.checkpoint a LEFT JOIN ogg.checkpoint_lox b ON a.group_name = b.group_name AND a.group_key = b.group_key AND a.log_cmplt_csn = b.log_cmplt_csn WHERE a.group_name = 'RORA_1' AND a.group_key  = 1056363220>.
2014-09-25 16:11:48  ERROR   OGG-01668  Oracle GoldenGate Delivery for Oracle, rora_1.prm:  PROCESS ABENDING.

checkpointtable 错误 !

处理方法:

删除replicat进程:

GGSCI (aix211) 7> delete replicat rora_1
Deleted REPLICAT RORA_1.

添加新的replicat进程:

GGSCI (aix211) 8> add replicat rora_1,exttrail ./dirdat/pa,checkpointtable ogg.checkpoint
REPLICAT added.

GGSCI (aix211) 9> edit param rora_1
"/ogg/dirprm/rora_1.prm" 7 lines, 198 characters 
REPLICAT RORA_1
SETENV (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
USERID ogg,PASSWORD ogg
HANDLECOLLISIONS
ASSUMETARGETDEFS
DISCARDFILE ./dirrpt/RORA_aa.DSC,PURGE
MAP scott.oem_ogg, TARGET scott.emp_ogg;
~

重新启动replicat进程

GGSCI (aix211) 10> start replicat rora_1
Sending START request to MANAGER ...
REPLICAT RORA_1 starting
GGSCI (aix211) 11> info all
Program     Status      Group       Lag at Chkpt  Time Since Chkpt
MANAGER     RUNNING                                             
REPLICAT    RUNNING     RORA_1      00:00:00      00:00:03

启动成功!

FQ 2:

源端初始化进程(eini_1)和目标端初始化进程(rini_1)

目标端初始化进程rini_1:

GGSCI (aix211) 13> info rini_1
REPLICAT   RINI_1    Initialized   2014-09-23 15:40   Status STOPPED
Checkpoint Lag       00:00:00 (updated 48:46:37 ago)
Log Read Checkpoint  Not Available
Task                 SPECIALRUN

源端初始化进程eini_1:

GGSCI (aix212) 21> info eini_1
EXTRACT    EINI_1    Last Started 2014-09-25 16:09   Status STOPPED
Checkpoint Lag       Not Available
Log Read Checkpoint  Table SCOTT.EMP_OGG
                     2014-09-25 16:09:35  Record 14
Task                 SOURCEISTABLE

启动源端初始化进程:

GGSCI (aix212) 22> start eini_1
Sending START request to MANAGER ...
EXTRACT EINI_1 starting

GGSCI (aix212) 23> info eini_1
EXTRACT    EINI_1    Last Started 2014-09-25 16:09   Status RUNNING
Checkpoint Lag       Not Available
Log Read Checkpoint  Table SCOTT.EMP_OGG
                     2014-09-25 16:09:35  Record 14
Task                 SOURCEISTAB

进程启动后,目标端初始化进程自动启动!

GGSCI (aix211) 14> info rini_1
REPLICAT   RINI_1    Initialized   2014-09-23 15:40   Status RUNNING
Checkpoint Lag       00:00:00 (updated 48:47:03 ago)
Log Read Checkpoint  Not Available

4.Monitoring an Extract recovery

If Extractabends when a long-running transaction is open, it can seem to take a long timeto recover when it is started again. To recover its processing state, Extractmust search back through the online and archived logs (if necessary) to findthe first log record for that long-running transaction. The farther back intime that the transaction started, the longer the recovery takes, in general,and Extract can appear to be stalled.

如果在打开长时间运行的事务时Extractabends,则在再次启动时似乎需要很长时间才能恢复。若要恢复其处理状态,Extractor必须在联机日志和存档日志中进行搜索(如有必要),以找到该长时间运行的事务的第一条日志记录。一般来说,事务开始的时间越早,恢复所需的时间就越长,并且Extract可能看起来很慢
当一个长事务在运行时,此时Extract 进程异常中断,那么在下次启动时就会花很长的时间来进行recover操作。
在恢复过程中,Extract 进程需要搜索online和archived logs 信息来查找长事务的第一条log 记录。从而确定事务的开始时间,然后进行恢复,在恢复过程中,Extract 的操作是比较慢的。

To confirm thatExtract is recovering properly, use the SEND EXTRACT command with the STATUS option.One of the following status notations appears, and you can follow the progressas Extract changes its log read position over the course of the recovery.

要确认EXTRACT恢复正常,请使用带有STATUS选项的SEND EXTRACT命令。出现以下状态符号之一,您可以按照Extract在恢复过程中更改其日志读取位置的过程进行操作。

为了确认Extract 的recover 状态,可以使用如下命令查看:

GGSCI>Send extract_name status
或者:
GGSCI>Send  extract extract_name status

该命令中的状态有如下三种:

  1. In recovery[1] – Extract isrecovering to its checkpoint in the transaction log.
  2. In recovery[2] – Extract isrecovering from its checkpoint to the end of the trail.
  3. Recovery complete – Therecovery is finished, and normal processing will resume.

5.Monitoring lag

Lag statisticsshow you how well the Oracle GoldenGate processes are keeping pace with theamount of data that is being generated by the business applications. With this information,you can diagnose suspected problems and tune the performance of the Oracle GoldenGateprocesses to minimize the latency between the source and target databases.

要确认EXTRACT恢复正常,请使用带有STATUS选项的SEND EXTRACT命令。出现以下状态符号之一,您可以按照Extract在恢复过程中更改其日志读取位置的过程进行操作。
Lag 的静态信息可以显示GG 进程处理的data 数量。

For Extract, lagis the difference, in seconds, between the time that a record was processed byExtract (based on the system clock) and the timestamp of that record in thedata source.

对于Extract,lag是Extract处理记录的时间(基于系统时钟)与数据源中该记录的时间戳之间的差值(以秒为单位)。
For Replicat,lag is the difference, in seconds, between the time that the last record was processedby Replicat (based on the system clock) and the timestamp of the record in the trail.
同样对于Replicat,lag 表示的是Replicat 进程处理的最后一条记录与这条记录在trail 文件中timestamp 的时间差。单位是秒。

查看 lag statistics 的信息可以使用如下两种语法:

LAG {EXTRACT | REPLICAT | ER}{<group | wildcard>}

SEND {EXTRACT | REPLICAT}{<group | wildcard>}, GETLAG

SEND 命令返回的log statistics 是 checkpointed 中记录的最后一条记录,而不是process 当前处理的记录,所以SEND 命令显示的信息没有LAG 或 INFO 命令显示的准确。

GGSCI (target) 12> lag er *

2023-12-11 13:59:40  INFO    OGG-14054  Lag from heartbeat table requires DBLOGIN.

Sending GETLAG request to Replicat group REPA2T1 ...
Last record lag 4 seconds.
At EOF, no more records to process


GGSCI (target) 13> 
GGSCI (target) 13> send repa2t1 getlag

Sending GETLAG request to Replicat group REPA2T1 ...
Last record lag 4 seconds.
At EOF, no more records to process


GGSCI (target) 14> 

有三种方式来控制 Lag 的报警设置:

  1. Use the LAGREPORTMINUTES or LAGREPORTHOURSparameter to specify the interval at which Manager checks for Extract andReplicat lag.

使用LAGREPORTMINUTES或LAGREPortHOURSparParameter指定Manager检查Extract和Replicat滞后的间隔。
这2个参数设置Manager 检查Extract 和ReplicatLag的时间间隔。

  1. Use the LAGCRITICALSECONDS, LAGCRITICALMINUTES,or LAGCRITICALHOURS parameter to specify a lag threshold that is consideredcritical, and to force a warning message to the error log when the threshold isreached. This parameter affects Extract and Replicat processes on the localsystem.

使用LAGCRITICALSECONDS、LAGCRICICALMINUTES或LAGCRITCALHOURS参数指定被认为是关键的延迟阈值,并在达到阈值时将警告消息强制发送到错误日志。此参数影响本地系统上的Extract和Replicat进程。
这3个参数控制Lag 的界限值,当超过这个值,就认为是严重的,将强制写一条警告信息到error log里。 这个参数只影响本地系统上的Extract 和Replicat 进程。

  1. Use the LAGINFOSECONDS, LAGINFOMINUTES,or LAGINFOHOURS parameter to specify how often to report lag information to theerror log. If the lag is greater than the value specified with the LAGCRITICAL parameter,Manager reports the lag as critical; otherwise, it reports the lag as aninformational message. A value of zero (0) forces a message at the frequencyspecified with the LAGREPORTMINUTES or LAGREPORTHOURS parameter.

使用LAGINFOSECONDS、LAGINFOMINUTES或LAGINFOHOURS参数指定将滞后信息报告到错误日志的频率。如果滞后大于LAGCRITICAL参数指定的值,则管理器将滞后报告为严重滞后;否则,它将滞后报告为信息消息。值为零(0)将强制消息以LAGREPORTMINUTES或LAGREPORTHOURS参数指定的频率发送。
这3个参数指定多长时间将lag 信息写入error log。

6.Monitoring processing volume

The volumestatistics show you the amount of data that is being processed by an Oracle GoldenGateprocess, and how fast it is being moved through the Oracle GoldenGate system.With this information, you can diagnose suspected problems and tune the performanceof the Oracle GoldenGate processes.

卷统计信息显示Oracle GoldenGateprocess正在处理的数据量,以及它在Oracle GoldengGate系统中的移动速度。有了这些信息,您可以诊断可疑问题并调整Oracle GoldenGate进程的性能。

查看 volume statistics

STATS {EXTRACT | REPLICAT | ER} {<group| wildcard>} [TABLE {<name | wildcard>}]

示例:

GGSCI (target) 20> stats replicat repa2t1

Sending STATS request to Replicat group REPA2T1 ...

Start of statistics at 2023-12-11 14:08:15.

Replicating from ADMIN.T1 to ADMIN.T1:

*** Total statistics since 2023-12-07 18:41:45 ***
    Total inserts                              6.00
    Total updates                              0.00
    Total deletes                              0.00
    Total upserts                              0.00
    Total discards                             0.00
    Total operations                           6.00

*** Daily statistics since 2023-12-11 00:00:00 ***

	No database operations have been performed.

*** Hourly statistics since 2023-12-11 14:00:00 ***

	No database operations have been performed.

*** Latest statistics since 2023-12-07 18:41:45 ***
    Total inserts                              6.00
    Total updates                              0.00
    Total deletes                              0.00
    Total upserts                              0.00
    Total discards                             0.00
    Total operations                           6.00

End of statistics.

GGSCI (target) 21> 
GGSCI (target) 22> stats replicat repa2t1 table admin.t1

Sending STATS request to Replicat group REPA2T1 ...

Start of statistics at 2023-12-11 14:13:40.

Replicating from ADMIN.T1 to ADMIN.T1:

*** Total statistics since 2023-12-07 18:41:45 ***
    Total inserts                              6.00
    Total updates                              0.00
    Total deletes                              0.00
    Total upserts                              0.00
    Total discards                             0.00
    Total operations                           6.00

*** Daily statistics since 2023-12-11 00:00:00 ***

	No database operations have been performed.

*** Hourly statistics since 2023-12-11 14:00:00 ***

	No database operations have been performed.

*** Latest statistics since 2023-12-07 18:41:45 ***
    Total inserts                              6.00
    Total updates                              0.00
    Total deletes                              0.00
    Total upserts                              0.00
    Total discards                             0.00
    Total operations                           6.00

End of statistics.

GGSCI (target) 23> 

查看 processing rate

STATS {EXTRACT | REPLICAT | ER} {<group| wildcard>}, REPORTRATE {HR | MIN | SEC}

示例:

GGSCI (gg1) 24> stats er ext1,reportrate min

Sending STATS request to EXTRACT EXT1 ...
Start of Statistics at 2011-11-18 16:34:36.

DDL replication statistics (for alltrails):

*** Total statistics since extractstarted     ***

       Operations                                   0.00
       Mapped operations                            0.00
       Unmapped operations                          0.00
       Other operations                             0.00
       Excluded operations                          0.00

Output to /u01/ggate/dirdat/lt:

Extracting from DAVE.PDBA to DAVE.PDBA:

*** Total statistics since 2011-11-1815:13:17 ***

       Total inserts/minute:                        0.00
       Total updates/minute:                        0.00
       Total deletes/minute:                        0.01
       Total discards/minute:                       0.00
       Total operations/minute:                     0.01

*** Daily statistics since 2011-11-1815:13:17 ***

       Total inserts/minute:                        0.00
       Total updates/minute:                        0.00
       Total deletes/minute:                        0.01
       Total discards/minute:                       0.00
       Total operations/minute:                     0.01

*** Hourly statistics since 2011-11-1816:00:00 ***
       No database operations have been performed.

*** Latest statistics since 2011-11-1815:13:17 ***

       Total inserts/minute:                        0.00
       Total updates/minute:                        0.00
       Total deletes/minute:                        0.01
       Total discards/minute:                       0.00
       Total operations/minute:                     0.01

End of Statistics.

查看自启动以来单表的总的操作

STATS {EXTRACT | REPLICAT | ER} {<group| wildcard>},TOTALSONLY <table>

示例:

GGSCI (target) 28> stats rep repa2t1,totalsonly admin.t1

Sending STATS request to Replicat group REPA2T1 ...

Start of statistics at 2023-12-11 14:19:28.

Cumulative totals for specified table(s):

*** Total statistics since 2023-12-07 18:41:45 ***
    Total inserts                              6.00
    Total updates                              0.00
    Total deletes                              0.00
    Total upserts                              0.00
    Total discards                             0.00
    Total operations                           6.00

*** Daily statistics since 2023-12-11 00:00:00 ***

	No database operations have been performed.

*** Hourly statistics since 2023-12-11 14:00:00 ***

	No database operations have been performed.

*** Latest statistics since 2023-12-07 18:41:45 ***
    Total inserts                              6.00
    Total updates                              0.00
    Total deletes                              0.00
    Total upserts                              0.00
    Total discards                             0.00
    Total operations                           6.00

End of statistics.

GGSCI (target) 29> 

To limit the types of statistics that are displayed

STATS {EXTRACT | REPLICAT | ER} {<group| wildcard>},{TOTAL | DAILY | HOURLY | LATEST}

示例:

GGSCI (target) 29> stats repa2t1 total

Sending STATS request to Replicat group REPA2T1 ...

Start of statistics at 2023-12-11 14:20:12.

Replicating from ADMIN.T1 to ADMIN.T1:

*** Total statistics since 2023-12-07 18:41:45 ***
    Total inserts                              6.00
    Total updates                              0.00
    Total deletes                              0.00
    Total upserts                              0.00
    Total discards                             0.00
    Total operations                           6.00

End of statistics.


GGSCI (target) 30> 

命令中的extract和replicat 类型不用指定,后面的逗号也可以省略,gg 都会自动识别。

To clear allfilters that were set with previous options

清除使用以前的选项设置的所有过滤器

STATS {EXTRACT | REPLICAT | ER} {<group| wildcard>}, RESET

To send interimstatistics to the report file

将内部统计信息发送到报告文件

SEND {EXTRACT | REPLICAT | ER} {<group |wildcard>}, REPORT

7.使用进程报告

根据进程报告,可以查看如下内容:

  1. parameters in use
  2. table and column mapping
  3. database information
  4. runtime messages and errors
  5. runtime statistics for thenumber of operations processed

Every Extract,Replicat, and Manager process generates a report file at the end of each run. Thereport can help you diagnose problems that occurred during the run, such asinvalid mapping syntax, SQL errors, and connection errors.

每个Extract,Replicat和Manager进程,在运行结束时都会生成一个report 文件。 通过这个文件可以查看进行在运行期间的相关信息。

To view a process report

Use any of the following:

  1. standard shell command forviewing a text file
  2. Oracle GoldenGate Director
  3. VIEW REPORT command in GGSCI

语法:

VIEW REPORT {<group> | <filename> | MGR}

Where:

  1. <group> shows an Extract or Replicatreport that has the default name, which is the name of the associated group.
  2. <file name> shows anyExtract or Replicat report file that matches a given path name. Must be used ifa non-default report name was assigned with the REPORT option of the ADDEXTRACT or ADD REPLICAT command when the group was created.
  3. MGR shows the Manager processreport.

Report names arein upper case if the operating system is case-sensitive. By default,reportshave a file extension of .rpt, for example EXTORA.rpt. The default location isthe dirrpt sub-directory of the Oracle GoldenGate directory.

如果操作系统大小写敏感,那么Report Name就是大写,默认情况下,Report 文件扩展名是rpt,默认目录是GG 安装目录的dirrpt 目录下。

view report <Process Name> 可以查看运行报告

GGSCI (source) 25> view report exta2t1


***********************************************************************
                 Oracle GoldenGate Capture for Oracle
    Version 12.3.0.1.4 OGGCORE_12.3.0.1.0_PLATFORMS_180415.0359_FBO
   Linux, x64, 64bit (optimized), Oracle 11g on Apr 15 2018 21:22:44
 
Copyright (C) 1995, 2018, Oracle and/or its affiliates. All rights reserved.


                    Starting at 2023-12-11 11:28:58
***********************************************************************

Operating System Version:
Linux
Version #2 SMP Thu Jun 14 18:55:52 PDT 2018, Release 4.1.12-124.16.4.el6uek.x86_64
Node: source
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: 18672

Description: 

***********************************************************************
**            Running with the following parameters                  **
***********************************************************************

2023-12-11 11:28:58  INFO    OGG-03059  Operating system character set identified as UTF-8.

2023-12-11 11:28:58  INFO    OGG-02695  ANSI SQL parameter syntax is used for parameter parsing.

2023-12-11 11:28:58  INFO    OGG-02095  Successfully set environment variable NLS_LANG=AMERICAN_AMERICA.AL32UTF8.

2023-12-11 11:28:58  INFO    OGG-02095  Successfully set environment variable ORACLE_SID=big.

2023-12-11 11:28:58  INFO    OGG-01360  EXTRACT is running in Integrated mode.

2023-12-11 11:28:58  INFO    OGG-01889  Flush size (max message size) is set to 27,985.
EXTRACT exta2t1
setenv (NLS_LANG = AMERICAN_AMERICA.AL32UTF8)
setenv (ORACLE_SID = big)
USERID goldengate, PASSWORD ***

2023-12-11 11:28:58  INFO    OGG-03522  Setting session time zone to source database time zone 'GMT'.
rmthost 192.168.10.33, mgrport 7809
rmttrail /u01/app/oracle/middleware/goldengate/dirdat/ra
table admin.t1;

2023-12-11 11:28:58  INFO    OGG-01635  BOUNDED RECOVERY: reset to initial or altered checkpoint.

2023-12-11 11:28:58  INFO    OGG-01815  Virtual Memory Facilities for: BR
    anon alloc: mmap(MAP_ANON)  anon free: munmap
    file alloc: mmap(MAP_SHARED)  file free: munmap
    target directories:
    /u01/app/oracle/middleware/goldengate/BR/EXTA2T1.

Bounded Recovery Parameter:
BRINTERVAL = 4HOURS
BRDIR      = /u01/app/oracle/middleware/goldengate/

2023-12-11 11:28:58  INFO    OGG-01851  filecaching started: thread ID: 140054108301056.

2023-12-11 11:28:58  INFO    OGG-01815  Virtual Memory Facilities for: COM
    anon alloc: mmap(MAP_ANON)  anon free: munmap
    file alloc: mmap(MAP_SHARED)  file free: munmap
    target directories:
    /u01/app/oracle/middleware/goldengate/dirtmp.

Database Version:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE	11.2.0.4.0	Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production

Database Language and Character Set:
NLS_LANGUAGE     = "AMERICAN" 
NLS_TERRITORY    = "AMERICA" 
NLS_CHARACTERSET = "WE8MSWIN1252" 

2023-12-11 11:28:59  INFO    OGG-03522  Setting session time zone to source database time zone 'GMT'.

2023-12-11 11:28:59  INFO    OGG-06604  Database BIG CPU info: CPU Count 4, CPU Core Count 4, CPU Socket Count 2.

2023-12-11 11:29:00  WARNING OGG-02045  Database does not have streams_pool_size initialization parameter configured.

2023-12-11 11:29:00  INFO    OGG-02248  Logmining server DDL filtering enabled.

2023-12-11 11:29:01  INFO    OGG-02068  Integrated capture successfully attached to logmining server OGG$CAP_EXTA2T1 using OGGCapture API.

2023-12-11 11:29:01  INFO    OGG-02089  Source redo compatibility version is: 11.2.0.4.0.

2023-12-11 11:29:01  INFO    OGG-02086  Integrated Dictionary will be used.

2023-12-11 11:29:01  WARNING OGG-02901  Replication of UDT and ANYDATA from redo logs is not supported with the Oracle compatible parameter setting. Using fetch instead.

Source Context :
  SourceModule            : [ggdb.ora.ddl]
  SourceID                : [/scratch/aime/adestore/views/aime_adc00jza/oggcore/OpenSys/src/gglib/ggdbora/ddlora.c]
  SourceMethod            : [metadata_from_logminer]
  SourceLine              : [983]
  ThreadBacktrace         : [15] elements
                          : [/u01/app/oracle/middleware/goldengate/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**))]
                          : [/u01/app/oracle/±]
                          : [/u01/app/oracle/middleware/goldengate/libgglog.so(_MSG_(CSourceContext*, int, CMessageFactory::MessageDisposition))]
                          : [/u01/app/oracle/middleware/goldengate/extract()]
                          : [/u01/app/oracle/middleware/goldengate/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**)+0xb5) [0x83e875]]
                          : [/u01/app/oracle/middleware/goldengate/extract(ggs::er::OraTranLogDataSource::setup())]
                          : [/u01/app/oracle/middleware/goldengate/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**))]
                          : [/u01/app/oracle/middleware/goldengate/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**))]
                          : [/u01/app/oracle/middleware/goldengate/extract()]
                          : [/u01/app/oracle/middleware/goldengate/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**))]
                          : [  : [/u01/app/oracle/middleware/ware/ngate/extract(ggs::gglib::Mib::Mhreading::MainThread::Run(iRun(iRun(iR)]
]
                          : [/u01/app/oracle/middleware/goldengate/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**))]
                          : [/u01/app/oracle/middleware/goldengate/extract(main)]
                          : [/u01/app/oracle/middleware/goldengate/extract()]
                          : [/u01/app/oracle/middleware/goldengate/extract()]

2023-12-11 11:29:01  ERROR   OGG-02912  Patch 17030189 is required on your Oracle mining database for trail format RELEASE 12.2 or later.

2023-12-11 11:29:01  ERROR   OGG-01668  PROCESS ABENDING.

To determine the name and location of a process report

确定过程报告的名称和位置
Use the INFO command in GGSCI.

INFO<group>, DETAIL

To view information if a process abends without a report

Run the processfrom the command shell of the operating system (not GGSCI) to send the informationto the terminal.
如果进程中断,并没有生成Report 的情况,我们可以使用如下语法来查看进程的信息。

在操作系统里执行如下语法:

<process>paramfile <path name>.prm

Where:

  1. <process> is either Extract or Replicat.
  2. paramfile <path name>.prm is the fullyqualified name of the parameter file.

可以进入到 <GoldenGate安装目录>/dirrpt/目录下,查看对应的报告文件。
最新的报告总是以 <Process Name>.rpt命名的。加后缀数字的报告是历史报告,数字越大对应的时间越久

[oracle@source goldengate]$ cd dirrpt/
[oracle@source dirrpt]$ ll
total 276
-rw-r----- 1 oracle oinstall   213 Dec  8 16:11 DPEA2T10.dsc
-rw-r----- 1 oracle oinstall 10485 Dec  8 16:11 DPEA2T10.rpt
-rw-r----- 1 oracle oinstall   213 Dec  7 18:58 DPEA2T11.dsc
-rw-r----- 1 oracle oinstall 10485 Dec  7 18:58 DPEA2T11.rpt
-rw-r----- 1 oracle oinstall   156 Dec  7 18:52 DPEA2T12.dsc
-rw-r----- 1 oracle oinstall  4018 Dec  7 18:52 DPEA2T12.rpt
-rw-r----- 1 oracle oinstall   156 Dec  7 18:52 DPEA2T13.dsc
-rw-r----- 1 oracle oinstall  4062 Dec  7 18:52 DPEA2T13.rpt
-rw-r----- 1 oracle oinstall  2350 Dec  7 18:46 DPEA2T14.rpt
-rw-r----- 1 oracle oinstall  2350 Dec  7 18:45 DPEA2T15.rpt
-rw-r----- 1 oracle oinstall  2350 Dec  7 18:42 DPEA2T16.rpt
-rw-r----- 1 oracle oinstall   116 Dec  8 16:12 DPEA2T1.dsc
-rw-r----- 1 oracle oinstall  3347 Dec  8 16:12 DPEA2T1.rpt
-rw-r----- 1 oracle oinstall   156 Dec 11 11:28 EXTA2T10.dsc
-rw-r----- 1 oracle oinstall  6257 Dec 11 11:28 EXTA2T10.rpt
-rw-r----- 1 oracle oinstall   156 Dec  8 16:32 EXTA2T11.dsc
-rw-r----- 1 oracle oinstall  6353 Dec  8 16:32 EXTA2T11.rpt
-rw-r----- 1 oracle oinstall   213 Dec  8 16:25 EXTA2T12.dsc
-rw-r----- 1 oracle oinstall 17379 Dec  8 16:25 EXTA2T12.rpt
-rw-r----- 1 oracle oinstall   213 Dec  8 16:04 EXTA2T13.dsc
-rw-r----- 1 oracle oinstall 18666 Dec  8 16:04 EXTA2T13.rpt
-rw-r----- 1 oracle oinstall   156 Dec  7 18:46 EXTA2T14.dsc
-rw-r----- 1 oracle oinstall  5431 Dec  7 18:46 EXTA2T14.rpt
-rw-r----- 1 oracle oinstall   156 Dec  7 18:45 EXTA2T15.dsc
-rw-r----- 1 oracle oinstall  5457 Dec  7 18:45 EXTA2T15.rpt
-rw-r----- 1 oracle oinstall   156 Dec  7 18:42 EXTA2T16.dsc
-rw-r----- 1 oracle oinstall  5432 Dec  7 18:42 EXTA2T16.rpt
-rw-r----- 1 oracle oinstall   213 Dec  7 18:21 EXTA2T17.dsc
-rw-r----- 1 oracle oinstall 16984 Dec  7 18:21 EXTA2T17.rpt
-rw-r----- 1 oracle oinstall   116 Dec  7 17:34 EXTA2T18.dsc
-rw-r----- 1 oracle oinstall  3703 Dec  7 17:48 EXTA2T18.rpt
-rw-r----- 1 oracle oinstall   213 Dec  7 17:28 EXTA2T19.dsc
-rw-r----- 1 oracle oinstall 15515 Dec  7 17:48 EXTA2T19.rpt
-rw-r----- 1 oracle oinstall   156 Dec 11 11:29 EXTA2T1.dsc
-rw-r----- 1 oracle oinstall  6257 Dec 11 11:29 EXTA2T1.rpt
-rw-r----- 1 oracle oinstall  4528 Dec  7 18:22 MGR0.rpt
-rw-r----- 1 oracle oinstall  1466 Dec  7 17:33 MGR1.rpt
-rw-r----- 1 oracle oinstall  6692 Dec  7 17:28 MGR2.rpt
-rw-r----- 1 oracle oinstall  1466 Dec  7 13:49 MGR3.rpt
-rw-r----- 1 oracle oinstall  1466 Dec  7 12:53 MGR4.rpt
-rw-r----- 1 oracle oinstall  4353 Dec 11 11:28 MGR.rpt
[oracle@source dirrpt]$ 
[oracle@source dirrpt]$ cat EXTA2T1.rpt 

***********************************************************************
                 Oracle GoldenGate Capture for Oracle
    Version 12.3.0.1.4 OGGCORE_12.3.0.1.0_PLATFORMS_180415.0359_FBO
   Linux, x64, 64bit (optimized), Oracle 11g on Apr 15 2018 21:22:44
 
Copyright (C) 1995, 2018, Oracle and/or its affiliates. All rights reserved.


                    Starting at 2023-12-11 11:28:58
***********************************************************************

Operating System Version:
Linux
Version #2 SMP Thu Jun 14 18:55:52 PDT 2018, Release 4.1.12-124.16.4.el6uek.x86_64
Node: source
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: 18672

Description: 

***********************************************************************
**            Running with the following parameters                  **
***********************************************************************

2023-12-11 11:28:58  INFO    OGG-03059  Operating system character set identified as UTF-8.

2023-12-11 11:28:58  INFO    OGG-02695  ANSI SQL parameter syntax is used for parameter parsing.

2023-12-11 11:28:58  INFO    OGG-02095  Successfully set environment variable NLS_LANG=AMERICAN_AMERICA.AL32UTF8.

2023-12-11 11:28:58  INFO    OGG-02095  Successfully set environment variable ORACLE_SID=big.

2023-12-11 11:28:58  INFO    OGG-01360  EXTRACT is running in Integrated mode.

2023-12-11 11:28:58  INFO    OGG-01889  Flush size (max message size) is set to 27,985.
EXTRACT exta2t1
setenv (NLS_LANG = AMERICAN_AMERICA.AL32UTF8)
setenv (ORACLE_SID = big)
USERID goldengate, PASSWORD ***

2023-12-11 11:28:58  INFO    OGG-03522  Setting session time zone to source database time zone 'GMT'.
rmthost 192.168.10.33, mgrport 7809
rmttrail /u01/app/oracle/middleware/goldengate/dirdat/ra
table admin.t1;

2023-12-11 11:28:58  INFO    OGG-01635  BOUNDED RECOVERY: reset to initial or altered checkpoint.

2023-12-11 11:28:58  INFO    OGG-01815  Virtual Memory Facilities for: BR
    anon alloc: mmap(MAP_ANON)  anon free: munmap
    file alloc: mmap(MAP_SHARED)  file free: munmap
    target directories:
    /u01/app/oracle/middleware/goldengate/BR/EXTA2T1.

Bounded Recovery Parameter:
BRINTERVAL = 4HOURS
BRDIR      = /u01/app/oracle/middleware/goldengate/

2023-12-11 11:28:58  INFO    OGG-01851  filecaching started: thread ID: 140054108301056.

2023-12-11 11:28:58  INFO    OGG-01815  Virtual Memory Facilities for: COM
    anon alloc: mmap(MAP_ANON)  anon free: munmap
    file alloc: mmap(MAP_SHARED)  file free: munmap
    target directories:
    /u01/app/oracle/middleware/goldengate/dirtmp.

Database Version:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE	11.2.0.4.0	Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production

Database Language and Character Set:
NLS_LANGUAGE     = "AMERICAN" 
NLS_TERRITORY    = "AMERICA" 
NLS_CHARACTERSET = "WE8MSWIN1252" 

2023-12-11 11:28:59  INFO    OGG-03522  Setting session time zone to source database time zone 'GMT'.

2023-12-11 11:28:59  INFO    OGG-06604  Database BIG CPU info: CPU Count 4, CPU Core Count 4, CPU Socket Count 2.

2023-12-11 11:29:00  WARNING OGG-02045  Database does not have streams_pool_size initialization parameter configured.

2023-12-11 11:29:00  INFO    OGG-02248  Logmining server DDL filtering enabled.

2023-12-11 11:29:01  INFO    OGG-02068  Integrated capture successfully attached to logmining server OGG$CAP_EXTA2T1 using OGGCapture API.

2023-12-11 11:29:01  INFO    OGG-02089  Source redo compatibility version is: 11.2.0.4.0.

2023-12-11 11:29:01  INFO    OGG-02086  Integrated Dictionary will be used.

2023-12-11 11:29:01  WARNING OGG-02901  Replication of UDT and ANYDATA from redo logs is not supported with the Oracle compatible parameter setting. Using fetch instead.

Source Context :
  SourceModule            : [ggdb.ora.ddl]
  SourceID                : [/scratch/aime/adestore/views/aime_adc00jza/oggcore/OpenSys/src/gglib/ggdbora/ddlora.c]
  SourceMethod            : [metadata_from_logminer]
  SourceLine              : [983]
  ThreadBacktrace         : [15] elements
                          : [/u01/app/oracle/middleware/goldengate/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**))]
                          : [/u01/app/oracle/±]
                          : [/u01/app/oracle/middleware/goldengate/libgglog.so(_MSG_(CSourceContext*, int, CMessageFactory::MessageDisposition))]
                          : [/u01/app/oracle/middleware/goldengate/extract()]
                          : [/u01/app/oracle/middleware/goldengate/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**)+0xb5) [0x83e875]]
                          : [/u01/app/oracle/middleware/goldengate/extract(ggs::er::OraTranLogDataSource::setup())]
                          : [/u01/app/oracle/middleware/goldengate/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**))]
                          : [/u01/app/oracle/middleware/goldengate/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**))]
                          : [/u01/app/oracle/middleware/goldengate/extract()]
                          : [/u01/app/oracle/middleware/goldengate/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**))]
                          : [  : [/u01/app/oracle/middleware/ware/ngate/extract(ggs::gglib::Mib::Mhreading::MainThread::Run(iRun(iRun(iR)]
]
                          : [/u01/app/oracle/middleware/goldengate/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**))]
                          : [/u01/app/oracle/middleware/goldengate/extract(main)]
                          : [/u01/app/oracle/middleware/goldengate/extract()]
                          : [/u01/app/oracle/middleware/goldengate/extract()]

2023-12-11 11:29:01  ERROR   OGG-02912  Patch 17030189 is required on your Oracle mining database for trail format RELEASE 12.2 or later.

2023-12-11 11:29:01  ERROR   OGG-01668  PROCESS ABENDING.
[oracle@source dirrpt]$ 

如果进程运行时有错误,则报告文件中会包括错误代码和详细的错误诊断信息。通过查找错误代码,可以帮助定位错误原因,解决问题。

Scheduling runtime statistics in the process report

By default,runtime statistics are written to the report once, at the end of each run. For longor continuous runs, you can use optional parameters to view these statistics ona regular basis, without waiting for the end of the run.

默认情况下,运行时的静态信息只在进程结束时写如report。 如果是一个长时间运行的进程,我们可以使用可选的参数来查看进程的信息,而不是等进程stop。

To set a schedulefor reporting runtime statistics

Use the REPORT parameterin the Extract or Replicat parameter file to specify a day and time to generateruntime statistics in the report.

在Extract 或Replicat 进程里指定REPORT参数,就可以在指定的时间间隔内规则的生成report。

To send runtimestatistics to the report on demand

Use the SENDEXTRACT or SEND REPLICAT command with the REPORT option to view current runtimestatistics when needed.

使用send extract 或者 send replicat 命令加report 参数来查看进程当前的运行信息。

GGSCI (source) 35> send EXTA2T1 report

Sending REPORT request to EXTRACT EXTA2T1 ...

Request processed.

Viewing record counts in the process report

Use the REPORTCOUNTparameter to report a count of transaction records that Extract or Replicatprocessed since startup. Each transaction record represents a logical database operationthat was performed within a transaction that was captured by Oracle GoldenGate.The record count is printed to the report file and to the screen.

–REPORTCOUNT 参数可以显示进程自启动以来事务操作的数量。 每个事务操作都会被GG 捕获。

Managing process reports

Once created, areport file must remain in its original location for Oracle GoldenGate to operateproperly after processing has started.

Whenever aprocess starts, Oracle GoldenGate creates a new report file and ages the previousone by appending a sequence number to the name. The numbers increment from 0(the previous one) to 9 (the oldest).

No process everhas more than ten aged reports and one active report. After the tenth aged report,the oldest is deleted when a new report is created. Set up an archivingschedule for aged report files in case they are needed to resolve a servicerequest.

To prevent anExtract or Replicat report file from becoming too large

Use the REPORTROLLOVERparameter to force report files to age on a regular schedule, instead of when aprocess starts. For long or continuous runs, setting an aging schedule controlsthe size of the active report file and provides a more predictable set ofarchives that can be included in your archiving routine.

To prevent SQLerrors from filling up the Replicat report

Use the WARNRATEparameter to set a threshold for the number of SQL errors that can be toleratedon any target table before being reported to the process report and to theerror log. The errors are reported as a warning. If your environment cantolerate a large number of these errors, increasing WARNRATE helps to minimizethe size of those files.

8.使用discardfile

Use a discardfile to capture information about Oracle GoldenGate operations that failed. Thisinformation can help you to resolve data errors, such as those that involveinvalid column mapping.

–discard file可以存放 GG 失败的操作记录。

Discard file 包含如下信息:

  1. The database error message
  2. The sequence number of the datasource or trail file
  3. The relative byte address ofthe record in the data source or trail file
  4. The details of the discardedoperation, such as column values of a DML statement or the text of a DDLstatement.

A discard filecan be used for Extract or Replicat, but it is most useful for Replicat to log operationsthat could not be reconstructed or applied.

discard file 可以使用在Extract 和 Replicat 进程上,但是大多数情况下是在Replicat 进程上使用。

To use a discard file

Include the DISCARDFILEparameter in the Extract or Replicat parameter file. You must supply a name forthe file. The parameter has options that control the maximum file size, afterwhich the process abends, and whether new content overwrites or appends toexisting content.

Extract 和 Replicat 进程都可以包含DISCARDFILE参数,如果使用该参数,必须指明file name。 这个参数的可选参数包括最大filesize,和程序异常中止后,启动时是overwrite 还是append 这个discard file.

语法:

DISCARDFILE<file name> [, APPEND | PURGE] [, MAXBYTES <n> | MEGABYTES<n>]

NOTE:
To prevent theneed to perform manual maintenance of discard files, use either the PURGE orAPPEND option. Otherwise, you must specify a different discard file name beforestarting each process run, because Oracle GoldenGate will not write to anexisting discard file.

为了避免人工的维护discard file,可以使用purge 或者append 参数,这样就可以正常启动了。 不然就需要在启动进程前指定新的位置,因为GG 不会覆盖已经存在的discard file。

To view a discard file

Use either of the following:

  1. Standard shell command to viewthe file by name
  2. VIEW REPORT command in GGSCI,with the discard file name as input

语法:

VIEW REPORT <file name>

To manage discard files

Use the DISCARDROLLOVERparameter to set a schedule for aging discard files. For long or continuousruns, setting an aging schedule prevents the discard file from filling up and causingthe process to abend, and it provides a predictable set of archives that can beincluded in your archiving routine.

使用DISCARDROLLOVER参数设置老化丢弃文件的时间表。对于长时间或连续运行,设置老化时间表可以防止丢弃文件被填满并导致进程异常终止,并且它提供了一组可预测的存档,可以包含在存档例程中。

DISCARDROLLOVER{AT <hh:mi> | ON <day of week> | AT <hh:mi> ON <day ofweek>}
最后修改时间:2024-07-10 11:32:42
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

文章被以下合辑收录

评论