Chinaunix首页 | 论坛 | 博客
  • 博客访问: 236506
  • 博文数量: 50
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 533
  • 用 户 组: 普通用户
  • 注册时间: 2015-07-28 21:56
个人简介

活着,寻找生存。

文章分类

全部博文(50)

文章存档

2017年(1)

2016年(20)

2015年(29)

我的朋友

分类: Oracle

2016-02-18 18:14:39

 Implementing replication of cyclic sequences in GoldenGate (文档 ID 1321558.1) 

APPLIES TO: 

Oracle GoldenGate - Version 10.0.0.0 and later
Information in this document applies to any platform.
***Checked for relevance on 04-Feb-2013*** 

PURPOSE

OGG has added support for replication of cyclic sequences in the 11.1.1.1.x builds.
     
Backport: Any code prior to v11.1.1.x must contain patch 9428942 to reliably replicate cyclic sequences.
     
Documentation for versions 10.0, 10.4 and 11.1 states that extract supports sequences. In fact, sequences were not intended to be supported and did not work seamlessly.

This note describes the proper implementation of replication of cyclic sequences.

SCOPE

This covers the replication of cyclic sequences in the 11.1.1.1.x and subsequent builds.
    
Backport: Any code prior to v11.1.1.x must contain patch 9428942 to reliably replicate cyclic sequences.

 Failure to use the right code version or to follow the implementation and installation procedures might result in a replicat abend with messages similar to this: 

2011-04-20 17:35:53 ERROR OGG-01444 Oracle GoldenGate Delivery for Oracle, rora01.prm: Error in replicating sequence value [ORA-06550: line 1, column 8: PLS-00201: identifier 'GGS.REPLICATESEQUENCE' must be declared ORA-06550: line 1, column 8: PL/SQL: Statement ignored, SQL BEGIN "GGS" .replicateSequence (TO_NUMBER(1386506), TO_NUMBER(0), TO_NUMBER(1), 'XSUP', TO_NUMBER(0), 'SEQ_SR_ACCESSNO', 'GGS', TO_NUMBER(2), TO_NUMBER (0), ''); END;].
2011-04-20 17:35:53 ERROR OGG-01668 Oracle GoldenGate Delivery for Oracle, rora01.prm: PROCESS ABENDING.

 

DETAILS

Implementing cyclic sequences:

 

NOTE: You must be logged in as SYSDBA to install sequence.sql 

 

 Note that steps 1-3 are required on BOTH source and target.

1. If  an OGG User for DDL replication has been created,  proceed to Step 2. Otherwise, create OGG user (say OGGADMIN). This should be the same Oracle user used for DDL replication. Connect as SYSDBA to the Oracle database

SQL> CREATE USER OGGADMIN IDENTIFIED BY ;
SQL> GRANT CONNECT,RESOURCE,DBA TO OGGADMIN;

2. Install the SQL procedures needed to support sequence replication

SQL> sequence.sql

When prompted for the user name, enter the appropriate OGG user (OGGADMIN in this case)

3. Grant appropriate privileges to GGSCI user

SQL> GRANT EXECUTE on OGGADMIN.updateSequence TO ggsciUser; (user used to
login to GGSCI)

At the Target Database:

1. Grant appropriate privileges to Oracle Golden Gate Replicat User

SQL> GRANT EXECUTE on OGGADMIN.replicateSequence TO replicateUser;

FIRST USE:
----------
Before  starting to replicate sequences,  the following steps must be performed at the source database. . In the following steps,  assume the extract name is EXT01

1. Connect to the source database

GGSCI> DBLOGIN userid Password:

2. Stop Extract, if it is running

GGSCI> STOP EXTRACT EXT01

3. Start Extract with appropriate parameter file that identifies thesequences to be replicated

GGSCI> START EXTRACT EXT01

4. Flush the sequences to be replicated using FLUSH SEQUENCE command in GGSCI
Example#1: To replicate all sequences contained in schemas HR and FINANCE

GGSCI> FLUSH SEQUENCE HR.*
GGSCI> FLUSH SEQUENCE FINANCE.*

Example#2 To replicate sequences for schemas HR.SEQ1 and HR.SEQ2

GGSCI> FLUSH SEQUENCE HR.SEQ1
GGSCI> FLUSH SEQUENCE HR.SEQ2

REFERENCES

BUG:11678726 - REPLICAT ABENDED WITH ORA-04002 FOR SEQUENCE WITH  NOCHECKSEQUENCEVALUE
BUG:11854609 - SEQUENCE SUPPORT DOCUMENTATION



Sequences will start to be maintained correctly once Extract has processed redo generated after the FLUSH SEQUENCE calls. 
At both Source and Target Database:

阅读(1878) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~