升級後步驟

瞭解不同升級案例的升級後作業。

在開始設定 Oracle GoldenGate 資料複製之前,您必須完成多個升級後步驟。這些任務包括:

升級活動訊號表

完成升級之後,請針對先前建立的任何來源和目標資料庫執行 UPGRADE HEARTBEATTABLE 命令,為表格和延遲檢視新增額外的資料欄。您可以使用這些額外資料欄來追蹤 Extract 重新啟動位置。請參閱 UPGRADE HEARTBEATTABLE ` 以瞭解詳細資訊。

PostgreSQL 版 Oracle GoldenGate 的升級擷取

來自 PostgreSQL 的 Oracle GoldenGate CDC Capture 支援需要使用 PostgreSQL 資料庫上的複製插槽來讀取 WAL 的變更記錄。每個「CDC 擷取」使用的複製槽位名稱取決於 Oracle GoldenGate 安裝路徑。

在升級後,您可能想要使用來自現有 Oracle GoldenGate 環境的相同 Extract,以繼續在新的 Oracle GoldenGate 環境中擷取變更記錄,儘管 Extract 在升級前尚未擷取變更記錄。不過,如果使用新的 Oracle GoldenGate 安裝目錄進行升級,就無法這麼做。您必須使用現有的 Oracle GoldenGate 安裝目錄,才能執行此作業。

若要升級舊版 Oracle GoldenGate 或從 Oracle GoldenGate Classic Architecture 移轉至 Microservices Architecture,請使用下列步驟:

注意:下列步驟使用 Extract 名稱 extn 作為範例。

  1. 取得舊環境中 Oracle GoldenGate CDC Extract 所使用的複製槽位名稱。您可以使用 Extract 報表檔案或執行 INFO EXTRACT 命令,取得舊的複製槽位名稱。

    從舊版 Oracle GoldenGate 環境中的 Extract 報表檔案。以下是 Extract 報表檔案的範例程式碼片段:

    2024-01-09 11:49:38  INFO    OGG-25376  Oracle GoldenGate capture 'EXTN' running with replication slot 'ext1_5d87a7db5e810943', slot type 'logical', plugin name
    as 'test_decoding' attached with database 'postgres' with slot restart LSN as '6/3CBFE2B8', flush LSN as '6/3CBFE2F0' and its current TXID as '7899713'.

    請注意 Extract 報表檔案中的複製槽位名稱。在此範例中,其為 extn_5d87a7db5e810943。

    您也可以在較舊的 Oracle GoldenGate 環境中,從 GGSCI 或「管理從屬端」執行 INFO EXTRACT 命令,如下列範例所示:

    GGSCI (phoenix96567 as postgres@pg12) 10> info extract extn

    輸出:

    Extract    EXT1      Last Started 2024-01-09 11:49   Status RUNNING
    Checkpoint Lag       00:00:45 (updated 00:00:01 ago)
    Process ID           3640439
    VAM Read Checkpoint  2024-01-09 11:48:52.575833
    Replication Slot     extn_5d87a7db5e810943 is active with PID 3640450 in database postgres
    Slot Restart LSN     6/3CBFE2B8
    Slot Flush LSN       6/3CBFE2F0
    Current Log Position 6/3CBFE2F0
  2. 取得與較新 Oracle GoldenGate 環境中之 Oracle GoldenGate CDC Extract 相關的複製槽位名稱。執行 UNREGISTER EXTRACT 命令以取得新的複製插槽名稱:

    unregister extract extn

    輸出:

    2024-01-09 11:43:37  INFO    OGG-25354  The replication slot 'extn_6ec0db7cc27c812' for group 'EXTN' does not exist in database 'postgres'.

    請注意錯誤訊息中的複製槽位名稱。在此範例中,其為 extn_6ec0db7cc27c812。

  3. 在對應的來源 PostgreSQL 資料庫上執行下列 SQL 查詢 (可使用 PSQL):

    SELECT * FROM pg_copy_logical_replication_slot('*old-replication-slot*', '*new-replication-slot*');

    舉例而言:

    SELECT * FROM pg_copy_logical_replication_slot('extn_5d87a7db5e810943', 'extn_6ec0db7cc27c812');
  4. 請務必將 Extract 檢查點檔案、歷程檔以及其他組態檔從舊的 Oracle GoldenGate 環境複製到新環境。

  5. 檢查並確認 new-replication-slot 的 LSN 貼文與 old-replication-slot 相同。

  6. 在舊的 Oracle GoldenGate 環境中執行 UNREGISTER EXTRACT extract_name 命令。舉例而言:

    UNREGISTER EXTRACT extn
  7. 在新的 Oracle GoldenGate 環境中啟動 Extract,以繼續擷取變更記錄。