原文链接:http://www.xifenfei.com/648.html
一、理论
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>];
|
二、配置实例
source
add extract extl,tranlog,begin now
ADD EXTTRAIL
/u01/ogg/dirdat/rl
, EXTRACT EXTL
ADD TRANDATA chf.objce_t
edit params extl
extract extl
SETENV (NLS_LANG =
"AMERICAN_AMERICA.ZHS16GBK"
)
userid ogg,password xifenfei
exttrail
/u01/ogg/dirdat/rl
dynamicresolution
gettruncates
table chf.objce_t;
ADD EXTRACT pump1, EXTTRAILSOURCE
/u01/ogg/dirdat/rl
, BEGIN now
add rmttrail
/u01/ogg/dirdat/rl
extract pump1
edit params pump1
extract pump1
SETENV (NLS_LANG =
"AMERICAN_AMERICA.ZHS16GBK"
)
userid ogg, password xifenfei
rmthost 192.168.1.111, mgrport 7809
rmttrail
/u01/ogg/dirdat/rl
PASSTHRU
gettruncates
table chf.objce_t;
|
target
edit params .
/GLOBALS
CHECKPOINTTABLE ogg.chkpoint
ADD CHECKPOINTTABLE ogg.chkpoint
add replicat repl exttrail
/u01/ogg/dirdat/rl
,begin now,checkpointtable ogg.chkpoint
edit repl
replicat repl
SETENV (NLS_LANG =
"AMERICAN_AMERICA.ZHS16GBK"
)
userid ogg,password xifenfei
assumetargetdefs
reperror default,discard
discardfile
/tmp/repsz
.dsc,append,megabytes 100
gettruncates
map chf.objce_t, target chf.objce_t;
|
本文详细介绍了使用 Oracle GoldenGate 进行数据同步的配置过程,包括 Extract、Data Pump 和 Replicat 的设置步骤,并提供了具体的配置示例。
1359

被折叠的 条评论
为什么被折叠?



