Connect Oracle 10G client to server

Posted on 2009-04-01
Last Modified: 2013-12-18
I have a workgroup of 4 computers. In one PC, I have installed Oracle 10G server. On another PC I have installed Oracle 10G client.
When I try to login to SQL*Plus on client it gives me an error

TNS could not resolve connect identifier specified.

Can someone please let me know how to connect client to the server.

Thank you
Question by:sangeeta9189
  • 5
  • 4
  • 2
  • +1

Expert Comment

ID: 24046797
A quick Google found a few things to try. I believe this error is a generic "could not connect" error, so it could be many things.

Author Comment

ID: 24046834
Thanks for replying.

I searched in the client installation and it does not have TNSNAMES.ora file.

It has SQLNET.ora

the server instllation has tnsnames.ora
Please suggest

Author Comment

ID: 24046840
This is a fresh installation, so I just need the steps to connect client to server
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.


Accepted Solution

jd_programmer1 earned 250 total points
ID: 24046911
I apologize. I do not know much about Oracle, I've just seen it used.

This is a guide for 9i, but it might work. Otherwise, it may be worth waiting for another expert to pick this up in the morning.

This is also from, which is for 10G:

Adding new database services

Use this section if you need to set up an Oracle client connection to an Oracle database on another computer:

From the Start menu, select Programs, then Oracle - OraClient10g_home, then Configuration and Migration Tools, and then Net Configuration Assistant.

Choose Local Net Service Name Configuration, and then click Next.

Select Add, and then choose Next.

You will be prompted for the Service Name. This is the Database SID followed by an extension (e.g., ). Enter the full service name, and then click Next.
Note: If you do not know the service name, check with the database administrator.

Make sure that TCP is selected, and then click Next.

Enter your hostname. For Oed1, the hostname is . Unless you are instructed otherwise, select Use the standard port number of 1521. To continue, click Next.

Choose Yes, perform test, and then select Next.
Note: If the login test fails, select Change Login, enter your correct user information, and then try again. Choose Next when the test is successful.

Enter a net service name. UITS recommends using the same name that you supplied in step 4 (e.g., ). Click Next.

If you would like to configure another net service name, select Yes, then Next, and then follow steps 1 through 8 again. Otherwise, select No, and then click Next.

Once you have configured all of your net service names, click Next, and then choose Finish.
Back to top

Connecting to Oracle with SQL*Plus

To connect to Oracle with SQL*Plus:

From the Start menu, select Programs and then Oracle - OraClient10g_home1.

From the Oracle menu, select Application Development, and then SQL Plus.

Enter your Oracle username and password in the spaces provided.

In the box labeled "Host String:", enter the name you specified when configuring Oracle Net (e.g., Click OK.
After completing the steps above, you will be in the SQL*Plus command line interface environment. To change your password, see How do I change my Oracle password using SQL*Plus?
LVL 25

Assisted Solution

lwadwell earned 250 total points
ID: 24047044
Hi sangeeta9189,

How are you connecting?  If it via something like SQLPlus - you will need a TNSNAMES.ORA file on the client machine.  This file tell the client where the server is to connect to.

The location will depend on where the client is installed ... but will be in the subdirectory to the client called .../network/admin

A TNSNAMES.ORA should have an entry like below - you will need to change the  to the SID of the servers database,  to the ip address of the server machine and  to the port the listener of the server uses.  If you did not set the port number to something different of the server install, it probably is port 1521.

      (ADDRESS =
        (PROTOCOL = TCP)
        (HOST = )
        (PORT = )
      (SID = )

Once you have the TNSNAMES.ORA file set up, is a command prompt issue the command "tnsping .WORLD" (again changing the .  This command will tell you whether it can resolve the connection to the server and whether it is OK.


Author Comment

ID: 24047103
When i execute command
tnsping orcl.WORLD
it gives me message
Used parameter files:
TNS-03505: Failed to resolve name

It is looking at sqlnet.ora.
The tnsnames.ora on client machine is inside SAMPLE directory

Author Comment

ID: 24047127
I put the  lines you mentioned inside sqlnet.ora, but still same problem.
LVL 25

Expert Comment

ID: 24047128
the one in the sample directory is just that ... a sample.  It is not the one used ... it must be in the C:\oracle\product\10.2.0\client_1\network\admin directory.

Also try the tnsping command on the server machine please.
LVL 25

Expert Comment

ID: 24047134
The lines I gave must be in the TNSNAMES.ora file.  The sqlnet.ora file is a for configuration - not connections.

Author Comment

ID: 24047151
On the client machine, I did the following on command prompt
telnet 1521
but gives me a message
Connecting To not open connection to the host, on port 1521
: Connect failed
where is the Oracle Server machine.
However, if I execute the same command in server machine, it succeeds
Could it be some connectivity problem?
LVL 25

Expert Comment

ID: 24047189
telnet is a different protocol - nothing to do with Oracle databases.  

tnsping is the command to use - this is Oracle's tool for testing database communications.

the fact that the telnet could connect - but not use port 1521 is a positive sign - but telnet will never be able to connect to that port.

try again with tnsping please.

Expert Comment

ID: 24093210
create a tnsnames.ora file if it does not exist with an entry as suggested by lwadwell.

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions is a cloud-based customer relationship management (CRM) system. In this article, you will learn how to add and map custom lead and contact fields to your Salesforce instance.
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to recover a database from a user managed backup

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question