Q
Problem solve Get help with specific problems with your technologies, process and projects.

ConnString value for dblink syntax

We have two different Oracle servers and I am trying to connect from one server to another server using dblink. I am using the syntax for creating the dblink as "create database link dblink_name connect to user_name identified by password using ConnString." Here, what value should I give in ConnString?

We have two different Oracle servers and I am trying to connect from one server to another server using dblink. I am using the syntax for creating the dblink as "create database link dblink_name connect to user_name identified by password using ConnString." Here, what value should I give in ConnString? Is it the description value in the TNSNAMES.ORA file? Should I place the TNSNAMES.ORA file in the server as well as in each client machine? Please help. Thanks in advance.
The connect string in the database link is the same thing as the entry in your TNSNAMES.ORA config file. Assume you have the following in your TNSNAMES.ORA config file:
ORCL=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)
           (HOST=dbserver1.acme.com)(PORT=1521)))
  (CONNECT_DATA=(SID=orcl)(SERVER=DEDICATED)))
In this case, your connect string is simply "orcl." You only need to define this TNS alias on your database server. The clients will submit the SQL to the database. The database will recognize that it is using the database link and look up the TNS alias information for the user. There is no need to add this entry to the client workstation to get the database link to work.

Dig Deeper on Oracle database backup and recovery

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close