Database link

From Oracle FAQ

Jump to: navigation, search

A database link (DBlink) is a definition of how to establish a connection from one Oracle database to another.

The following link types are supported:

  • Private database link - belongs to a specific schema of a database. Only the owner of a private database link can use it.
  • Public database link - all users in the database can use it.
  • Global database link - defined in an OID or Oracle Names Server. Anyone on the network can use it.

[edit] Create and drop

Create a DBlink:

CREATE DATABASE LINK remotedb CONNECT TO scott IDENTIFIED BY tiger USING 'tns_conn_str';

Drop a DBlink:

DROP DATABASE LINK remotedb;

[edit] Close Database Link

To close a DBlink:

ALTER SESSION CLOSE DATABASE LINK <link_name>;
Personal tools