GoldenGate 日常监控
正确启动数据库
源端启动数据库
SQL> startup
源端启动goldengate
GGSCI > start mgr
GGSCI > start *
目标端启动数据库
SQL> startup
目标端启动goldengate
GGSCI > start mgr
GGSCI > start *
正确关闭数据库
源端关闭GoldenGate和数据库
源端关闭GoldenGate
GGSCI > info all 可以查看进程的各种状态(关于各状态的说明,见后面)
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING DPE_OE 00:00:00 00:00:05
EXTRACT RUNNING EXT_OE 00:00:00 00:00:08
GGSCI > stop *
Sending STOP request to EXTRACT DPE_OE ... 先停止datapump进程
Request processed.
Sending STOP request to EXTRACT EXT_OE ... 后停止capture进程
Request processed.
GGSCI > stop mgr 最后手工执行goldengate守护进程
Manager process is required by other GGS processes.
Are you sure you want to stop it (y/n)? y
Sending STOP request to MANAGER ...
Request processed.
Manager stopped.
GGSCI > info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER STOPPED
EXTRACT STOPPED DPE_OE 00:00:00 00:00:29
EXTRACT STOPPED EXT_OE 00:00:00 00:00:29
关闭GoldenGate后,进程的状态应该是STOPPED
源端关闭数据库
SQL> shutdown immediate
目标端关闭GoldenGate和数据库
目标端关闭GoldenGate
GGSCI > info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING DPE_OE 00:00:00 00:00:05
EXTRACT RUNNING EXT_OE 00:00:00 00:00:08
GGSCI > stop *
Sending STOP request to EXTRACT DPE_OE ... 先停止datapump进程
Request processed.
Sending STOP request to EXTRACT EXT_OE ... 后停止capture进程
Request processed.
GGSCI > stop mgr 最后手工执行goldengate守护进程
Manager process is required by other GGS processes.
Are you sure you want to stop it (y/n)? y
Sending STOP request to MANAGER ...
Request processed.
Manager stopped.
GGSCI > info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER STOPPED
REPLICAT RUNNING REP_OE 00:00:00 00:00:07
目标端关闭数据库
SQL> shutdown immediate
附start/stop (stop用法和start一样)命令的一般用法
GGSCI > start <进程名称>
如:GGSCI> start ext_hq 启动一个名叫ext_hq的进程;
也可以使用通配符,如:GGSCI> start er * 启动所有的extract和replicat进程;
GGSCI> start * 启动除MGR以外的所有的进程
GGSCI> start extract *d* 启动所有的包含字符‘d’extract进程;
GGSCI> start replicat rep* 启动所有以“rep“开头的replicat进程
注意,如果是只修改抽取或者复制进程参数,则不需要停止MGR。不要轻易停止MGR进程,并且慎重使用通配符er *, 以免对其他复制进程造成不利影响。
查看整体运行情况
GGSCI (hncdfdb1) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING DPE_HQ 00:00:00 00:00:06
EXTRACT RUNNING EXT_HQ 00:00:00 00:00:06
Group表示进程的名称(MGR进程不显示名字);Lag表示进程的延时;Status表示进程的状态。有四种状态:
STARTING 正在启动过程中
RUNNING 正常运行
STOPPED 正常停止或未能启动
ABENDED 异常中断,需要通过以下命令查看报告,找出出错原因
正常情况下,所有进程的状态应该为RUNNING,且Lag应该在一个合理的范围内。
查看进程状态
GGSCI > info <进程名称> 此命令可以查看进程信息,可以查看到的信息包括进程状态、checkpoint信息、延时等。
GGSCI (test-gg) 138> info rep_hq
REPLICAT REP_HQ Last Started 2014-07-01 15:22 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:06 ago)
Log Read Checkpoint File ./dirdat/d1000016
2014-07-01 15:33:44.412776 RBA 111261210
GGSCI > info <进程名称> detail 此命令查看更详细的信息。包括所使用的trail文件,参数文件、报告文件、警告日志的位置等。
GGSCI (test-gg) 142> info rep_hq detail
REPLICAT REP_HQ Last Started 2014-07-01 15:22 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:09 ago)
Log Read Checkpoint File ./dirdat/d1000016
2014-07-01 15:37:42.499365 RBA 111280166
Extract Source Begin End
./dirdat/d1000016 2014-07-01 15:22 2014-07-01 15:37
./dirdat/d1000016 2014-07-01 15:03 2014-07-01 15:22
./dirdat/d1000012 2014-07-01 15:03 2014-07-01 15:03
./dirdat/d1000012 2014-07-01 15:02 2014-07-01 15:03
./dirdat/d1000012 2014-07-01 14:54 2014-07-01 15:02
./dirdat/d1000011 2014-07-01 14:48 2014-07-01 14:54
./dirdat/d1000010 2014-07-01 14:47 2014-07-01 14:48
./dirdat/d1000010 2014-07-01 14:34 2014-07-01 14:47
./dirdat/d1000007 2014-07-01 14:33 2014-07-01 14:34
./dirdat/d1000007 2014-07-01 14:32 2014-07-01 14:33
./dirdat/d1000007 2014-07-01 14:09 2014-07-01 14:32
./dirdat/d1000006 2014-07-01 13:36 2014-07-01 14:09
./dirdat/d1000000 2014-07-01 13:11 2014-07-01 13:36
./dirdat/d1000000 2014-07-01 13:09 2014-07-01 13:11
./dirdat/d1000000 2014-07-01 13:09 2014-07-01 13:09
./dirdat/d1000000 2014-07-01 13:09 2014-07-01 13:09
./dirdat/d1000000 * Initialized * 2014-07-01 13:09
./dirdat/d1000000 * Initialized * First Record
Current directory /oradb/goldengate
Report file /oradb/goldengate/dirrpt/REP_HQ.rpt
Parameter file /oradb/goldengate/dirprm/rep_hq.prm
Checkpoint file /oradb/goldengate/dirchk/REP_HQ.cpr
Checkpoint table goldengate.rep_hq_checkpoint
Process file /oradb/goldengate/dirpcs/REP_HQ.pcr
Stdout file /oradb/goldengate/dirout/REP_HQ.out
Error log /oradb/goldengate/ggserr.log
GGSCI > info <进程名称> showch 命令可以查看到详细的关于checkpoint的信息,用于查看GoldenGate进程处理过的事务记录。其中比较重要的是extract进程的recovery checkpoint,它表示源数据中最早的未被处理的事务;通过recovery checkpoint可以查看到该事务的redo log位于哪个日志文件以及该日志文件的序列号。所有序列号比它大的日志文件,均需要保留。
GGSCI (test-gg) 143> info rep_hq showch
REPLICAT REP_HQ Last Started 2014-07-01 15:22 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:04 ago)
Log Read Checkpoint File ./dirdat/d1000016
2014-07-01 15:40:30.398558 RBA 111290983
Current Checkpoint Detail:
Read Checkpoint #1
GGS Log Trail
Startup Checkpoint (starting position in the data source):
Sequence #: 16
RBA: 1700
Timestamp: 2014-07-01 15:22:27.244566
Extract Trail: ./dirdat/d1
Current Checkpoint (position of last record read in the data source):
Sequence #: 16
RBA: 111290983
Timestamp: 2014-07-01 15:40:30.398558
Extract Trail: ./dirdat/d1
CSN state information:
CRC: 2-A5-9A-18
Latest CSN: 5563625160842
Latest TXN: 22.47.136
Latest CSN of finished TXNs: 5563625160842
Completed TXNs: 22.47.136
Header:
Version = 2
Record Source = A
Type = 1
# Input Checkpoints = 1
# Output Checkpoints = 0
File Information:
Block Size = 2048
Max Blocks = 100
Record Length = 2048
Current Offset = 0
Configuration:
Data Source = 0
Transaction Integrity = -1
Task Type = 0
Database Checkpoint:
Checkpoint table = goldengate.rep_hq_checkpoint
Key = 1695640860 (0x65116d1c)
Create Time = 2014-07-01 13:47:36
Status:
Start Time = 2014-07-01 15:22:33
Last Update Time = 2014-07-01 15:40:48
Stop Status = A
Last Result = 400
查看延时
GGSCI > lag <进程名称> 可以查看详细的延时信息。此命令比用info命令查看到的延时信息更加精确。注意,此命令只能够查看到最后一条处理过的记录的延时信息。此命令支持通配符 *。
GGSCI (test-gg) 145> lag rep_hq
Sending GETLAG request to REPLICAT REP_HQ ...
Last record lag: 14 seconds.
At EOF, no more records to process.
查看统计信息
GGSCI> stats <进程名称>, <时间频度>,table <owner name>.<table name> 可以查看进程处理的记录数。该报告会详细的列出处理的类型和记录数。如:
GGSCI> stats rep_hq, total 列出自进程启动以来处理的所有记录数。
GGSCI> stats rep_hq, daily, table gg.test 列出当天以来处理的有关gg.test表的所有记录数。
GGSCI (test-gg) 149> stats rep_hq, total
Sending STATS request to REPLICAT REP_HQ ...
Start of Statistics at 2014-07-01 15:57:54.
DDL replication statistics:
*** Total statistics since replicat started ***
Operations 0.00
Mapped operations 0.00
Unmapped operations 0.00
Other operations 0.00
Excluded operations 0.00
Errors 0.00
Retried errors 0.00
Discarded errors 0.00
Ignored errors 0.00
Replicating from DBUSRSYS.DEBUG_LOG to DBUSRSYS.DEBUG_LOG:
*** Total statistics since 2014-07-01 15:22:33 ***
Total inserts 775.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 775.00
Replicating from DBUSRSYS.OPERLOG to DBUSRSYS.OPERLOG:
*** Total statistics since 2014-07-01 15:22:33 ***
Total inserts 92.00
Total updates 5.00
Total deletes 0.00
Total discards 0.00
Total operations 97.00
查看运行报告
GGSCI> view report <进程名称> 可以查看运行报告。如:
GGSCI (test-gg) 151> view report rep_hq
***********************************************************************
Oracle GoldenGate Delivery for Oracle
Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO
Linux, x64, 64bit (optimized), Oracle 10g on Apr 23 2012 07:49:07
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
Starting at 2014-07-01 15:22:33
***********************************************************************
Operating System Version:
Linux
Version #1 SMP Wed Jun 13 18:24:36 EDT 2012, Release 2.6.32-279.el6.x86_64
Node: test-gg
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: 10064
Description:
***********************************************************************
** Running with the following parameters **
***********************************************************************
2014-07-01 15:22:33 INFO OGG-03035 Operating system character set identified as US-ASC
II. Locale: en_US, LC_ALL:.
REPLICAT rep_hq
SETENV (NLS_LANG="American_America.ZHS16GBK")
Set environment variable (NLS_LANG=American_America.ZHS16GBK)
SETENV (ORACLE_SID=hncdfhq)
Set environment variable (ORACLE_SID=hncdfhq)
USERID goldengate, PASSWORD **********
REPORTCOUNT EVERY 30 MINUTES, RATE
REPERROR DEFAULT, ABEND
numfiles 5000
--HANDLECOLLISIONS
assumetargetdefs
DISCARDFILE ./dirrpt/rep_hq.dsc, APPEND, MEGABYTES 1000
ALLOWNOOPUPDATES
DDL INCLUDE MAPPED
DDLOPTIONS REPORT
mapexclude DBUSRMKT.PRCADJUSTSJHD, target DBUSRMKT.PRCADJUSTSJHD;
mapexclude DBUSRMKT.BORDERHEAD, target DBUSRMKT.BORDERHEAD;
mapexclude DBUSRSYS.FTERP_DDL_LOG, target DBUSRSYS.FTERP_DDL_LOG;
mapexclude DBUSRMKT.BINSTRHEAD, target DBUSRMKT.BINSTRHEAD;
map DBUSRSYS.*, target DBUSRSYS.*;
map CONGOU.*, target CONGOU.*;
map DBUSRPOP.*, target DBUSRPOP.*;
map PORTAL.*, target PORTAL.*;
map DBUSRXMLT.*, target DBUSRXMLT.*;
map DBUSRMKT.*, target DBUSRMKT.*;
map DBLINKUSR.*, target DBLINKUSR.*;
map DBUSRSET.*, target DBUSRSET.*;
map DBUSRPUB.*, target DBUSRPUB.*;
2014-07-01 15:22:33 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:
/oradb/goldengate/dirtmp.
CACHEMGR virtual memory values (may have been adjusted)
CACHESIZE: 2G
CACHEPAGEOUTSIZE (normal): 8M
PROCESS VM AVAIL FROM OS (min): 4G
CACHESIZEMAX (strict force to disk): 3.41G
也可以进入到 <GoldenGate安装目录>/dirrpt/目录下,查看对应的报告文件。最新的报告总是以<进程名称>.rpt命名的。加后缀数字的报告是历史报告,数字越大对应的时间越久。如所示:
[oracle@test-gg dirrpt]$ ll
总用量 940
-rw-rw-rw-. 1 oracle oinstall 10477 7月 1 15:22 MGR.rpt
-rw-rw-rw-. 1 oracle oinstall 23577 7月 1 15:22 REP_HQ0.rpt
-rw-rw-rw-. 1 oracle oinstall 19413 7月 1 15:11 REP_HQ1.rpt
-rw-rw-rw-. 1 oracle oinstall 22908 7月 1 15:09 REP_HQ2.rpt
-rw-rw-rw-. 1 oracle oinstall 23423 7月 1 15:02 REP_HQ3.rpt
-rw-rw-rw-. 1 oracle oinstall 21574 7月 1 14:55 REP_HQ4.rpt
-rw-rw-rw-. 1 oracle oinstall 20708 7月 1 14:48 REP_HQ5.rpt
-rw-rw-rw-. 1 oracle oinstall 23825 7月 1 14:47 REP_HQ6.rpt
-rw-rw-rw-. 1 oracle oinstall 19791 7月 1 14:36 REP_HQ7.rpt
-rw-rw-rw-. 1 oracle oinstall 20019 7月 1 14:34 REP_HQ8.rpt
-rw-rw-rw-. 1 oracle oinstall 16966 7月 1 14:32 REP_HQ9.rpt
-rw-rw-rw-. 1 oracle oinstall 694186 7月 1 15:22 rep_hq.dsc
-rw-rw-rw-. 1 oracle oinstall 19004 7月 1 15:57 REP_HQ.rpt
如果进程运行时有错误,则报告文件中会包括错误代码和详细的错误诊断信息。通过查找错误代码,可以帮助定位错误原因,解决问题。
查看参数设置
GGSCI > view params <进程名> 该命令支持通配符*
检查进程运行情况:
GGSCI> info all
GoldenGate mgr进程和ext_oe进程应该为RUNNING状态;
GGSCI> info ext_hq
多次运行info ext_app命令,返回的RBA参数应该是变化的说明进程正常。
GoldenGate 日常监控的更多相关文章
- 2.goldengate日常维护命令(转载)
goldengate日常维护命令 发表于 2013 年 7 月 4 日 由 Asysdba 1.查看进程状态 GGSCI (PONY) 2> info all 2.查看进程详细状态,有助于排错 ...
- zabbix日常监控项java(四)
yum install net-tools netstat命令 yum -y install bash-completion 命令自动补全包 https://github.com/qiueer/zab ...
- (四)RabbitMQ消息队列-服务详细配置与日常监控管理
原文:(四)RabbitMQ消息队列-服务详细配置与日常监控管理 RabbitMQ服务管理 启动服务:rabbitmq-server -detached[ /usr/local/rabbitmq/sb ...
- MySQL日常监控及sys库的使用【转】
一.统计信息(SQL维度) 关于SQL维度的统计信息主要集中在events_statements_summary_by_digest表中,通过将SQL语句抽象出digest,可以统计某类SQL语句在各 ...
- OGG_GoldenGate日常监控(案例)
2014-03-11 Created By BaoXinjian
- AIX系统的日常监控维护
UNIX操作系统在各电信运营商中应用非常广泛,各种业务管理系统的后台服务器几乎都采用UNIX操作系统.AIX作为UNIX操作系统中的一种, 因其稳定性高.兼容性好的特点受到众多系统管理员的欢迎.下面提 ...
- GoldenGate的监控
1.进入GoldenGate安装目录,运行GGSCI,然后使用info all查看整体的运行状况 GGSCI (aix212) 1> info all Program Status Group ...
- zabbix的日常监控-自动化监控(十一)
自动化监控: 1.自动注册 1.1.zabbix agent自动添加 2.主动发现 2.1.自动发现Discover 2.2.zabbix api 自动发现与自动注册,哪一个更好? 共同的特点均可以添 ...
- oracle日常监控语句
oracle常用的性能监控SQL语句 一.查询历史SQL: ---正在执行的SQL语句: select a.username, a.sid,b.SQL_TEXT, b.SQL_FULLTEXT fro ...
随机推荐
- windows上通过vnc连接虚拟机中linux系统
首先要在虚拟机中安装vnc. 虚拟机的设置中要启用VNC连接. watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaHdzc2c=/font/5a6L5L2T/ ...
- hdu 2079 选课时间(题目已改动,注意读题) (母函数)
代码: #include<cstdio> #include<cstring> using namespace std; int main() { int t; scanf(&q ...
- Understanding The Complete Story of Postback in ASP.NET
https://docs.microsoft.com/zh-cn/dotnet/api/system.web.ui.page.ispostback?view=netframework-4.7 http ...
- [JZOJ 5437] [NOIP2017提高A组集训10.31] Sequence 解题报告 (KMP)
题目链接: http://172.16.0.132/senior/#main/show/5437 题目: 题解: 发现满足上述性质并且仅当A序列的子序列的差分序列与B序列的差分序列相同 于是我们把A变 ...
- 重温前端基础之-js排序算法
javascript数组常用的方法: push():返回值,数组新的长度 pop():返回值,被删除的数组末尾元素 shift():返回值,被删除的数组首部元素 unshift():返回值,数组新的长 ...
- [转] CentOS 7 为firewalld添加开放端口及相关资料
转自http://www.cnblogs.com/hubing/p/6058932.html 1.运行.停止.禁用firewalld 启动:# systemctl start firewalld 查 ...
- HDU 1892 See you~ 【 二维树状数组 】
题意:二维的树状数组注意的有三个地方,输入进去的坐标都加1,防止lowbit(0) + 0造成死循环还有就是询问矩形面积的时候,输入进去的x1,x2,y1,y2,可能不是正对角线,要转化成正对角线 初 ...
- SpringCloud学习笔记(15)----Spring Cloud Netflix之Hystrix Dashboard的使用
1. 引入依赖 在前面几节中的消费者中添加pom依赖. <dependency> <groupId>org.springframework.cloud</groupId& ...
- C# 将string 转换为二维码图片,然后转为base64字符串编码 。
需在nuget 添加此dll ///content字符串 public static string GetQRCode(string content, int moduleSize = 9) { va ...
- Vue组件开发 -- Markdown
利用marked 和 highlight.js开发markdown组件 实现效果图如下: markdown组件已这种形式<Markdown v-model="markdown" ...