Solved

Connect Oracle 10G client to server

Posted on 2009-04-01
14
1,582 Views
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
0
Comment
Question by:sangeeta9189
  • 5
  • 4
  • 2
  • +1
14 Comments
 
LVL 4

Expert Comment

by:jd_programmer1
Comment Utility
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.

http://ora-12154.ora-code.com/
0
 

Author Comment

by:sangeeta9189
Comment Utility
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
0
 

Author Comment

by:sangeeta9189
Comment Utility
This is a fresh installation, so I just need the steps to connect client to server
0
 
LVL 4

Accepted Solution

by:
jd_programmer1 earned 250 total points
Comment Utility
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.
http://youngcow.net/doc/oracle9i/network.920/a96580/cman.htm





This is also from https://kb.iu.edu/data/apaa.html, 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., oed1.world ). 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 dbserv.uits.indiana.edu . 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., oed1.world ). 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., oed1.world). 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?
0
 
LVL 25

Assisted Solution

by:lwadwell
lwadwell earned 250 total points
Comment Utility
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.

.WORLD =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS =
        (PROTOCOL = TCP)
        (HOST = )
        (PORT = )
      )
    )
    (CONNECT_DATA =
      (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.


lwadwell
0
 

Author Comment

by:sangeeta9189
Comment Utility
When i execute command
tnsping orcl.WORLD
it gives me message
Used parameter files:
C:\oracle\product\10.2.0\client_1\network\admin\sqlnet.ora
TNS-03505: Failed to resolve name

It is looking at sqlnet.ora.
The tnsnames.ora on client machine is inside SAMPLE directory
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:sangeeta9189
Comment Utility
I put the  lines you mentioned inside sqlnet.ora, but still same problem.
0
 
LVL 25

Expert Comment

by:lwadwell
Comment Utility
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.
0
 
LVL 25

Expert Comment

by:lwadwell
Comment Utility
The lines I gave must be in the TNSNAMES.ora file.  The sqlnet.ora file is a for configuration - not connections.
0
 

Author Comment

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

Expert Comment

by:lwadwell
Comment Utility
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.
0
 
LVL 4

Expert Comment

by:dkaisla
Comment Utility
create a tnsnames.ora file if it does not exist with an entry as suggested by lwadwell.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Read about achieving the basic levels of HRIS security in the workplace.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now