Autonomous database - database link

Quick notes on creating a database link in an autonomous database.

Please note, 1521/tcp can be used for the connection and a tcps connection is only needed for a connection to a database with a public endpoint. Spent an ages trying to setup a tcps connection using a wallet (battle for another day) when figured 1521 would suffice. On searching the web, lots of sites mentioning tcps but for the database I was connecting to 1521 worked fine. Just create the credential and the link. 

BEGIN
DBMS_CLOUD.CREATE_CREDENTIAL(
credential_name => 'TEST_CRED',
username => 'TESTUSER',
password => 'pass123'
);
END;

BEGIN
DBMS_CLOUD_ADMIN.CREATE_DATABASE_LINK(
db_link_name => 'TEST_LINK',
hostname => 'test-dbs.oci.test.co.uk',
port => '1521',
service_name => ''test2.s003.ldntiertest.oraclevcn.com,
ssl_server_cert_dn => NULL,
credential_name => 'TEST_CRED',
directory_name => NULL,
public_link => TRUE,
private_target => TRUE);
END;

No comments:

Post a Comment