Pages

Wednesday, March 19, 2014

How to create database link in oracle

What is database link?

A database link is a schema object in one database that enables you to access objects on another database. The other database need not be an Oracle Database system. 

How to create a database link in Oracle? 

To create database link you must specify the database link name, the remote user to connect to, the password for the remote user and the TNS service name for the database link connection. Below are the command to create database link in oracle.

create public database link mylink connect to remote_username identified by mypassword using 'tns_service_name';

How to access object in database link

To access object in database link you can use @link_name as query below :

SELECT * FROM employees@local;

for more information about oracle database link, you can find in oracle docs page

 

No comments:

Post a Comment

Don't Forget To Join Our Community
×
Widget