一、理论
source 端:
ADD EXTRACT <ext>, TRANLOG, BEGIN <time>, [, THREADS]
ADD EXTTRAIL <local_trail>, EXTRACT <ext>
EDIT PARAMS <ext>
-- Identify the Extract group:
EXTRACT <ext>
-- Specify database login information as needed for the database:
[SOURCEDB <dsn_1>,][USERID <user>[, PASSWORD <pw>]]
-- Specify the local trail that this Extract writes to:
EXTTRAIL <local_trail>
-- Specify tables to be captured:
TABLE <owner>.<table>;
ADD EXTRACT <pump_1>, EXTTRAILSOURCE <local_trail>, BEGIN <time>
ADD RMTTRAIL <remote_trail_1>, EXTRACT <pump_1>
EDIT PARAMS <pump_1>
-- Identify the data pump group:
EXTRACT <pump_1>
-- Specify database login information as needed for the database:
[SOURCEDB <dsn_1>,][USERID <user>[, PASSWORD <pw>]]
-- Specify the name or IP address of the first target system:
RMTHOST <target_1>, MGRPORT <portnumber>
-- Specify the remote trail on the first target system:
RMTTRAIL <remote_trail_1>
-- Allow mapping, filtering, conversion or pass data through as-is:
[PASSTHRU | NOPASSTHRU]
-- Specify tables to be captured:
TABLE <owner>.<table>;
target 端:
edit params ./GLOBALS
CHECKPOINTTABLE <owner>.<tablename>
ADD REPLICAT <rep_1>, EXTTRAIL <remote_trail_1>, BEGIN <time> checkpointtable <owner>.<tablename>
edit params <rep_1>
-- Identify the Replicat group:
REPLICAT <rep_1>
-- State whether or not source and target definitions are identical:
SOURCEDEFS <full_pathname> | ASSUMETARGETDEFS
-- Specify database login information as needed for the database:
[TARGETDB <dsn_3>,][USERID <user id>[, PASSWORD <pw>]]
-- Specify error handling rules:
REPERROR (<error>, <response>)
-- Specify tables for delivery:
MAP <owner>.<table>, TARGET <owner>.<table>[, DEF <template name>];
二、DML 复制配置实例
source 端:
##添加抽取/传输进程与队列文件
GGSCI>add extract extl,tranlog,begin now
GGSCI>add EXTTRAIL /u01/app/ogg/dirdat/sc, EXTRACT ext_1 megabytes 10
GGSCK>ADD TRANDATA SCOTT.EMP
GGSCI>edit params ext_l
extract ext_l
SETENV (NLS_LANG = "AMERICAN_AMERICA.ZHS16GBK")
userid ogg,password ogg exttrail /u01/app/ogg/dirdat/sc
dynamicresolution gettruncates
table scott.emp;
GGSCI>ADD EXTRACT dp_1, EXTTRAILSOURCE /u01/app/ogg/dirdat/sc, BEGIN now add rmttrail /u01/app/ogg/dirdat/sc extract dp_1
GGSCI>edit params dp_1
extract dp_1
SETENV (NLS_LANG = "AMERICAN_AMERICA.ZHS16GBK")
userid ogg, password ogg
rmthost 192.168.208.114,
mgrport 7809
rmttrail /u01/app/ogg/dirdat/sc
PASSTHRU gettruncates
table scott.emp;
target 端:
GGSCI>edit params ./GLOBALS
CHECKPOINTTABLE ogg.checkpt
GGSCI>add CHECKPOINTTABLE ogg.checkpt
GGSCI>add replicat repl exttrail /u01/app/ogg/dirdat/sc,begin now,checkpointtable ogg.checkpt
GGSCI>edit params rep_l
replicat rep_l
SETENV (NLS_LANG = "AMERICAN_AMERICA.ZHS16GBK")
userid ogg,password ogg
assumetargetdefs reperror default,
discard discardfile /u01/app/ogg/dirdat/rep_1.dsc,append,megabytes 10
gettruncates
map scott.emp, target scott.emp;
三、验证
dml 验证正常