Create Database Links from Other Databases to Autonomous AI Database

You can create database links to an Autonomous AI Database from an Oracle database that is not an Autonomous AI Database. For example from an on-premise Oracle database to an Autonomous AI Database

Create Database Links from Other Databases to Autonomous AI Database without a Wallet

You can create database links to an Autonomous AI Database from an Oracle database that is not an Autonomous AI Database and connect without a wallet.

Note: This option is supported only when TLS is enabled on your Autonomous AI Database. For details on enabling TLS, see Update Network Options to Allow TLS or Require Only Mutual TLS (mTLS) Authentication on Autonomous AI Database.

To create database links to an Autonomous AI Database do the following:

  1. Set GLOBAL_NAMES to FALSE.

    SQL> ALTER SYSTEM SET GLOBAL_NAMES = FALSE;
    
    System altered.
    
    SQL> SHOW PARAMETER GLOBAL_NAMES
    NAME                     TYPE        VALUE
    
    ----------------------   ----------- -----------
    global_names             boolean     FALSE

    Set GLOBAL_NAMES to FALSE to use a database link name without checking that the name is different than the remote database name.When GLOBAL_NAMES, is set to TRUE, the database requires the database link to have the same name as the database to which it connects. See GLOBAL_NAMES for more information.

  2. Create the database link to the target Autonomous AI Database. Note that the security path includes my_wallet_directory; the path where you unzip the Autonomous AI Database wallet.

    CREATE DATABASE LINK ADBLINK
       CONNECT TO NAME1 IDENTIFIED BY ************
       USING
    '(description=(retry_count=20)(retry_delay=3)
         (address=(protocol=tcps)(port=1521)(host=example1.oraclecloud.com))
         (connect_data=(service_name=example2_high.adb.oraclecloud.com))
         (security=(my_wallet_directory=/u01/targetwallet)
            (ssl_server_dn_match=true)))';
    
    Database link created.
  3. Use the database link you created to access data on the target database (your Autonomous AI Database instance in this case):

    For example:

    SELECT * FROM employees@ADBLINK;

To list the database links, use the ALL_DB_LINKS view. See ALL_DB_LINKS for more information.

For additional information, see:

Create Database Links from Other Databases to Autonomous AI Database with a Wallet

You can create database links to an Autonomous AI Database from an Oracle database that is not an Autonomous AI Database. For example from an on-premise Oracle database to an Autonomous AI Database.

To create database links to an Autonomous AI Database do the following:

  1. Download your Autonomous AI Database wallet. See Download Client Credentials (Wallets) for more information.

  2. Upload the wallet to the database instance where you want to create the link to the Autonomous AI Database.

  3. Unzip the Autonomous AI Database wallet:

Note: The wallet file, along with the Database user ID and password provide access to data in your Autonomous AI Database. Store wallet files in a secure location. Share wallet files only with authorized users.

  [oracle@sys1 ~]$ cd/u01/targetwallet
  [oracle@sys1 targetwallet]$ unzip Wallet_name1.zip
          Archive: Wallet_name1.zip
            inflating: cwallet.sso
            inflating: tnsnames.ora
            inflating: truststore.jks
            inflating: ojdbc.properties
            inflating: sqlnet.ora
            inflating: ewallet.p12
            inflating: keystore.jks
  1. Set GLOBAL_NAMES to FALSE.

    SQL> ALTER SYSTEM SET GLOBAL_NAMES = FALSE;
    
    System altered.
    
    SQL> SHOW PARAMETER GLOBAL_NAMES
    NAME                     TYPE        VALUE
    
    ----------------------   ----------- -----------
    global_names             boolean     FALSE

    Set GLOBAL_NAMES to FALSE to use a database link name without checking that the name is different than the remote database name.When GLOBAL_NAMES, is set to TRUE, the database requires the database link to have the same name as the database to which it connects. See GLOBAL_NAMES for more information.

  2. Create the database link to the target Autonomous AI Database. Note that the security path includes my_wallet_directory; the path where you unzip the Autonomous AI Database wallet.

    CREATE DATABASE LINK ADBLINK
       CONNECT TO NAME1 IDENTIFIED BY ************
       USING
    '(description=(retry_count=20)(retry_delay=3)
         (address=(protocol=tcps)(port=1522)(host=example1.oraclecloud.com))
         (connect_data=(service_name=example2_high.adb.oraclecloud.com))
         (security=(my_wallet_directory=/u01/targetwallet)
            (ssl_server_dn_match=true)))';
    
    Database link created.
  3. Use the database link you created to access data on the target database (your Autonomous AI Database instance in this case):

    For example:

    SELECT * FROM employees@ADBLINK;

To list the database links, use the ALL_DB_LINKS view. See ALL_DB_LINKS for more information.

For additional information, see: