• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

【翻译自mos文章】怎么检查Oracle GoldenGate(OGG)的checkpoin

mysql 搞代码 4年前 (2022-01-09) 32次浏览 已收录 0个评论

怎么检查Oracle GoldenGate(OGG)的checkpoint file 是否被locked? 参考原文: How to check if the check point file is locked? (Doc ID 1480118.1) 适用于: Oracle GoldenGate – Version 11.1.1.1.1 and later Information in this document applies t

怎么检查Oracle GoldenGate(OGG)的checkpoint file 是否被locked?

参考原文:
How to check if the check point file is locked? (Doc ID 1480118.1)

适用于:
Oracle GoldenGate – Version 11.1.1.1.1 and later
Information in this document applies to any platform.

目标:
GoldenGate 使用 fi本文来源gaodai#ma#com搞@@代~&码*网2le lock 来确定 进程(抽取进程,传输进程,应用进程)是否在running
有时候,我们呢会看到进程(extract or replicat) 正在running,但是该进程确实没有running,并且该进程的检查点文件(checkpoint file)处于被锁定的状态。MOS文章 1314220.1 描述了解决这个问题的方法

本文描述了确认 checkpoint file 是否被locked的方法。

解决方案:

1. checkpoint file被本server上的一个进程lock:

(1) lsof[oracle@localhost dirchk]$ lsof E1.cpeCOMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMEextract 19025 oracle 16uW REG 253,0 53248 419123 E1.cpe

(2) fuser[oracle@localhost dirchk]$ fuser E1.cpeE1.cpe: 19025

[oracle@localhost dirchk]$ ps -ef|grep 19025oracle 19025 7443 2 18:14 ? 00:00:01 /app/goldengate/source/extract PARAMFILE /app/goldengate/source/dirprm/e1.prm REPORTFILE /app/goldengate/source/dirrpt/E1.rpt PROCESSID E1 USESUBDIRSoracle 19035 19025 1 18:14 ? 00:00:01 oracleorcl (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))oracle 19041 19025 2 18:14 ? 00:00:01 oracleorcl (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))oracle 19058 18929 0 18:15 pts/0 00:00:00 grep 19025

2.checkpoint file 在nfs server端,并且 lock 也是在nfs server端,可以用如下的perl脚本来检查:

—————-

#!/usr/bin/perluse Fcntl ':flock'; # import LOCK+* constantsmy $f = $ARGV[0];open (MYFILE, "+< $f") || die "cannot open file\n";print "status 1: file is opened, but not locked yet\n";flock(MYFILE, LOCK_EX) || die "cannot flock file\n";print "status 2: file is opened/locked, but not seeked yet\n";seek (MYFILE, 0, 2) || die "seek failed \n";print "status 3: file is opened/locked/seeked sucessfully, sleeping for 20 sec\n";sleep(20);close (MYFILE);print "status 4: closed file\n"; 

—————–

使用例子:

(1) when the file is lockedmugato:/mnt/shared/Public/Support/oracle/v111114_2_linux64_ora11g/dirchk> ./tt.pl E1.cpestatus 1: file is opened, but not locked yet

(2) when the file is not lockedmugato:/mnt/shared/Public/Support/oracle/v111114_2_linux64_ora11g/dirchk> ./tt.pl E1.cpestatus 1: file is opened, but not locked yetstatus 2: file is opened/locked, but not seeked yetstatus 3: file is opened/locked/seeked sucessfully, sleeping for 20 secstatus 4: closed fileNote: the script is only tested on Solaris 10, and it may need to be modified on other platform

搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:【翻译自mos文章】怎么检查Oracle GoldenGate(OGG)的checkpoin

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址