-2

How to create database link between three instances? For eg i have database named orcl,orcl1,orcl2 how to link them? Thanks

2
  • 1
    It's too broad question. Can you describe what you are actually want to achieve as how to create database link really easy to find out from Oracle docs Commented May 10, 2018 at 14:45
  • It's not much complexity to find out on google, but still, I have posted an answer below you can check out. :) Commented May 10, 2018 at 15:23

1 Answer 1

1

These are the below SQL that might be helpful to you :)

At database ORCL:

CREATE DATABASE LINK db_link_orcl1
CONNECT TO orcl1_user_name IDENTIFIED BY orcl1_user_password 
USING 'localhost:1521/orcl1';

CREATE DATABASE LINK db_link_orcl2
CONNECT TO orcl2_user_name IDENTIFIED BY orcl2_user_password 
USING 'localhost:1521/orcl2';

At database ORCL1:

CREATE DATABASE LINK db_link_orcl
CONNECT TO orcl_user_name IDENTIFIED BY orcl_user_password 
USING 'localhost:1521/orcl';

CREATE DATABASE LINK db_link_orc2
CONNECT TO orcl2_user_name IDENTIFIED BY orcl2_user_password 
USING 'localhost:1521/orcl2';

At database ORCL2:

CREATE DATABASE LINK db_link_orcl
CONNECT TO orcl_user_name IDENTIFIED BY orcl_user_password 
USING 'localhost:1521/orcl';

CREATE DATABASE LINK db_link_orcl1
CONNECT TO orcl1_user_name IDENTIFIED BY orcl1_user_password 
USING 'localhost:1521/orcl1';
Sign up to request clarification or add additional context in comments.

2 Comments

can i get to know how to create a view for these tables as i am a student and have no idea about sql
Create or replace view view_name as select * from table_name@db_link_name; That’s all

Your Answer

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