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
-
Supported Oracle AI Database versions for database links where the source is an Oracle AI Database and the target is an Autonomous AI Database instance are: 19.2 (or later), 21 (base release or later).
-
If you are using database links between Autonomous AI Database and other Oracle AI Databases, you might need to apply Patch 33843368 on the Oracle AI Database that is not an Autonomous AI Database. This applies to cases where the Autonomous AI Database instance is either the source or the target of the database link.
See My Oracle Support Knowledge Base: Patch Requirement For Database Links Between ADB-S And Other Oracle AI Databases(Doc ID 2874244.1) for further details.
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:
-
Set
GLOBAL_NAMEStoFALSE.SQL> ALTER SYSTEM SET GLOBAL_NAMES = FALSE; System altered. SQL> SHOW PARAMETER GLOBAL_NAMES NAME TYPE VALUE ---------------------- ----------- ----------- global_names boolean FALSESet
GLOBAL_NAMEStoFALSEto use a database link name without checking that the name is different than the remote database name.WhenGLOBAL_NAMES, is set toTRUE, the database requires the database link to have the same name as the database to which it connects. See GLOBAL_NAMES for more information. -
Create the database link to the target Autonomous AI Database. Note that the
securitypath includesmy_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. -
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:
-
See CREATE DATABASE LINK for details on the procedure.
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:
-
Download your Autonomous AI Database wallet. See Download Client Credentials (Wallets) for more information.
-
Upload the wallet to the database instance where you want to create the link to the Autonomous AI Database.
-
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
-
Set
GLOBAL_NAMEStoFALSE.SQL> ALTER SYSTEM SET GLOBAL_NAMES = FALSE; System altered. SQL> SHOW PARAMETER GLOBAL_NAMES NAME TYPE VALUE ---------------------- ----------- ----------- global_names boolean FALSESet
GLOBAL_NAMEStoFALSEto use a database link name without checking that the name is different than the remote database name.WhenGLOBAL_NAMES, is set toTRUE, the database requires the database link to have the same name as the database to which it connects. See GLOBAL_NAMES for more information. -
Create the database link to the target Autonomous AI Database. Note that the
securitypath includesmy_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. -
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:
-
See CREATE DATABASE LINK for details on the procedure.