OGG 11g Checkpoint 詳解

張衝andy發表於2017-03-05
OGG Checkpoint 詳解

定位中斷的位置,下次啟動從中斷的位置開始恢復。


1.target  端配置;
2.一條記錄對應一個replicat

一. Extract Checkpoints
 (1) Extract read checkpoints
         (1) Startup checkpoint   --ogg啟動的時候建立
          當Extract 程式啟動的時候,會建立startup checkpoint,用來記錄此時record的相關資訊。該     checkpoint    是第一個checkpoint。
          startup checkpoint的統計資訊包含如下內容:
        (1) Thread #: 建立checkpoint 的thread編號。
        (2) Sequence #:建立checkpoint 時對應的sequence 號碼。  --list archive log;
        (3) RBA: 建立checkpoint 時,redo log 裡面record 的relative byte address。
        (4)Timestamp:  建立checkpoint 時record對應的timestamp。
        (5)SCN: 建立checkpoint 時 record 對應的system change number 。
        (6)Redo File: 建立checkpoint 時record對應的事務日誌路徑。

 2 ) Recovery checkpoint
      recover checkpoint 記錄的是data source(online redo log 或者歸檔中)中Extract 最久沒處理的record的位置。 該checkpoint 的統計資訊和startup checkpoint一樣。

3) Current checkpoint
current checkpoint 是data source中Extract 最後一次讀取的record的位置。


GGSCI (ogg02) 4>  info ext1

EXTRACT    EXT1      Last Started 2014-12-27 17:42   Status RUNNING
Checkpoint Lag          00:00:00 (updated 00:00:04 ago)
Process ID                31621
Log Read Checkpoint  Oracle Redo Logs
                     2014-12-27 18:06:05  Seqno 15, RBA 18128896
                     SCN 0.1142344 (1142344)

Seqno  和 RBA  會變,說明ogg是在工作的。

GGSCI (ogg02) 5>  info ext1,showch

EXTRACT    EXT1      Last Started 2014-12-27 17:42   Status RUNNING
Checkpoint Lag       00:00:00 (updated 00:00:00 ago)
Process ID           31621
Log Read Checkpoint  Oracle Redo Logs
                     2014-12-27 18:11:06  Seqno 15, RBA 18188800
                     SCN 0.1142472 (1142472)


Current Checkpoint Detail:

Read Checkpoint #1

  Oracle Redo Log

  Startup Checkpoint (starting position in the data source):
    Thread #: 1
    Sequence #: 11
    RBA: 7646224
    Timestamp: 2014-12-27 16:20:48.000000
    SCN: 0.1136079 (1136079)
    Redo File: /oradata/ogg02/redo02.log

  Recovery Checkpoint (position of oldest unprocessed transaction in the data source):
    Thread #: 1
    Sequence #: 15
    RBA: 18187792
    Timestamp: 2014-12-27 18:09:41.000000
    SCN: 0.1142443 (1142443)
    Redo File: /oradata/ogg02/redo03.log

  Current Checkpoint (position of last record read in the data source):
    Thread #: 1
    Sequence #: 15
    RBA: 18188800
    Timestamp: 2014-12-27 18:11:06.000000
    SCN: 0.1142472 (1142472)
    Redo File: /oradata/ogg02/redo03.log

Write Checkpoint #1

  GGS Log Trail

  Current Checkpoint (current write position):
    Sequence #: 4
    RBA: 1755
    Timestamp: 2014-12-27 18:11:43.251745
    Extract Trail: /u01/zt/dirdat/lt
    Trail Type: RMTTRAIL

Header:
  Version = 2
  Record Source = A
  Type = 10
  # Input Checkpoints = 1
  # Output Checkpoints = 1

File Information:
  Block Size = 2048
  Max Blocks = 100
  Record Length = 2048
  Current Offset = 0

Configuration:
  Data Source = 3
  Transaction Integrity = 1
  Task Type = 0

Status:
  Start Time = 2014-12-27 17:42:32
  Last Update Time = 2014-12-27 18:11:43
  Stop Status = A
  Last Result = 400

二.Extract write checkpoints

該checkpoint包含如下資訊:
(1)Sequence #: checkpoint 正在寫的trail 檔案的序列號。
(2)RBA: 建立checkpoint 時trail檔案裡record 的relative byte address。
(3)Timestamp: 建立checkpoint 時record對應的timestamp。
(4)Extract trail: trail 檔案的路徑。
(5)Trail Type: 標識trail 檔案型別。有2個值:
EXTTRAIL:表示該trail 是本地的trail,檔案由OGG程式直接寫如本地disk。
RMTTRAIL:表示是遠端的trail,該檔案不會寫入本地的磁碟,而是傳到遠端的的OGG上,在有遠端OGG的collector 程式寫disk。 
比如pump 程式,裡面就會寫RMTTRAIL。

-----------------------------------------------------------------------------------------
target 端

GGSCI (ogg04) 1>  info rep1

REPLICAT   REP1      Last Started 2014-12-27 14:07   Status RUNNING
Checkpoint Lag         00:00:00 (updated 00:00:01 ago)
Process ID               26088
Log Read Checkpoint  File /u01/zt/dirdat/lt000004
                     2014-12-27 16:49:03.408880  RBA 1755


GGSCI (ogg04) 2>  info rep1,showch

REPLICAT   REP1      Last Started 2014-12-27 14:07   Status RUNNING
Checkpoint Lag         00:00:00 (updated 00:00:07 ago)
Process ID               26088
Log Read Checkpoint  File /u01/zt/dirdat/lt000004
                     2014-12-27 16:49:03.408880  RBA 1755


Current Checkpoint Detail:

Read Checkpoint #1

  GGS Log Trail

  Startup Checkpoint (starting position in the data source):
    Sequence #: 3
    RBA: 20259
    Timestamp: 2014-12-27 14:06:57.000000
    Extract Trail: /u01/zt/dirdat/lt

  Current Checkpoint (position of last record read in the data source):  --最後一次讀取檔案的位置
    Sequence #: 4
    RBA: 1755
    Timestamp: 2014-12-27 16:49:03.408880
    Extract Trail: /u01/zt/dirdat/lt

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 = ggs.checkpoint
  Key = 982417365 (0x3a8e7fd5)
  Create Time = 2014-12-27 10:46:19

Status:
  Start Time = 2014-12-27 14:07:31
  Last Update Time = 2014-12-27 17:03:30
  Stop Status = A
  Last Result = 400

 GGSCI (ogg04) 3> info rep1    --看rba是否有變化
 
REPLICAT   REP1      Last Started 2014-12-27 14:07   Status RUNNING
Checkpoint Lag       00:00:00 (updated 00:00:08 ago)
Process ID             26088
Log Read Checkpoint  File /us01/zt/dirdat/lt000004
 2014-12-27 16:49:03.408880   RBA 1755

----------------------------------------------------------------------
停的時候確保兩邊都事物都提交了。 info 一下看看
 ②. data dump程式:將佇列資料傳送到目標 
 好處:① .預防網路和源庫的故障;
           ②. 可以對資料進行過來和轉換;
           ③.synchronize方式從多個源庫上合併資料到一箇中心庫;
           ④. synchronize方式將一個源庫資料傳到多個目標庫;



轉:http://blog.csdn.net/zhengwei125/article/details/46503403

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

相關文章