Create Database Links from Autonomous Database to a Publicly Accessible Autonomous Database without a Wallet (TLS)
🔗
You can
create database links from an Autonomous Database to a
publicly accessible Autonomous Database without a
wallet (TLS).
To create database links to a public target, the target database must be
accessible. Some databases, including Autonomous Databases, may limit access (for example, using Access Control Lists). Make sure you
enable your target database to allow access from your source database for the database link
to work. If you limit access with Access Control Lists (ACLs), you can find the outbound IP
address of your source Autonomous Database and
allow that IP address to connect to your target database. When the target database is
another Autonomous Database, you can add the
outbound IP address of the source database to the ACL of the target database.
On the Autonomous Database instance where you are
creating the database link, create credentials to access the target Autonomous Database. The username and
password you specify with DBMS_CLOUD.CREATE_CREDENTIAL are the credentials for the target
database (you use these credentials to create the database link).
Note
Supplying the
credential_name parameter is required.
To create a database link with DBMS_CLOUD_ADMIN.CREATE_DATABASE_LINK to a target Autonomous Database on a public endpoint using a
secure TCP connection without a wallet, the directory_name parameter
must be NULL.
The ssl_server_cert_dn parameter can either be omitted or
if included, specify a NULL value.
Users other than ADMIN require
privileges to run DBMS_CLOUD_ADMIN.CREATE_DATABASE_LINK.
Use the database link you created to access data on the target database.
For example:
SELECT * FROM employees@SALESLINK;
For the credentials you create in Step 1, the target database credentials,
if the password of the target user changes you can update the credential that contains the
target user's credentials as follows:
BEGIN
DBMS_CLOUD.UPDATE_CREDENTIAL (
credential_name => 'DB_LINK_CRED',
attribute => 'PASSWORD',
value => 'password' );
END;
/
Where password is the new
password.
After this operation, the existing database links that use this credential
continue to work without having to drop and recreate the database links.
Create Database Links from Autonomous Database to a Publicly Accessible Autonomous Database with a Wallet (mTLS)
🔗
You can to
create database links from an Autonomous Database to a
publicly accessible Autonomous Database with a wallet
(mTLS).
To create database links to a public target, the target database must be
accessible. Some databases, including Autonomous Databases, may limit access (for example, using Access Control Lists). Make sure you
enable your target database to allow access from your source database for the database link
to work. If you limit access with Access Control Lists (ACLs), you can find the outbound IP
address of your source Autonomous Database and
allow that IP address to connect to your target database. For example, if the target
database is another Autonomous Database, you can
add the outbound IP address of the source database to the ACL of the target database.
To create database links to a target Autonomous Database with a wallet (mTLS):
Copy your target database wallet, cwallet.sso, containing the
certificates for the target database to Object Store.
Note the following for the wallet file:
The wallet file, along with the Database user ID and password provide access to
data in the target Oracle Database. Store wallet files in a secure location. Share
wallet files only with authorized users.
Do not rename the wallet file. The wallet file in Object Storage must be named
cwallet.sso.
Create credentials to access your Object Store where you store the wallet file
cwallet.sso. See CREATE_CREDENTIAL Procedure for information about the username and password parameters for different
object storage services.
In this example, namespace-string is the Oracle
Cloud Infrastructure object storage namespace and
bucketname is the bucket
name. See Understanding
Object Storage Namespaces for more
information.
Note
The credential_name
you use in this step is the credentials for the Object Store. In the next step you
create the credentials to access the target database.
On the Autonomous Database instance, create
credentials to access the target database. The username and
password you specify with DBMS_CLOUD.CREATE_CREDENTIAL are the credentials for the target
database that you use to create the database link.
Note
Supplying the
credential_name parameter is required.
Users other than ADMIN require
privileges to run DBMS_CLOUD_ADMIN.CREATE_DATABASE_LINK.
If the wallet file in the directory specified with directory_name is
not cwallet.sso, the procedure reports an error such as:
ORA-28759: failure to open file.
Use the database link you created to access data on the target database.
For example:
SELECT * FROM employees@SALESLINK;
For the credentials you create in Step 5, the target database credentials, if the password
of the target user changes you can update the credential that contains the target user's
credentials as follows:
BEGIN
DBMS_CLOUD.UPDATE_CREDENTIAL (
credential_name => 'DB_LINK_CRED',
attribute => 'PASSWORD',
value => 'password' );
END;
/
Where password is the new
password.
After this operation, the existing database links that use this credential
continue to work without having to drop and recreate the database links.