异构平台用OGG迁移数据

./ggsci
dblogin userid 用户名 , password 密码
ADD SCHEMATRANDATA MSP
查看
info SCHEMATRANDATA MSP


ADD EXTRACT exh4, TRANLOG, BEGIN NOW, THREADS 2
ADD EXTTRAIL ./dirdat/ef, EXTRACT exh4, MEGABYTES 1024
edit param exh4

EXTRACT exh4
SETENV (ORACLE_HOME = /oracle/app/oracle/product/11.2.0)
SETENV (ORACLE_SID = 数据库名)
SETENV (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
USERID 用户名, PASSWORD 密码
WILDCARDRESOLVE DYNAMIC
DYNAMICRESOLUTION
DDL  INCLUDE  ALL
REPORTCOUNT EVERY 1 MINUTES, RATE
DISCARDROLLOVER AT 3:00
EXTTRAIL ./dirdat/ef
DISCARDFILE ./dirrpt/exh4_0001.dsc,APPEND,MEGABYTES 1024
FETCHOPTIONS NOUSESNAPSHOT
GETTRUNCATES
TABLE MSP.*;
tableexclude MSP.SCHEDULER$_JOB_ARG;
tableexclude  MSP.T_MS_MEDIA_TASK;


start exh4


ADD EXTRACT pumph4, EXTTRAILSOURCE ./dirdat/ef
ADD RMTTRAIL ./dirdat/ef, EXTRACT pumph4, MEGABYTES 1024

edit param pumph4

EXTRACT pumph4
PASSTHRU
RMTHOST 目标端IP, MGRPORT 7809
RMTTRAIL ./dirdat/ef
DISCARDFILE ./dirrpt/pumph4_0001.dsc,APPEND,MEGABYTES 1024
Dynamicresolution
REPORT AT 01:59
REPORTROLLOVER AT 02:00
TABLE MSP.*;








目标端

ADD REPLICAT reph4 , EXTTRAIL ./dirdat/ef , checkpointtable 用户名.checkpointtable
edit param reph4
REPLICAT reph4
setenv (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
USERID 用户名 , PASSWORD 密码
REPERROR DEFAULT, ABEND
ASSUMETARGETDEFS
DISCARDFILE ./dirrpt/reph4_0001.dsc, APPEND, MEGABYTES 1024
WILDCARDRESOLVE DYNAMIC
APPLYNOOPUPDATES
Dynamicresolution
DDL INCLUDE  MAPPED
DDLOPTIONS  REPORT
report AT 01:59
reportrollover at 02:00
sqlexec "Alter session set constraints=deferred"
grouptransops 1500
maxtransops 1500
GETTRUNCATES
MAP MSP.*, TARGET MSP.*;
MAPEXCLUDE MSP.SCHEDULER$_JOB_ARG;
MAPEXCLUDE MSP.T_MS_MEDIA_TASK;
MAPEXCLUDE MSP.MSP.T_MS_MSP_LOCK;


sqlplus / as sysdba
grant exempt access policy to 用户名;
col current_scn for 9999999999999999999999
select current_scn from v$database;

         
         
         
源端根据scn号导出数据
expdp \'用户名\/密码 as sysdba\' directory=export2 dumpfile=MSP_%U.dmp logfile=MSP20190215.log exclude=statistics,trigger schemas=MSP flashback_scn=13804790576808 cluster=n compression=all
之后拷贝dmp文件到目标端




3.3.2  目标端
导入dmp文件里的数据
impdp 用户名/密码 dumpfile=MSP_01.dmp directory=export2 schemas=MSP EXCLUDE=STATISTICS:"in('')"



3.4  启动各进程
3.4.1  启动目标端mgr进程
cd /ogg
./用户名ci
start mgr
3.4.2  启动源端pump进程
cd /ogg
./用户名ci
start pumph4
info all


3.4.3  启动目标端replicat进程
cd /ogg
./ggsci
start replicat reph4 ,aftercsn 13804790576808
info all

posted on 2020-03-18 23:25  dataunix123  阅读(622)  评论(0编辑  收藏  举报