0

I am currently working on creating a database link to query data from an on-premises Oracle database. Although I have a working connection string, I don't have access to the server itself. When I attempt to query data from a table using the database link, I encounter the error ORA-28864. It appears this issue is due to the absence of the on-premises database wallet in my OCI environment. The question is: Is it possible to make it work event without the wallet?

First i tried to create it directly using

CREATE DATABASE LINK PRODATA
CONNECT TO user IDENTIFIED BY password
USING '(DESCRIPTION=
(ADDRESS=(PROTOCOL=TCP)(HOST=host)(PORT=port))
(CONNECT_DATA=
(SERVICE_NAME=service)
)';

This returned the error

ORA-013031: insufficient privileges

But I'm using the admin user, who theoretically has all the privileges.

Then I tried

BEGIN
DBMS_CLOUD_ADMIN.CREATE_DATABASE_LINK(
db_link_name => 'PRODATA',
hostname => host,
port => port,
service_name => service,
credential_name => 'PRODATA_CREDENTIALS',
ssl_server_cert_dn => NULL,
directory_name => NULL);
END;
/

It runs without any errors by when I query a table like

select usr_name from users@prodata; 

It returns the error

ORA-28864: SSL connection closed gracefully
4
  • I did it in the body of the question and the tag Commented May 15, 2024 at 17:21
  • should not have also "private_target => TRUE" in the CREATE_DATABASE_LINK params ? Commented May 15, 2024 at 18:48
  • @p3consulting private_target returns the error: ORA-20000: private_target => TRUE cannot be specified for a non-PE database when I execute the function Commented May 15, 2024 at 19:07
  • @PaulW I don't know how to quote by I said "It appears this issue is due to the absence of the on-premises database wallet in my OCI environment." and it is on the tags "oracle-cloud-infrastructure" Commented May 15, 2024 at 19:08

1 Answer 1

0

The docs suggest a wallet is required

https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/autonomous-database-links-target-oracle-db.html#GUID-A397B7E0-A1BE-4CBE-BA9E-F97EC6BF0415

but those same docs also show the instructions on how to upload an on-premises wallet into the object store, and then reference that from your cloud database.

CREATE DIRECTORY dblink_wallet_dir AS 'directory_path_of_your_choice';

BEGIN 
    DBMS_CLOUD.GET_OBJECT(
        credential_name => 'DEF_CRED_NAME',
        object_uri => 'https://objectstorage.us-phoenix-1.oraclecloud.com/n/namespace-string/b/bucketname/o/cwallet.sso',
        directory_name => 'DBLINK_WALLET_DIR'); 
END;
/

BEGIN
    DBMS_CLOUD.CREATE_CREDENTIAL(
        credential_name => 'DB_LINK_CRED',
        username => 'SCOTT',
        password => 'tiger');
END;
/

BEGIN
    DBMS_CLOUD_ADMIN.CREATE_DATABASE_LINK(
        db_link_name => 'SALESLINK',
        hostname => 'adb.eu-frankfurt-1.oraclecloud.com', 
        port => '1522',
        service_name => 'example_medium.adb.example.oraclecloud.com',
        ssl_server_cert_dn => 'CN=adb.example.oraclecloud.com,OU=Oracle BMCS FRANKFURT,O=Oracle Corporation,L=Redwood City,ST=California,C=US',
        credential_name => 'DB_LINK_CRED',
        directory_name => 'DBLINK_WALLET_DIR');
END;
/
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.