469,301 Members | 2,272 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Share your developer knowledge by writing an article on Bytes.

Oracle Database Links (DB Link)

debasisdas
8,127 Expert 4TB
DATABASE LINK
===============
A database link is a path through which a remote user in another database can connect to any other database. Once created database link exists as an object in the user schema.

DATABASE LINK -3 TYPES
=======================
PRIVATE--DEFAULT--A PRIVATE DBLINK IS ONLY AVAILABLE TO THE USER WHO HAS CREATED IT.IT IS NOT POSSIBLE FOR A USER TO GRANT ACCESS ON A PRIVATE DBLINK TO OTHER USERS.
-------
PUBLIC--IT IS AVAILABLE TO ALL THE USERS.
-------
SHARED--SHARED DATABASE LINK USES SHARED SERVER CONNECTION TO SUPPORT DATABASE LINK CONNECTION. IF THERE ARE MULTIPLE CONCURRENT DATABASE LINK ACCESS INTO A REMOTE DATABASE, SHARED DATABASE LINK CAN BE USED TO REDUCE THE NO OF SERVER CONNECTIONS REQUIRED. WITHOUT THE SHARED CLAUSE EACH DATABASE LINK CONNECTION REQUIRES A SEPARATE CONNECTION TO THE REMOTE DATABASE.

In dblink we can use 2 types of login.
-------------------------------------------------------
1.DEFAULT LOGIN----USER NAME AND PASWORD IS SAME IN BOTH THE DATABASES.

Syntax
-------------
CREATE [PUBLIC] DATABASE LINK <DB.N.> CONNECT TO CURRENT_USER USING<'CONNECTION STRING'>

Expand|Select|Wrap|Line Numbers
  1. create public database link daslink connect to current_user  using 'ORCL' 
2.EXPLICIT LOGIN-----USER NAME AND PASWORD IS DIFFERENT IN BOTH THE DATABASES.

Syntax
-------------
CREATE [PUBLIC|SHARED] DATABASE LINK <DBLINK NAME> CONNECT TO<USERNAME>IDENTIFIED BY<PASSWORD> USING<'CONNECTION STRING'>

Expand|Select|Wrap|Line Numbers
  1. CREATE PUBLIC DATABASE LINK DDLNK CONNECT TO SCOTT IDENTIFIED BY TIGER USING 'ORCL'
  2.  

Note:---TO CREATE PUBLIC DBLINK THE USER MUST HAVE CREATE PUBLIC DATABASE LINK SYSTEM PREVILEDGE.
May 8 '07 #1
0 15790

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by A.M. de Jong | last post: by
2 posts views Thread by Ike | last post: by
1 post views Thread by Steve Kershaw | last post: by
2 posts views Thread by Aguyngueran | last post: by
reply views Thread by Jack | last post: by
reply views Thread by Winder | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.