Oracle Database Link

In distributed Oracle environments, database links can be used to define a communications path between two databases. A database link defines a network connection, and, optionally, a username and password, to use when Oracle accesses and establishes a database session in the remote database on behalf of the local application request.

Database link enable SQL statements to be isolated from the underlying physical network topology. Thus, whenever the location of a remote database changes, only the link need be updated, and not each and every SQL queries, significantly the tasks of programmer.

Oracle database link is defined in a specific database, and may be used only by users of that database. If the same database link name was to be used from all databases in the network, the links must be defined identically with that name in each of each databases. For this scenario, the easier way is to be global database link.

Database Link Creation

Login into Oracle database (with SQL*Plus, for example) as a user who has the privilege to create a database link and execute the following command:

CREATE DATABASE LINK link_name
CONNECT TO user_name IDENTIFIED BY password
USING ‘connection_string’;

where connection_string is an entry is tnsnames.ora (usually located in $ORACLE_HOME/network/admin), which enables the Oracle to know the network path to remote database.

connection_string has the following structure:

(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP) (Host = host_name/ip_address) (Port = 1521)
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = database_name)
)
)

Database Link Deletion

To delete a database link:

DROP DATBASE LINK link_name;


One Response to “Oracle Database Link”

  1. Ru
    June 6th, 2008 05:19
    1

    Need help :
    I want to access my SQL server 2005 database from Oracle 10G, but I have a problem. Could you guide me how to do it?
    Thank you

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. To receive notification of latest comments posted, subscribe to My Digital Life Comments RSS feed or register to receive new comments in daily email digest.
Custom Search

New Articles

Incoming Search Terms for the Article

oracle dblink example - delete db link - oracle link - link between rid and oracle - command to drop dblink - db link creation - disconect dblink syntax - database link creation in oracle - how to delete db link - oracle dblink tutorial - oracle drop DB LINK - oracle link$ - ORA-00905 + database link - oracle delete all db links - create database link oracle address - database link oracle address - excluir db_links oracle - forcefully delete dblink in oracle8i - oracle - create database link example - oracle + how to create link between two databases - Oracle DB_LINK port - "delete database link" - create database link oracle example - db_link oracle example - define database link in oracle - excluir dblink oracle - oracle dblink - oracle dblink table - oracle create database link examples - remove dblink - dblink oracle protocol - Disable dblink - how to reset the dblink password + oracle - oracle disconnect dblink - sql command to create database link - SQL command for create database link - dblink versions oracle - dblink example in oracle - deleting Oracle dblink - disable db link oracle - oracle delete db link - remove a dblink - where to create dblink to connect two db - db link creation in oracle with examples - dblink oracle - oracle db link disable - oracle remove database link - oracle database link description - oracle db_link commands - COMMAND TO CREATE DATABASE LINK -