为 Oracle Autonomous AI Database 配置提取

以下是配置提取以从自治 AI 数据库捕获的步骤:

  1. 为自治 AI 数据库实例安装 Oracle GoldenGate。

  2. 为 Oracle GoldenGate 环境创建部署。这是用于从自治 AI 数据库实例中获取数据的提取的部署。请参见 Add a Deployment 。

  3. 获取自治 AI 数据库客户端身份证明。

    要建立与自治 AI 数据库实例的连接,请下载客户端身份证明文件。要下载客户端身份证明,可以使用 Oracle Cloud Infrastructure Console 或 Database Actions 启动板。请参见 Downloading Client Credentials (Wallets) 。

注:如果您对自治 AI 数据库没有管理员访问权限,则应让服务管理员下载身份证明文件并向您提供这些文件。

以下步骤使用数据库操作快速启动板下载客户端身份证明。

  1. 登录到自治 AI 数据库账户。

    a. 从数据库实例页中,单击数据库操作。这将启动“Database Actions(数据库操作)”启动板。Launchpad 尝试以 ADMIN 身份将您登录到数据库。如果不成功,系统会提示您输入数据库 ADMIN 用户名和口令。

    b. 在 Database Actions(数据库操作)启动板上的 Administration(管理)下,单击 Download Client Credentials (Wallets)(下载客户端身份证明 (Wallet))。

    c. 输入用于保护客户端身份证明 zip 文件的密码,然后单击下载。

    注:下载 wallet 时提供的密码可保护下载的客户端身份证明 wallet。

    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`
    

    在配置 Oracle GoldenGate 以使用自治 AI 数据库实例时,请参阅并更新 sqlnet.ora 和 tnsnames.ora 文件(如果需要)。

  2. 配置运行 Oracle GoldenGate 的服务器以连接到自治 AI 数据库实例。

    a. 登录到安装了 Oracle GoldenGate 的服务器。

    b. 将从自治 AI 数据库实例下载的身份证明 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 建议您将 ADWC_Database_Name_low 与 Oracle GoldenGate 一起使用。请参阅 Using Oracle Autonomous AI Database Serverless 指南中的 Predefined Database Service Names for Autonomous AI Database 或 Autonomous AI Database on Dedicated Exadata Infrastructure 文档中的 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。要配置 wallet,请在 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. 使用管理客户端登录 Oracle GoldenGate 部署,具体取决于您是否使用微服务。

  4. 创建用于存储 GGADMIN 用户和口令的身份证明。此用户将用于从命令行连接到自治 AI 数据库,以执行需要数据库连接的命令。它还将在用于提取数据库连接的 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 对要捕获的表配置补充日志记录。请记住,您已直接连接到数据库实例,因此无需在这些命令中包括数据库名称。下面是一个 exmaple:

     ADD TRANDATA HR.EMP

    或者

     ADD SCHEMATRANDATA HR

请参阅 Enable Minimal Supplemental Logging in Oracle Autonomous AI Database for Oracle GoldenGate Extract 。

  1. 添加脉动表

     ADD HEARTBEATTABLE
  2. 添加和配置要从自治 AI 数据库实例捕获的提取。有关创建提取的步骤,请参阅添加提取。

Oracle GoldenGate Extract 旨在与自治 AI 数据库实例配合使用,以确保仅从特定数据库实例捕获。这意味着任何 TABLE 或 MAP 语句都不需要数据库实例名称。

以下示例创建名为 exte 的提取(从自治 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 数据库实例中注册提取。例如,要注册名为 exte 的提取,请使用以下命令:

     REGISTER EXTRACT exte DATABASE
  2. 现在,您可以启动提取并执行到自治 AI 数据库实例的数据复制。下面是一个示例:

     START EXTRACT exte

    这将完成为自治 AI 数据库配置提取的过程,您可以像任何其他提取过程一样使用它。