Question

ORA-12154: TNS:could not resolve service name error in SQL Navigator

Asked by: hiranya

I have installed Oracle 8i Database in to a Win2000 Server and installed SQL Navigator 4 to a WinXP Client. When I tried to connect to the database it gave following error (using SQL Navigator)

        ORA-12154: TNS:could not resolve service name

I have already setup the TNSNAMES.ORA file.
What can be the problem?.

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2004-02-29 at 21:13:38ID20902239
Tags

service

,

name

,

resolve

Topic

Oracle Database

Participating Experts
10
Points
500
Comments
10

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. ORA-12154: TNS:Could not resolve service name
    I am self-studying oracle server8. I created a new instance ORC0, then I used instance manager to login, I used: Username: internal Password: oracle Service: OracleServiceORC0 Connect As: Normal Click OK, and the error ORA-12154: TNS:Could not resolve service name occured. ...
  2. ORA-12154: TNS could not resolve ervice name
    Hi I'm using Oracle 7.3.4 client and Oracle 7 Odbc driver. When i tried to connect to a remote database through sql plus 3.3, i was getting the ERROR: ORA-12154: TNS:could not resolve service name.. I added the service name in tnsnames.ora file also but still getting that ...
  3. ORA-12154
    ORA-12154: TNS:could not resolve service name TNS-03505: Failed to resolve name C:\Documents and Settings\george>TNSPING 127.0.0.1 TNS Ping Utility for 32-bit Windows: Version 9.0.1.3.1 - Production on 11-OCT-20 04 10:18:35 Copyright (c) 1997 Oracle Corporation. All ri...
  4. ORA-12154: TNS:could not resolve service name
    I have a VB6 project. When I run it from with in the VB6 development enviornmnet the database connections works. However, when I compile the project, the same code gives the following set of errors when the EXE is ran. Error No: 00001 An error occurred while connecting to ...
  5. ORA-12154 TNS:could not resolve service name
    Greetings, I tried to make a DB connection from PB9 to Oracle8 database. I created a db connect under O84 Oracle8/8i. I am getting error "ORA-12154 TNS:could not resolve service name". Anyone know how to fix it? Thanks.
  6. ORA-12154: TNS:could not resolve service name
    Hi All, I am developing an ASP.net 1.1 website because recently I've reinstalled winxp, so I've to install all application again I could set up the website and oracle client again but I have this error --> "ORA-12154: TNS:could not resolve service name " when it...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: catchmeifuwantPosted on 2004-02-29 at 21:21:22ID: 10484010

The service name you have configured is not proper.

When you say sqlplus username/passwd@<host_string>

Then you need to have a <host_string> configured in your tnsnames.ora pointing to your DB.

A sample tnsnames.ora will be :

DB1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = TESTDB1)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = TESTDB1)
    )
  )

where DB1 is the Host String
(HOST = TESTDB1) is the Name of the host where Oracle server is installed.You can use the IP also here
(SERVICE_NAME = TESTDB1) is the SID of the Database.


Once configured(you can use Net Config Assistant from Start Menu ->Pograms->Oracle->Configuration Utilities), try

tnsping <host_string> and check for the status OK.Else your configuration is wrong.

 

by: baonguyen1Posted on 2004-02-29 at 22:27:40ID: 10484194

If the above suggestion does not work, check the value of the NAMES.DEFAULT_DOMAIN parameter in your sqlnet.ora.

For example:

NAMES.DEFAULT_DOMAIN = company.com

and in the tnsnames.ora, you should have:

DB1.company.com =     (note the suffix here)
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = TESTDB1)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = TESTDB1)
    )
  )


Then try:

sqlplus username/passwd@db1


 

by: schwertnerPosted on 2004-02-29 at 23:58:23ID: 10484500

You have to make sure that you are using the tnsnames.ora of the product you use as client. There are many such files, so you have to find the appropriate one.
I send you the instruction for Developer/2000, but the solution seems to be the same.

Oracle Server <---> Developer 6i:
Oracle Developer6i and the Oracle8i database require separate Oracle home directories.
Even if you configure SQL*net (Net8) in the Oracle home that your database Oracle server uses, so that you can connect via SQL*Plus, that does not allow Developer2000 to connectsuccessfuly to the Oracle server.  You also need to configure SQL*Net (in tnsnames.ora file) in the
Oracle home for Developer2000.  You can do that either using the GUI tools, or to copy two files:
sqlnet.ora and tnsnames.ora from your 8i Oracle home to your Developer2000 Oracle home.  In your 8i
Oracle home these files are in: \Network\admin, but in your Developer2000 home they are in: \Net80\Admin. A safety measure is to save a copy of them first, before you make changes or copy other ones in. This is so because you have to keep a way for restoring the files if you make a mistake.
--------
This is a generic advise I collected for a year answering to this kind of questions.
About connection between Personal Oracle and Forms 6 look at
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:447620106871

