Prerequisites for Database Links
from Autonomous Database to a Target Autonomous Database on a Private Endpoint
🔗
Lists the
prerequisites to create database links to a target Autonomous Database that is on a private endpoint.
To create a database link to a target Autonomous Database on a private endpoint:
The target database must be accessible from the source database's Oracle Cloud
Infrastructure VCN. For example, you can connect to the target database when:
The target database is on a private endpoint.
Both the source database and the target database are in the same Oracle Cloud
Infrastructure VCN.
The source database and the target database are in different Oracle Cloud
Infrastructure VCNs that are paired.
The target database is connected to the source database's Oracle Cloud
Infrastructure VCN using FastConnect or VPN.
For a target on a private endpoint, DBMS_CLOUD_ADMIN.CREATE_DATABASE_LINK
supports specifying a single hostname with the
hostname parameter. On a private endpoint,
using an IP address, SCAN IP, or a SCAN hostname is not supported
(when the target is on a public endpoint,
CREATE_DATABASE_LINK supports using an IP
address, a SCAN IP, or a SCAN hostname).
DBMS_CLOUD_ADMIN.CREATE_DATABASE_LINK does not support a
value of localhost for the hostname parameter.
The following ingress and egress rules must be defined for the private endpoint:
Define an egress rule in the source database's subnet security list or
network security group such that the traffic over TCP is allowed to the target
database's IP address and port number.
Define an ingress rule in the target database's subnet security list or
network security group such that the traffic over TCP is allowed from the source
database IP address to the destination port.
When your Autonomous Database instance is configured with a
private endpoint, set the ROUTE_OUTBOUND_CONNECTIONS database property to
'PRIVATE_ENDPOINT' to specify that all outgoing database links are
subject to the Autonomous Database instance
private endpoint VCN's egress rules. See Enhanced Security for Outbound Connections with Private Endpoints for more information.
Create Database Links to a Target
Autonomous Database on a Private Endpoint without a
Wallet (TLS)
🔗
You can
create database links from an Autonomous Database to a
target Autonomous Database that is on a private
endpoint and connect without a wallet (TLS).
Create credentials to access the target Autonomous Database instance. The username and password you
specify with DBMS_CLOUD.CREATE_CREDENTIAL are
the credentials for the target database used within the database link, (where the target
database is accessed through the VCN).
For a target on a private endpoint, DBMS_CLOUD_ADMIN.CREATE_DATABASE_LINK
supports specifying a single hostname with the
hostname parameter. On a private endpoint,
using an IP address, SCAN IP, or a SCAN hostname is not supported
(when the target is on a public endpoint,
CREATE_DATABASE_LINK supports using an IP
address, a SCAN IP, or a SCAN hostname).
Users other than ADMIN require
privileges to run DBMS_CLOUD_ADMIN.CREATE_DATABASE_LINK.
As shown in the example, to create a database link with DBMS_CLOUD_ADMIN.CREATE_DATABASE_LINK
to a target database on a private endpoint without a wallet, all of the following are
required:
The directory_name parameter must be NULL.
The ssl_server_cert_dn parameter can either be
omitted or if included, specify a NULL value.
Use the database link you created to access data in the target database.
For example:
SELECT * FROM employees@PRIVATE_ENDPOINT_LINK;
Note
For the credentials you create in
Step 1, the Oracle 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.
To create a database link to a target Autonomous Database on a private endpoint, with a wallet:
Copy your target database wallet, cwallet.sso, containing the
certificates for the target database to Object Store.
Note
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.
Create credentials to access your Object Store where you store the
cwallet.sso. See CREATE_CREDENTIAL Procedure for information about the username and password parameters for different
object storage services.
Create a directory on Autonomous Database for
the wallet file cwallet.sso.
For example:
CREATE DIRECTORY wallet_dir AS 'directory_path_of_your_choice';
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 Autonomous Database 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 used within the database link, (where the
target database is accessed through the VCN).
Note
Supplying the
credential_name parameter is required.
For a target on a private endpoint, DBMS_CLOUD_ADMIN.CREATE_DATABASE_LINK
supports specifying a single hostname with the
hostname parameter. On a private endpoint,
using an IP address, SCAN IP, or a SCAN hostname is not supported
(when the target is on a public endpoint,
CREATE_DATABASE_LINK supports using an IP
address, a SCAN IP, or a SCAN hostname).
DBMS_CLOUD_ADMIN.CREATE_DATABASE_LINK does not support a
value of localhost for the hostname parameter.
Users other than ADMIN require
privileges to run DBMS_CLOUD_ADMIN.CREATE_DATABASE_LINK.
Use the database link you created to access data in the target database.
For example:
SELECT * FROM employees@PEDBLINK1;
Note
For the credentials you create in
Step 5, the Oracle 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.