[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4945
  • Last Modified:

ORA-12514: TNS:listener could not resolve SERVICE_NAME given in connect descriptor

I wiped my hard drive and reinstalled Oracle 9i and Toad on my windows xp laptop. I tried to connect to 2 of several remote databases and received the following error in Toad:

ORA-12514: TNS:listener could not resolve SERVICE_NAME given in connect descriptor

When I expanded the details section It had the following information:


*** First assume we have a valid install and registry  
***  
Oracle home is set to C:\oracle\ora92  
Bin path is set to C:\oracle\ora92\bin\  
oci.dll found  
Using: C:\ORACLE\ORA92\BIN\oci.dll  
 
2) Oracle Home Key is SOFTWARE\ORACLE\HOME0  
Looking for TNS_ADMIN environmental variable  
TNS_ADMIN environmental variable doesnt exist,  
looking for TNS_ADMIN reg key using home key: >SOFTWARE\ORACLE\HOME0<  
TNS_ADMIN does not exist in SOFTWARE\ORACLE\HOME0

I have no clue how to fix this. I didn't have this problem before I wiped my hard drive and the settings for the remote connections are the same in the tnsnames.ora file as they were before I wiped my hard drive (I saved a backup of the tnsnames.ora file). Could someone please tell me what is wrong and how I can fix this?
0
sikyala
Asked:
sikyala
  • 3
  • 2
  • 2
2 Solutions
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
check please the contents of the following folder (on your client):
C:\ORACLE\ORA92\NETWORK\ADMIN\tnsnames.ora

check please the contents of the following folder (on your server):
C:\ORACLE\ORA92\NETWORK\ADMIN\listener.ora

on the server, what is the output of
C:\ORACLE\ORA92\BIN\lsnrctl status

on the client, what is the output of
C:\ORACLE\ORA92\BIN\tnsping <service_id>

0
 
sikyalaSenior Database AdministratorAuthor Commented:
Also When I tnsping the remote database I get the following:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\506246\Desktop>tnsping Gabriele

TNS Ping Utility for 32-bit Windows: Version 9.2.0.1.0 - Production on 03-MAY-20
06 15:49:07

Copyright (c) 1997 Oracle Corporation.  All rights reserved.

Used parameter files:
C:\oracle\ora92\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = xxx.xx.xxx.xx)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERV
ICE_NAME = Gabriele)))
OK (10 msec)

C:\Documents and Settings\506246\Desktop>

I deleted the host information for privacy and security.
0
 
sikyalaSenior Database AdministratorAuthor Commented:
lsnrctl status

 Instance "Gabriele", status READY, has 2 handler(s) for this service...
The command completed successfully

tnsnames.ora

Gabriele =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = xxx.xx.xxx.xx)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = Gabriele)
    )
  )

I changed the host information for security purposes.

There is no entry in the listener.ora for the remote database in question. It only has information about the database on my laptop. There was never an entry for the databases I connected to remotely on my backup listener.ora file either.
0
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
Then, toad is using another oracle_home possibly (I had that already several times)
Do you have several oracle_homes on your laptop?
0
 
sikyalaSenior Database AdministratorAuthor Commented:
I only have one Oracle home. I fixed the problem.

This setting which is exactly what I had before suddenly doesn't work anymore.

SERVICE_NAME = Gabriele

When I changed it to

SERVICE_NAME = Gabriele.usae.xxx.com

it worked.
0
 
haidersyedCommented:
you can use
sid instead of service_name in tnsnames.ora file
0
 
haidersyedCommented:
For further details of such errors and resolutions you can also visit a link

http://www.findabout.net/Technology/IT/oraerror.htm#ORA-12154:%20TNS:could%20not%20resolve%20service%20name
or
http://www.findabout.net/Technology/IT/oraerror.htm

also from http://tahiti.oracle.com  you can complete documentation

Thanks
Haider Ali Syed
Sr IT Exective PTML
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now