You can use the "Oracle Net 8 assistant", "Oracle Net 8 Easy config" to see if you have the appropriate entry to the server in the local tnsnames.ora file (find it!). I mean that one in the Client or Forms&Reports home, not that one in the Oracle_Home.
Under local I mean the file tnsnames.ora  in your application, not at the Oracle Server - this is a common mistake.

You have to have there an entry like:

REKS816.RILA.us =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = bigbluenew.rila.us)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = REKS816)
     )
  )


Be aware that in old versions of Oracle instead of SERVICE_NAME you have to use SID. So (SERVICE_NAME = REKS816)will be (SID = REKS816)
     
It is a bad practice, but you can add such entry using simple text editor. But before that make a copy of tnsnames.ora in order to restore it if you do not succeed.

After that go to "control panel" and run "services".
Look at your Oracle_Home_TNSlistener80 process. Stop it! Start it again!

 

by: ShivajiRaoBKPosted on 2004-03-02 at 13:46:18ID: 10499577

If the error received is only via sql navigator. Then try to restart the listerner.


c:\>lsnrctl
lsnrctl> stop

and...

lsnrctl> start

and even check if the output of "tnsping <instance name>" is OK.

 

by: sbalasuriyaPosted on 2004-03-03 at 19:47:32ID: 10510913

Do you have multiple Oracle installations on your machines like Oracle client and Developer ?

If so you'll have to set up the tnsnames.ora on both HOMES.

Or else setup the registry.

Add string value TNS_ADMIN to \HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE

Set the values of TNS_ADMIN to the folder where the tnsnames.ora you set up resides.

Eg. C:\oracle\ora92\admin

 

by: dlorettePosted on 2004-11-09 at 11:12:24ID: 12536856

I tried the both suggestions listed above and I still could not make a connection.  I decided I'd check out the .ora files on another machine that I knew worked.  It turns out that the sqlnet.ora file had a NAMES.DEFAULT_DOMAIN set to our internal network... after I commented this line out  I was able to make the connection.

 

by: syntheticbytePosted on 2005-06-21 at 02:56:45ID: 14264324

Just try WinSID tool...
It doesn't use Oracle to connect to listener an has no *.ora config files...If IP an port is accessible...you'll et it connected...
Will generate a (simplistic) valid connection descriptor. I'm sorry, I don't think i can post information where is (no advertising) but you'll find with search engines...

Please feed-back...

 

by: krixerxPosted on 2005-06-21 at 05:48:01ID: 14265351

Hi! I found my problem. Before installing "10g Client", i did'nt remove old Oracle freeware software. So, my Oracle HOME was not definated to Oracle home directory. Solution: i opened regedit (regsvr32) and correct Oracle home directory.
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE

 

by: brucecairoPosted on 2005-09-23 at 11:10:15ID: 14946881

Use of USE_SHARED_SOCKET with Oracle 8.1.7 and Windows NT/2000

In short:
1. If you are using Oracle 8.1.7 install patch 2376472, that is Oracle 8.1.7.4, you can get it at Metalink
2. Add USE_SHARED_SOCKET to your registry (there are 2 possible locations, depending on your Oracle version)
3. Restart the computer
4. Do some local connection testing using a client computer (tnsping, sqlplus, netstat)
5. Open the port in the firewall
6. Do some connection testing from outside the firewall (tnsping, sqlplus, netstat)

Here are the details:

The USE_SHARED_SOCKET parameter allows you to use a single port for oracle communications, by default TCP 1521.
You must have in mind that this might slow down connections a little when many clients are connected (50 or more, depending on different conditions).
Also if the listener service shuts down all connections will be broken.

This parameter only works fine with Oracle Patch 8.1.7.4, you can get it at Oracle Metalink homepage, and here is the detail for the patch:

Patch 2376472
Oracle Database Family: Patchset 8.1.7.4 PATCH SET FOR ORACLE DATA SERVER
Release 8.1.7.4
Updated 14-JUN-2002
Size 112MB
File name p2376472_8174_WINNT.zip

I would advise you to install this patch before you create any databases in your system, it's easier.
If you already have some databases created there's no problem, just follow the additional steps after installing the patch.

Troubleshooting: Oracle services have to be stopped during installation of the patch, in my case I started windows in safe mode and then installed the patch. Also because my computer has an Intel Xeon I had to rename 2 files called symcjit.dll to symcjit.old, because (at least in my case) this java jit compiler does not work with this processor, the same is true for Intel Pentium 4.
Almost for sure TNSPING command already works at this point but not SQLPLUS, isn't it? Don't worry, the update will make USE_SHARED_SOCKET work.

