OGG 複製程式拆分

huzhichengforce發表於2014-07-03
需求:OGG 原來將很多表放到一個複製程式的引數檔案裡面了需要進行細分把一部分表  劃分出來用另外一個程式管理。
原來的複製程式引數檔案如下:

黑色框出部門為我們需要拆分出來的表:
步驟:
1、停止replicat 程式
stop replicat_name
2、檢視檢查點記錄下Sequence 和RBA 留做後用
GGSCI (og2) 23> info replgg,showch
REPLICAT   REPLGG    Last Started 2014-07-02 20:26   Status STOPPED
Checkpoint Lag       00:00:00 (updated 00:03:01 ago)
Log Read Checkpoint  File /u01/ogg/dirdat/kt000037
                     2014-07-02 20:30:22.699200  RBA 1883
Current Checkpoint Detail:
Read Checkpoint #1
  GGS Log Trail
  Startup Checkpoint (starting position in the data source):
    Sequence #: 35
    RBA: 8430
    Timestamp: 2014-07-02 20:25:05.842502
    Extract Trail: /u01/ogg/dirdat/kt
  Current Checkpoint (position of last record read in the data source):
    Sequence #: 37 
    RBA: 1883
  -------RBASequence
    Timestamp: 2014-07-02 20:30:22.699200
    Extract Trail: /u01/ogg/dirdat/kt
CSN state information:
  CRC: 33-3D-71-BC
  Latest CSN: 2736049
  Latest TXN: 1.20.1420
  Latest CSN of finished TXNs: 2736049
  Completed TXNs: 1.20.1420
Header:
  Version = 2
  Record Source = A
  Type = 1
  # Input Checkpoints = 1
  # Output Checkpoints = 0
File Information:
  Block Size = 2048
  Max Blocks = 100
  Record Length = 2048
  Current Offset = 0
Configuration:
  Data Source = 0
  Transaction Integrity = -1
  Task Type = 0
Database Checkpoint:
  Checkpoint table = regg.chkpoint
  Key = 3537550738 (0xd2dabd92)
  Create Time = 2014-05-22 23:49:29
Status:
  Start Time = 2014-07-02 20:26:44
  Last Update Time = 2014-07-04 00:36:42
  Stop Status = G
  Last Result = 400
3、將原來的引數檔案中的兩張表刪除:
4、增加新的複製程式名稱為replggg
GGSCI (og2) 26> edit params replggg
引數如下:
replicat replggg
HANDLECOLLISIONS
ASSUMETARGETDEFS
GETTRUNCATES
GROUPTRANSOPS 100
REPORT AT 0:00
ALLOWNOOPUPDATES
ddlerror default ignore retryop maxretries 3 retrydelay 5
USERID regg , PASSWORD regg
DISCARDFILE ./dirrpt/RINIaa.dsc, PURGE
DECRYPTTRAIL AES192 KEYNAME mykey2
map gg.col,target regg.col;
map ggdl.tes,target ggdl.tes;

GGSCI (og2) 27> ADD REPLICAT replggg, EXTTRAIL /u01/ogg/dirdat/kt checkpointtable regg.chkpoint---------這裡的trial 檔案就是原來的trial 檔案檢測表用你原來的檢測表就行
REPLICAT added.
5、檢視新增是否成功
GGSCI (og2) 28> info all
Program     Status      Group       Lag at Chkpt  Time Since Chkpt
MANAGER     RUNNING                                           
REPLICAT    STOPPED     REPLGG      00:00:00      00:07:53    
REPLICAT    STOPPED     REPLGGG     00:00:00      00:00:03    
6、修改檢查點用到剛才的Sequence 和RBA
GGSCI (og2) 29> alter replggg extseqno 37, extrba 1883
REPLICAT altered.
7、啟動程式
start replggg

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26764973/viewspace-1208553/,如需轉載,請註明出處,否則將追究法律責任。

相關文章