您的位置:首页 > Web前端

OGG How to Resync Tables / Schemas on Different SCN s in a Single Replicat

2016-11-24 15:49 591 查看
假设HR用户下有个表有问题  TCUSTMER,被排除了,下面就如何恢复单表做记录,根据版本的区别,11.1 和11.2.1.1存在差异,11.1.1.1可采用如下方法:

1. Capture the SCN information in the extract trails using tokens (这步可跳过)

table hr.*, Tokens (tk-csn = @GETENV ("TRANSACTION", "CSN")) ;
Tokens 参数在11.1.1.x版本可忽略,具体csn无需指定。

2.以11.2.1.1为问题的OGG版本,为例,首先找到源库的current_scn作为问题表作为目标端起始操作的scn:

exp hr/hr tables=hr.tcustmer grants=n statistics=none triggers=n compress=n
FLASHBACK_SCN=4746443

3. Run the imports on target



4. Add the replicat on target to the beginning of the extract trail  (4.1可用4.2替换)

 4.1 添加参数文件:

replicat r1

userid myogguser password xyz

assumetargetdefs

discardfile dirrpt\r1.dsc, purge
map hr.tcustmer, target myogguser.* , Filter ( @NUMSTR (@TOKEN ("TK-CSN")) > 4746443);

map hr.tcustord, target myogguser.* , Filter ( @NUMSTR (@TOKEN ("TK-CSN")) > 4747033);

This is used to resync one or more tables/ schemas of different SCN's in the same replicat.If not using tokens in the extract on step 1 (OGG versions 11.1 and higher) then the equivalent mapping to use the default SCN token from the trail would be:
4.2 替换的写法:
(如果不用tokens也可以用FILTER + GETENV方法替换),语法如下:

map hr.tcustmer, target myogguser.* , FILTER ( @GETENV ("TRANSACTION", "CSN") > 4746443);

map hr.tcustord, target myogguser.* , FILTER ( @GETENV ("TRANSACTION", "CSN") > 4747033);

Reference MOS Note:1339317.1


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: