How to create an Oracle DB link ?

From a database X, we wish to display a view located in another database Y.

In the Y database:

CREATE OR REPLACE FORCE EDITIONABLE VIEW "MY_VIEW" ("CustomerName", "ContactName") AS 
  SELECT 
    C.CUSTOMERNAME AS CustomerName,
    C.CONTACTNAME AS ContactName
  FROM
    CUSTOMER C;

In the X database:

CREATE PUBLIC DATABASE LINK MY_DB_LINK_TO_Y CONNECT TO <remoteuser> IDENTIFIED BY "<password>" USING 'db_y.domain.lan:1521/<SID>';

Access the remote view through the DB link :

select * from <myschema>."MY_VIEW" @MY_DB_LINK_TO_Y;



    Enjoy Reading This Article?

    Here are some more articles you might like to read next:

  • KafkaConnect Oracle configuration
  • KafkaConnect PostgreSQL configuration
  • KafkaConnect SQL Server configuration
  • KafkaConnect MariaDB configuration
  • access a kafka topic with kafka-console-consumer