来自 技术 2019-04-17 00:00 的文章

OGG的PURGEOLDEXTRACTS不能工作的问题

在配置OGG的清理老的trail文件的时候,设置了两行配置:

PURGEOLDEXTRACTS /ogg/dirdat/horcl/hz*,USECHECKPOINTS,MINKEEPDAYS 2

PURGEOLDEXTRACTS /ogg/dirdat/aorcl/ar*,USECHECKPOINTS,MINKEEPDAYS 2

但是发现第二行不起作用

检查参数文件,发现extract参数文件中配置的参数文件的exttrail配置如下:

EXTTRAIL ./dirdat/aorcl/ar

同时发现e_aorcl这个extract对应了两个exttrail

GGSCI (ncrac1) 8> info exttrail *

Extract Trail: /ogg/dirdat/aorcl/ar

Seqno Length: 6

Flip Seqno Length: yes

Extract: E_AORCL

Seqno: 0

RBA: 0

File Size: 500M

Extract Trail: ./dirdat/aorcl/ar

Seqno Length: 9

Flip Seqno Length: no

Extract: E_AORCL

Seqno: 20

RBA: 136368447

File Size: 500M

停掉extract删除了对于的exttrail

GGSCI (ncrac1) 13> delete exttrail /ogg/dirdat/aorcl/ar extract e_aorcl

Deleting extract trail /ogg/dirdat/aorcl/ar for extract E_AORCL

同时,在mgr中加入了一行, 文件路径与extract参数中对应:

PURGEOLDEXTRACTS ./dirdat/aorcl/ar*,USECHECKPOINTS,MINKEEPDAYS 2

之后refresh mgr之后,工作正常

2019-04-08T16:57:26.686+0800 INFO OGG-00957 Oracle GoldenGate Manager for Oracle, mgr.prm: Purged old extract file '/ogg/dirdat/aorcl/ar000000013', applying UseCheckPoints purge rule: Oldest Chkpt Seqno 21 > 13.

2019-04-08T16:57:26.719+0800 INFO OGG-00957 Oracle GoldenGate Manager for Oracle, mgr.prm: Purged old extract file '/ogg/dirdat/aorcl/ar000000014', applying UseCheckPoints purge rule: Oldest Chkpt Seqno 21 > 14.