ogg新增推送,复制进程同步3表

需求:目标端需要同步另一个源端的3张表

源端:9i  AIX   目标端:11G windows

1.源端添加推送进程

add extract p117, exttrailsource ./dirdat/es

add rmttrail d:\ogg\dirdat\XX,EXTRACT p117,MEGABYTES 100

 

edit params p117

 

EXTRACT P117

TRANLOGOPTIONS RAWDEVICEOFFSET 0

TRANLOGOPTIONS CONVERTUCS2CLOBS

USERID oggadm, PASSWORD oggadm

RMTHOST IP地址, MGRPORT 7809, COMPRESS

RMTTRAIL d:\ogg\dirdat\t1

PASSTHRU

TABLE X.X;

TABLE X.X;

TABLE X.X;


2.更改推送进程的文件号,默认为0文件

lter extract p117 extseqno 13659,extrba 0

3.保证目标端可以接收到新同步过去的文件之后,在没有对此3表有事务的情况下,查询数据库SCN

select s.sid,t.start_time,osuser o, username u,sa.sql_text

from v$session s, v$transaction t, dba_rollback_segs r, v$sqlarea sa

where s.taddr=t.addr and t.xidusn=r.segment_id(+)

and s.sql_address=sa.address(+);

col get_system_change_number for 9999999999999999999;

select dbms_flashback.get_system_change_number from dual;


4.按SCN方式,导出3表,不带触发器。
exp TELECOM/TELECOM file=x.dmp flashback_scn=XXX log=X.log tables=X triggers=n
。。。
。。。

5.导入3表

imp X/X buffer=104857600 file=X.dmp full=y  log=X

6.目标端添加复制进程

dblogin userid oggadm,password oggadm

add replicat rs117,exttrail ./dirdat/t1,checkpointtable oggadm.GGS_CHECKPOINT

 

edit param rs117

 

REPLICAT rs117

SETENV (ORACLE_SID = "X")

SETENV (NLS_LANG = "AMERICAN_AMERICA.ZHS16GBK")

USERID oggadm, PASSWORD AACAAAAAAAAAAAGACBRBDBRGUJAGXCKH, ENCRYPTKEY DEFAULT

ASSUMETARGETDEFS

ALLOWNOOPUPDATES

discardfile ./dirrpt/X.dsc, purge, megabytes 200

reperror default, discard

discardrollover

STATOPTIONS RESETREPORTSTATS

REPORT AT 00:01

REPORTROLLOVER AT 00:01

REPORTCOUNT EVERY 60 SECONDS, RATE

gettruncates

DDL INCLUDE ALL

DDLERROR 4045 IGNORE

DDLERROR 4080 IGNORE

DDLERROR 1918 IGNORE

DDLERROR 942 IGNORE

DDLERROR 1435 IGNORE

DDLERROR DEFAULT DISCARD RETRYOP MAXRETRIES 2 RETRYDELAY 5

MAP X.X, TARGET X.X;

7.根据导出的SCN来启动复制进程

start replicat rs117, aftercsn X



来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30491527/viewspace-1982666/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/30491527/viewspace-1982666/

你可能感兴趣的:(数据库,操作系统)