Database link from Local Oracle 11g to Oracle Database Cloud Service 11g

database-linkoracleoracle-11g

We are using Oracle database from Oracle Database Cloud Service,
now we are not able to connect Cloud db from Local oracle db.

Somehow we created link using below commnd,

CREATE DATABASE LINK link_1 CONNECT TO "username" 
IDENTIFIED BY "password" USING 'https://x.x.x.oraclecloudapps.com/apex/';

Now once i execute query select * from EMP@link_1 It throws an error

ORA-12154: TNS:could not resolve the connect identifier specified
12154. 00000 -  "TNS:could not resolve the connect identifier specified"

with Cause and Actions.

Let me know if some additional configuration/changes required.

Best Answer

That is not how you connect to another database through database links. Database links require SQL*Net connectivity, not HTTP(S).

First you need to enable access, then you can connect using the address of the compute node and the service name for your database.

http://docs.oracle.com/cloud/latest/dbcs_dbaas/CSDBI/GUID-372D4233-9793-47EC-8DFC-AFD6CF32866C.htm#CSDBI3449