設定 Oracle Autonomous AI Database 的擷取

以下為設定擷取自自治式 AI 資料庫的步驟:

  1. 為您的自治式 AI 資料庫執行處理安裝 Oracle GoldenGate。

  2. 建立 Oracle GoldenGate 環境的部署。這是將從自治式 AI 資料庫執行處理擷取資料的 Extract 所建立的部署。請參閱新增部署。

  3. 取得自治式 AI 資料庫從屬端證明資料。

    若要建立自治式 AI 資料庫執行處理連線,請下載從屬端證明資料檔案。若要下載從屬端證明資料,您可以使用 Oracle Cloud Infrastructure Console 或 Database Actions Launchpad。請參閱下載從屬端證明資料 (公事包) 。

注意:如果您沒有「自治式 AI 資料庫」的管理員存取權,請要求服務管理員下載並提供證明資料檔案給您。

下列步驟使用資料庫動作啟動畫面來下載從屬端證明資料。

  1. 登入您的自治式 AI 資料庫帳戶。

    a. 從資料庫執行處理頁面中,按一下資料庫動作。這會啟動「資料庫動作啟動畫面」。Launchpad 會嘗試以 ADMIN 身分登入資料庫。如果不成功,系統會提示您輸入資料庫 ADMIN 使用者名稱和密碼。

    b. 在資料庫動作啟動畫面的管理底下,按一下下載從屬端證明資料 (公事包) 。

    c. 輸入密碼來保護您的「從屬端證明資料」壓縮檔,然後按一下下載。

    注意:下載公事包時所提供的密碼會保護下載的「從屬端證明資料」公事包。

    d. 將證明資料 zip 檔案儲存至您的本機系統。

    The credentials `zip` file contains the following files:
    
    - `cwallet.sso`
    
    - `ewallet.p12`
    
    - `keystore.jks`
    
    - `ojdbc.properties`
    
    - `sqlnet.ora`
    
    - `tnsnames.ora`
    
    - `truststore.jks`
    
    - `ewallet.pem`
    
    - `README.txt`
    

    在設定使用自治式 AI 資料庫執行處理的 Oracle GoldenGate 時,請參閱並更新 (如有需要) sqlnet.ora 和 tnsnames.ora 檔案。

  2. 設定執行 Oracle GoldenGate 以連線至自治式 AI 資料庫執行處理的伺服器。

    a. 登入安裝 Oracle GoldenGate 的伺服器。

    b. 將您從 Autonomous AI Database 執行處理下載的證明資料 zip 檔案傳輸至 Oracle GoldenGate 伺服器。

    c. 在 Oracle GoldenGate 伺服器中,將證明資料檔案解壓縮至新目錄,例如:/u02/data/adwc_credentials。這是您的金鑰目錄。

    d. 若要設定連線詳細資訊,請從 Oracle GoldenGate 執行處理中的 Oracle 從屬端位置開啟您的 tnsnames.ora 檔案。

    e. 使用 LOW 用戶群組 dbname_low (例如 graphdb1_low) 的連線字串,並將其移至您的本機 tnsnames.ora 檔案。

     The connections for the default `ggadmin` user happens only with `low`, although `high` is used in the connection string, for example `graphdb1_high`.
    
     See *Local Naming Parameters in the tnsnames.ora File* chapter in the *Oracle AI Database Net Services Reference* guide.
    

    備註:

    隨證明資料檔案一起提供的檔案,包含三種可識別為下列的資料庫服務名稱:

    *ADWC_Database_Name*_low
    
    *ADWC_Database_Name*_medium
    
    *ADWC_Database_Name*_high

    Oracle 建議您搭配 Oracle GoldenGate 使用 ADWC_Database_Name_low。請參閱 Using Oracle Autonomous AI Database Serverless 指南中的 Predefined Database Service Names for Autonomous AI Database 或 Dedicated Exadata Infrastructure 文件上的 Autonomous AI Database Services Predefined Database Services 。

    f. 編輯 Oracle GoldenGate 執行處理中的 tnsnames.ora 檔案,以在您的金鑰目錄中包括 tnsnames.ora 檔案中可用的連線詳細資訊 (解壓縮自「自治式 AI 資料庫」下載之證明資料 zip 檔案的目錄)。

    <div class="infoboxnote" markdown="1">
    
    **Note:**
    Allows connections on ports 1521 and 1522. However, the Oracle GoldenGate connection only works with the port 1522. This is mandatory. If you use 1521, you get the following error:
    
       <pre class="copy"><code>Login failed. OCI Error ORA (status = 24459-ORA-24459: OCISessionGet() timed out waiting for pool to create new connections\n)&quot;, &quot;code&quot;: &quot;OGG-08110&quot;</code></pre>
    

    </div>

     <pre class="copy"><code> Sample Connection String   adw1_low. = (description=                  (retry_count=20)(retry_delay=3)                  (address=(protocol=tcps)(port=1522)(host=adb-preprod.us-phoenix-1.oraclecloud.com))                  (connect_data=(service_name=okd2ybgcz4mjx94_graphdb1_low.adb.oraclecloud.com))                  (security=(ssl_server_cert_dn=&quot;CN=adwc-preprod.uscom-east-1.oraclecloud.com,OU=Oracle BMCS US,O=Oracle Corporation,L=Redwood City,ST=California,C=US&quot;))                )</code></pre>
    
     If the database is within a firewall protected environment, you might not have direct access to the database. With an existing HTTP Proxy, you can pass the firewall with the following modifications to the `sqlnet.ora` and `tnsnames.ora`:
    
     - `sqlnet parameters`
    
     - `address modification of tns_alias`
    
     If Extract becomes unresponsive due to a network timeout or connection loss, then you can add the following into the connection profile in the `tnsnames.ora` file:
    
    (DESCRIPTION) = (RECV_TIMEOUT=30) (ADDRESS_LIST =
    
          (LOAD_BALANCE=off)(FAILOVER=on)(CONNECT_TIMEOUT=3)(RETRY_COUNT=3) (ADDRESS = (PROTOCOL = TCP)(HOST = adb-preprod.us-phoenix-1.oraclecloud.com)(PORT = 1522))

    g. 若要設定公事包,請在 Oracle GoldenGate 執行處理中的 Oracle 從屬端位置建立 sqlnet.ora 檔案。

    cd /u02/data/oci/network/admin
    ls
    sqlnet.ora tnsnames.ora
     See [Autonomous AI Database Client Credentials](/pls/topic/lookup?ctx=en/database/goldengate/core/26/coredoc&id=OGGMP-GUID-565DF23A-2E9D-4B57-B181-DC1165B31C97) in *Using Oracle GoldenGate on Oracle Cloud Marketplace*.
    

    h. 編輯此 sqlnet.ora 檔案以包含您的金鑰目錄。

     <pre class="copy"><code>WALLET_LOCATION = (SOURCE = (METHOD = file) (METHOD_DATA = (DIRECTORY=&quot;/u02/data/adwc_credentials&quot;))) SSL_SERVER_DN_MATCH=yes</code></pre>
    
  3. 視您是否使用 Microservices 而定,請使用「管理從屬端」登入 Oracle GoldenGate 部署。

  4. 建立證明資料以儲存 GGADMIN 使用者和密碼。此使用者將用來從命令行連線至自治式 AI 資料庫,以執行需要資料庫連線的命令。它也將用於 Extract 資料庫連線的 USERIDALIAS 參數中。

     ALTER CREDENTIALSTORE ADD USER
     ggadmin@dbgraph1_low PASSWORD complex_password alias adb_alias

    您也可以在連線字串中搭配使用下列命令與 high,但仍將與 low 連線:

     ALTER CREDENTIALSTORE ADD USER
     ggadmin@dbgraph1_high PASSWORD complex_password alias adb_alias
  5. 使用 DBLOGIN 連線至資料庫。DBLOGIN 使用者必須是 adb_alias 帳戶使用者。

     DBLOGIN USERIDALIAS adb_alias
  6. 在您要使用 ADD TRANDATA 或 ADD SCHEMATRANDATA 擷取的表格上設定補充日誌記錄。請記住,您是直接連線到資料庫執行處理,因此不需要在這些命令中包含資料庫名稱。以下是範例:

     ADD TRANDATA HR.EMP

    或

     ADD SCHEMATRANDATA HR

請參閱在 Oracle Autonomous AI Database for Oracle GoldenGate Extract 中啟用最低補充日誌記錄。

  1. 新增活動訊號表。

     ADD HEARTBEATTABLE
  2. 新增並設定擷取自自治式 AI 資料庫執行處理的 Extract。請參閱新增擷取以取得建立擷取的步驟。

Oracle GoldenGate Extract 是專為與自治式 AI 資料庫執行處理搭配運作而設計,可確保其僅從特定資料庫執行處理擷取。這表示任何 TABLE 或 MAP 敘述句都不需要資料庫執行處理名稱。

下列範例會建立名為 exte 的 Extract (從自治式 AI 資料庫擷取時需要),並指示現在開始。

<pre class="copy"><code>ADD EXTRACT exte, INTEGRATED TRANLOG, BEGIN NOW</code></pre>

若要擷取特定表格,請使用兩個零件物件名稱。例如,若要從 HR.EMP 表格擷取,請在您的「自治式 AI 資料庫」實例中,於「擷取」參數檔中使用此項目。

<pre class="copy"><code> TABLE HR.EMP;</code></pre>

如果您要將 HR.EMP 複製到 COUNTRY.EMPLOYEE,則您的地圖陳述式看起來會像這樣:

<pre class="copy"><code> MAP HR.EMP, TARGET COUNTRY.EMPLOYEE;</code></pre>
  1. 在自治式 AI 資料庫執行處理註冊 Extract。例如,若要註冊名為 exte 的 Extract,請使用下列命令:

     REGISTER EXTRACT exte DATABASE
  2. 您現在可以啟動 Extract 並對自治式 AI 資料庫執行處理執行資料複寫。以下為範例:

     START EXTRACT exte

    這完成了為自治式 AI 資料庫設定 Extract 的程序,您可以像任何其他 Extract 程序一樣使用它。