OGG单独开启Sequence值复制,无法成功
本帖最后由 cargoo 于 2013-1-10 15:59 编辑Oracle DB:10.2.0.4 windows 64位
OGG:11.2.1.0.1
4 Oracle:安装Sequence 复制特性
4.1 特性安装
要求:源端数据库、目标端数据库均需安装。
GGSCI > EDIT PARAMS ./GLOBALS
GGSCHEMA OGG
SQL> CONNECT / AS SYSDBA
SQL > @$GG_HOME/sequence.sql -- 输入:OGG
4.2 源数据库端
SQL > GRANT EXECUTE ON OGG.UPDATESEQUENCE TO OGG;
SQL > ALTER TABLE SYS.SEQ$ ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY) COLUMNS;
4.3 目标数据库端
SQL > GRANT EXECUTE ON OGG.REPLICATESEQUENCE TO OGG;
没有安装DDL特性
抽取进程配置:
EXTRACT EXT_01
SETENV (ORACLE_HOME=E:\Oracle\10.2.0\dbhome)
SETENV (NLS_LANG = AMERICAN_AMERICA.ZHS16GBK)
SETENV (ORACLE_SID=GGS)
USERID OGG, PASSWORD OGG
REPORT AT 01:59
REPORTROLLOVER AT 02:00
EXTTRAIL .\DIRDAT\41\TR
DISCARDFILE .\DIRRPT\EXT_01.DSC, APPEND, MEGABYTES 100
DYNAMICRESOLUTION
GETTRUNCATES
SEQUENCE SCOTT.TEST_SEQ;
TABLE SCOTT.TEST_OBJECTS;
投递进程配置:
EXTRACT DLV_01
SETENV (ORACLE_HOME=E:\Oracle\10.2.0\dbhome)
SETENV (NLS_LANG = AMERICAN_AMERICA.ZHS16GBK)
SETENV (ORACLE_SID=GGS)
USERID OGG, PASSWORD OGG
REPORT AT 01:59
REPORTROLLOVER AT 02:00
PASSTHRU
RMTHOST 192.168.70.108, MGRPORT 8809, COMPRESS
RMTTRAIL .\DIRDAT\41\TR
SEQUENCE SCOTT.TEST_SEQ;
TABLE SCOTT.TEST_OBJECTS;
复制进程配置:
REPLICAT REP_01
SETENV (ORACLE_HOME= E:\Oracle\10.2.0\dbhome)
SETENV (NLS_LANG = AMERICAN_AMERICA.ZHS16GBK)
SETENV (ORACLE_SID=GGT)
USERID OGG, PASSWORD OGG
REPORT AT 01:59
REPORTROLLOVER AT 02:00
REPERROR DEFAULT, DISCARD
DISCARDFILE .\DIRRPT\REP_01.DSC, APPEND, MEGABYTES 50
DYNAMICRESOLUTION
ASSUMETARGETDEFS
MAP SCOTT.*, TARGET SCOTT.*;
此配置数据复制已成功、truncate操作也成功。
源端、目标端Sequence创建:
CREATE SEQUENCE TEST_SEQ INCREMENT BY 1 MINVALUE 1 MAXVALUE 99999 START WITH 1 NOCACHE ORDER;
设置源端Sequence值为10、目标端Sequence值为15
在源端执行select test_seq.nextval from dual;
在目标端查询select last_number from user_sequences where sequence_name='TEST_SEQ';
发现目标端Sequence值没有增长。
一直在源端执行select test_seq.nextval from dual;直至Sequence达到20,目标端值也无变化。
Discard文件报告:
Operation failed at seqno 5 rba 2600
Discarding record on action DISCARD on error 20783
Problem replicating SCOTT.TEST_SEQ to SCOTT.TEST_SEQ
Mapping problem with compressed update record (target format)...
*
不解,Sequence值对于数据库来说也是一个具体的数据,你直接同步表数据的时候,数值就同步过去了。
为什么还要同步Sequence值呢? follow http://www.askmaclean.com/archives/goldengate-best-parameters-test-from-maclean.html的过程 重试 检查REP_01.RPT文件,是权限问题。在目标端授予OGG用户DBA权限后,Sequence值可以成功复制。
今天重复安装步骤,测试成功。
页:
[1]