1.GoldenGate 简单的一对一配置
源端和目标端均执行(只要修改相应的目录)
export GGATE_HOME=/home/oracle/ogg
grant ALTER ANY TABLE to ogg;
grant FLASHBACK ANY TABLE to ogg;
grant EXECUTE on DBMS_FLASHBACK to ogg;
grant executeon utl_file to ogg;
grant alter any table to ogg;
grant flashback any table to ogg;
grant connect,resource,unlimited tablespace to ogg;
grant execute on utl_file to ogg;
grant select any dictionary,select any table to ogg;
grant alter any table to ogg;
grant flashback any table to ogg;
grant execute on DBMS_FLASHBACK to ogg;
grant insert any table to ogg;
grant delete any table to ogg;
grant update any table to ogg;
--查看
select
db.LOG_MODE, db.SUPPLEMENTAL_LOG_DATA_MIN, db.FORCE_LOGGING
from
v$
database
db
--修改
--1)archivelog
shutdown immediate
startup mount
alter
database
archivelog;
alter
database
open
;
--2)force logging
alter
database
force
logging;
--3)supplemental log data
alter
database
add
supplemental log data;
PORT 7809
GGSCI (db11) 31> view param lhremd1
EXTRACT lhremd1
setenv(NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
USERID ogg, PASSWORD ogg
DBOPTIONS ALLOWNOLOGGING
EXTTRAIL ./dirdat/l1
TABLE hr.*;
GGSCI (sourceserver) > ADD EXTRACT LHREMD1, TRANLOG, BEGIN NOW
GGSCI (sourceserver) > ADD EXTTRAIL ./dirdat/l1, EXTRACT LHREMD1, MEGABYTES 100
启动
start ext lhremd1
GGSCI (db11) 32> view param phremd1 Extract PHREMD1 ------------------------------------------------------------------- -- Data Pump extract for HR schema ------------------------------------------------------------------- PassThru RmtHost 192.168.1.3, MgrPort 7809 RmtTrail dirdat/l2 Table HR.* ;
GGSCI (sourceserver) > ADD EXTRACT PHREMD1, EXTTRAILSOURCE dirdat/l1
GGSCI (sourceserver) > ADD RMTTRAIL dirdat/l2, EXTRACT PHREMD1, MEGABYTES 100
PORT 7809
GGSCI (10gasm) 3> view param rhremd1 #编辑配置文件,告诉他做什么
Replicat RHREMD1
-------------------------------------------------------------------
-- Replicat for HR Schema
-------------------------------------------------------------------
SETENV (NLS_LANG = AMERICAN_AMERICA.AL32UTF8)
USERID ogg, PASSWORD ogg
HandleCollisions
AssumeTargetDefs
Map HR.*, Target HR.* ; ---注意:空格和分号---结构必须相同,名字可以不同