方法一:通过DBLINK进行重新初始化
1.停复制进程
GGSCI (ljodsdb1) > stop TREPLVA
2.查看源端CURRENT_SCN
select CURRENT_SCN from v$database@jjgc_yyjc;
--12748737956750
3.编辑复制进程,修改对应CSN
edit params TREPLVA
MAP FMIS1100.XTBILLMX2014 , TARGET ODS_YYJC_BUF.XTBILLMX2014 ,
COLMAP (USEDEFAULTS,year="2014",updatetime=@DATENOW()),
FILTER (@GETENV ("TRANSACTION","CSN") > 12748737956750);
4.同步表的数据truncate+insert
--truncate table T_GATHER_PROJECT_GROUP_DX;
insert into T_GATHER_PROJECT_GROUP_DX
select a.*,sysdate from STDPM.T_GATHER_PROJECT_GROUP_DX@jjgc_yyjc as of scn 12748737956750 a;
5.启动复制进程
GGSCI (ljodsdb1) > start TREPLVA
方法二:通过数据泵impdp重新初始化
$vi impdp_table.par
userid=ODS_YYJC_BUF/ODS_YYJC_BUF@yyjc1
directory=trans_work
logfile=impdp_table.log
REMAP_SCHEMA=STDPM:ODS_YYJC_BUF
tables=STDPM.T_GATHER_PROJECT_GROUP_DX
content=data_only
network_link=jjgc_yyjc
FLASHBACK_SCN=2285907
$nohup impdp parfile=impdp_table.par &
或
expdp ogguser/ogg@orcl directory=oggdump file=nanhai.dmp tables=scott.emp grants=n statistics=none sriggers=n compress=n FLASHBACK_SCN=1176681
impdp odsf/odsf@orcl directory=guowangp file=nanhai.dmp PARALLEL=4 logfile=c.log remap_schema=FMIS:ODS remap_tablespace=FMIS2500:ODSVIEW INCLUDE=TABLE_DATA
方法三:通过exp+imp重新初始化
exp ods_yyjc_buf/ods_yyjc_buf@orcl file=e:\oracl\ods_yyjc_buf.dmp FLASHBACK_SCN=2285907 TABLES=aa,bb
imp ods_yyjc_oggfj/ods123@orcl file=e:\ods_yyjc_buf.dmp fromuser=ods_yyjc_buf touser=ods_yyjc_oggfj tables=aa,bb ignore=y
数据比对:
select DXID , DXMC ,DXTYBZ,CPR , SKR ,PMJE,PJZT ,CPRQ ,DQR , COMPID,HOLDERACCNAME from FMIS1100.XTGLDX5015@cwgk_yyjc
minus
select DXID , DXMC ,DXTYBZ,CPR , SKR ,PMJE,PJZT ,CPRQ ,DQR , COMPID,HOLDERACCNAME from ODS_YYJC_BUF.XTGLDX5015;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/27126919/viewspace-1299422/,如需转载,请注明出处,否则将追究法律责任。