Create Database Link

This Topics talks About how to create Database link , what i need

Solution

1-If you are creating public dblink, you will need a user with the following permissions:

create public database link 
drop public database link 

 If you are creating dblink, you will need a user with the following permission: 

create database link

2-check Global_names parameter in database , if you create public database link its should be TRUE, otherwise FALSE 

How To check it :

-Show Parameter global 
OR
SELECT name, valueFROM gv$parameter WHERE name =’global_names’;

To Change its Value :

Alter system set = Scope=Spfile/Memory 

3) Create the database link: 

SQL> CREATE [SHARED] [PUBLIC] DATABASE LINK CONNECT TO CURRENT_USER USING ”;

 Please note that: 
* The single quotes around the service name are mandatory 
* The service name used above must be in the TNSNAMES.ORA file on the server. If it does not existyou can create one like below: 

connection_link = 
(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = n host name>)

(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = )))

4) Make sure that the database link is created:

SQL> SELECT * FROM user_db_links;

Also you Can Check Database Domain :

SQL> SELECT name, valueFROM gv$parameter WHERE name IN (‘db_name’, ‘db_domain’);

sometimes you need to set database domain , refer to  Note 578668.1

Enjoy 

Osama Mustafa  

2 thoughts on “Create Database Link

  1. Hi Osama ;SQL>show parameter global_name;NAME TYPE VALUEglobal_names boolean FALSESQL>create public database link mydba connect to scott identified by tiger using 'ORCL';Database link created.SQL> select * from emp@mydbaselect count(*) from emp@mydba;COUNT(*)14Even i set global_name='FALSE' i can create public database link. thenwhy should i set global_name=*'TRUE'Thanks in advance ..

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.