0

How can I create a database link from Oracle on PL/SQL to SQL Server based on this picture:

Example: the SQL Server installed in computer IP 190.168.0.1 and that computer user is MCHSQLSERVER password is 12345678 and the server name of SQL Server is DESTOP01 user of database is sa and password is 123123

enter image description here

Please help if any one know this.

1
  • Die you install and configure the heterogeneous services? See e.g. here Commented Jul 14, 2020 at 7:38

1 Answer 1

1

After configuring the heterogeneous services

CREATE DATABASE LINK DB_LINK_NAME
   CONNECT TO user_name 
   IDENTIFIED BY password
   USING '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Your_host_name_or_IP)(PORT=Your_port))(CONNECT_DATA(SID=Your_service_id))(HS=OK))';

If you want a public DB Link is quite similar just add the word public:

CREATE PUBLIC DATABASE LINK DB_LINK_NAME
   CONNECT TO user_name 
   IDENTIFIED BY password
   USING '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Your_host_name_or_IP)(PORT=Your_port))(CONNECT_DATA(SID=Your_service_id))(HS=OK))';

Access the remote table using:

select * from remote_table@DB_LINK_NAME;
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.