Search code examples
databaseoracleplsqldblinkoracle-cloud-infrastructure

DB link not working in DBaaS but working in On premise Database


I am using below command to create DB link

CREATE  DATABASE LINK Dblink_test2
  CONNECT TO apps IDENTIFIED BY xyzabc
  USING '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=awss007.us.dell.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=xxxmm122de)))';

The DB link got created successfully and it is returning data when I am creating it in on premise database.

But when I am doing same in my Dbaas ,DB link is getting created but when I am running query I am getting below error.

select * from emp@Dblink_test2;

enter image description here

table is there. Same is working when I am creating DB link in on premise database.

Issue is coming when local environment is DBaas and Remote is On premise Database.

Could you please help me on the same?


Solution

  • I replaced hostname by IP address and it worked successfully.

    CREATE  DATABASE LINK Dblink_test2
      CONNECT TO apps IDENTIFIED BY xyzabc
      USING '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.32.33.22)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=oam122de)))';
    

    The above one is working fine.