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

Errors with select query on dblink

I created a dblink, but when I execute the select query, it throws the following errors: "TNS: could not resolve service name" or "TNS: no listener." Can you help?

I have created the dblink as:
create database link link123
connect to scott identified by tiger
using 'connection string'
The link is getting created, but when I execute the select query as:
select * from emp@link123;
it throws the following errors: "TNS: could not resolve service name" or "TNS: no listener." Can you help me in this regard?

The 'connection string' you specify in your CREATE DATABASE LINK command is a TNS alias that is found in the TNSNAMES.ORA...

configuration file. This configuration file must be found in ORACLE_HOME/network/admin for database links. Ensure you have a TNS alias correctly defined in your TNSNAMES.ORA config file and then ensure your database link is defined with this TNS alias.

The TNS alias points to a listener running on a specific port of a remote database server. If the listener on that database server is not running, you will receive the "no listener" error message. If you specify an incorrect server or port, then you will receive this message. Verify your TNSNAMES.ORA config file is set up correctly.

This was last published in July 2006

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.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close