Step 1: Installing patch, done.


Next we have to add the USE_SHARED_SOCKET parameter to the registry.
Place the parameter under the following locations:
    For Oracle 8.0 use            \\HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE
    For Oracle 8i or newer use    \\HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME#
    (Where # is the number of your HOME, usually zero "HOME0")

Add USE_SHARED_SOCKET (New, Alphanumeric Value), then set its value to TRUE

Then restart your computer.


Step 2: Add USE_SHARED_SOCKET parameter into the registry, set it to TRUE and restart, done.


From some client computer do some connection tests.
Use:
     C:\> tnsping your_oracle_service 100
(That will ping you database service 100 times to check connection times)
Usually tnsping works fine even before USE_SHARED_SOCKETS have been set, because it doesn't make a connection to the service.

Use:
     C:\> sqlplus user/password@your_oracle_service

If connection succeeds you'll see something like this:

     SQL*Plus: Release 8.1.7.0.0 - Production on Jue Sep 22 12:32:19 2005
     (c) Copyright 2000 Oracle Corporation.  All rights reserved.
     
     Connected to:
     Oracle8i Enterprise Edition Release 8.1.7.4.1 - Production
     JServer Release 8.1.7.4.1 - Production
     
     SQL>

Then in the SQL> prompt you can do some query to do some more testing, but we are already connected.

While doing your tnsping and during your connection with sqlplus try this command in the server:
C:\> NETSTAT

There you can see if connections are being made using only your oracle port (usually 1521)
You'll see something like this:

Active Connections                                                
                                                                   
  Proto  Local Address        Foreign Address           State      
  TCP    server:1036          server:1521               ESTABLISHED
  TCP    server:1043          server:1088               ESTABLISHED
  TCP    server:1088          server:1043               ESTABLISHED
  TCP    server:1521          server:1036               ESTABLISHED
  TCP    server:1316          CLIENT02:netbios-ssn      TIME_WAIT  
  TCP    server:1317          CLIENT02:netbios-ssn      TIME_WAIT  
  TCP    server:1318          CLIENT02:netbios-ssn      TIME_WAIT  
  TCP    server:1521          CLIENT04:1336             TIME_WAIT  
  TCP    server:1521          CLIENT04:1337             TIME_WAIT  
  TCP    server:1521          CLIENT04:1338             TIME_WAIT  
  TCP    server:1521          CLIENT04:1339             TIME_WAIT  
  TCP    server:1521          CLIENT04:1340             TIME_WAIT  
  TCP    server:1521          CLIENT04:1341             TIME_WAIT  
  TCP    server:1521          CLIENT04:1342             TIME_WAIT  
  TCP    server:1521          CLIENT04:1343             TIME_WAIT  
  TCP    server:1521          CLIENT04:1344             TIME_WAIT  
  TCP    server:1521          CLIENT04:1345             TIME_WAIT  
  TCP    server:1521          CLIENT04:1347             ESTABLISHED

There we see that in column "Local Address" only port 1521 is being used for our client computer "CLIENT04" (among other ports and clients connected)


You can use any other kind of connections you would like to test, in my case tnsping and sqlplus were enough.

Troubleshooting:
On your server check the files listener.log and sqlnet.log they can give you some good information about connections.
Delete them both to start fresh (you'll have to stop the listener service to delete the listener.log file, you do so with running "C:\> LSNRCTL" then using the STOP command, deleting the file, then restarting the service using the START command and then the EXIT command)


Step 3: Local tests using tnsping and sqlplus, done.


Now you have to open your Oracle port in the firewall, usually TCP port 1521

Troubleshooting:
Sometimes you'll have a modem, a router, a firewall or a mix of them, consider that you might configure some of them or all to make port forwarding work.
Also considering security issues: 1521 is a very well known port, you can change it. Also consider Listener password and some others, check your options well.

After opening the port do some testing from outside the firewall (depending on your configuration you can even try testing using an internet Dial-up connection).

Do your TNSPING, your SQLPLUS connection, your NETSTAT on the server and so on.

Troubleshooting:
In my experience I had no problems with clients working with a personal firewall so I had not to open any port on those personal firewalls.

I hope this might be of help.

 

by: esmail1349Posted on 2008-12-06 at 02:44:25ID: 23111364

test your tns setting by TNSPING80 <tna_name> Command in Windows command prompt . (in client side)
it should return O.K in last line .
If its O.K then your problem is in listener configuration .
you can manage listeners by LSNRCTL command in wondows command prompt
also you can get help by LSNRCTL HELP .

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...