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
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
相关文章推荐
- How to reduce number of records on CTXSYS.DR$WAITING,CTXSYS.DR$PENDING tables in Oracle EBS?
- how to display different title in one master page
- how can i change the back color on mouse out to the color specified in gridview
- Instruments on Leopard: How to debug those random crashes in your Cocoa app
- How to choose the right data structure in different scenarios to bring out best performance?
- How to distinguish Design time or Running time in Mobile cusotmer Contorl(the NetCF2.0 is different to NetCF1.0)
- How To Set Up Database Replication In MySQL On Ubuntu
- use noscript html tag when user disable the javascript in browser, guide user how to enable the js in different browser and retu
- How to turn on RSH and RLOGIN in Linux?
- how to display different title in one master page
- How to install Ns-2-AllinOne-2.33 on Ubuntu 8.04
- How to validate Xml Documents against schemas in BizTalk
- How to enabled nvidia accelerated driver in Ubuntu on my Toshiba Laptop
- HowTo Restore RMAN Disk backups of RAC Database to Single Instance On Another Node
- how to get the space size of some tables in one database?
- TORQUE引擎里如何生成一个在天空中移动的太阳(How to create a sun moving on the sky in the Torque)
- How to Generate PDF in Ruby on Rails(HowtoGeneratePDFs) ZT
- How to draw on a canvas in rap applications
- How to Cheat in Photoshop Elements 6: Create stunning photomontages on a budget
- How to dump, extract and iasl acpi tables on x86 platform