Home » RDBMS Server » Networking and Gateways » ORA-12154: TNS:could not resolve service name when trying to connect to a newly created database
ORA-12154: TNS:could not resolve service name when trying to connect to a newly created database [message #290525] Sat, 29 December 2007 08:19 Go to next message
Muddassar
Messages: 28
Registered: March 2007
Junior Member
Hi,
I recently created a database manually named myDB (instance_name=myDB.
After successfully creating the database from sqlplus i exited. Later i tried to connect to the newly created instance as system/manager@myDB which throws the following tnsnames error:
ERROR:
ORA-12154: TNS:could not resolve service name

I could understand that the tnsnames.ora file does not contains the entry for my new instance. So, i added an entry for the same as:

MYDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = india)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = myDB)
)
)

I did this as looking into the entry for my already working instance 'test'.
I try to connect again, but am getting the same error.

I also did a tnsping myDB and get the following error:

TNS Ping Utility for 32-bit Windows: Version 9.0.1.1.1 - Production on 29-DEC-20
07 19:46:50

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

Used parameter files:
D:\oracle\ora90\network\admin\sqlnet.ora
D:\oracle\ora90\network\admin\tnsnames.ora

TNS-03505: Failed to resolve name

Any help would be appreciated.
Re: ORA-12154: TNS:could not resolve service name when trying to connect to a newly created database [message #290531 is a reply to message #290525] Sat, 29 December 2007 09:07 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Check your listener configuration (listener.ora). You need to ensure your listener knows of the MYDB service. Check the listeners current services with:

lsnrctl services
Re: ORA-12154: TNS:could not resolve service name when trying to connect to a newly created database [message #290534 is a reply to message #290525] Sat, 29 December 2007 09:27 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
If you are logged onto the same system as where the database resides, then you do NOT need to use SQL*Net to access the DB

sqlplus system/manager

is the Oracle listener actually running?
Re: ORA-12154: TNS:could not resolve service name when trying to connect to a newly created database [message #290537 is a reply to message #290525] Sat, 29 December 2007 09:56 Go to previous messageGo to next message
Mohammad Taj
Messages: 2412
Registered: September 2006
Location: Dubai, UAE
Senior Member

Again recreate tnsnames.ora file for MYDB through netca.

[Updated on: Sat, 29 December 2007 09:56]

Report message to a moderator

Re: ORA-12154: TNS:could not resolve service name when trying to connect to a newly created database [message #290539 is a reply to message #290534] Sat, 29 December 2007 10:15 Go to previous messageGo to next message
Muddassar
Messages: 28
Registered: March 2007
Junior Member
Yes , you are right. When i connect to the test instance, i use the following:
sqlplus system/manager
Even doing a system/manager@test gives the no listener error:

ERROR:
ORA-12541: TNS:no listener

I tried to run lsnrctl services and get the following error:
LSNRCTL for 32-bit Windows: Version 9.0.1.1.1 - Production on 29-DEC-2007 2
20

Copyright (c) 1991, 2001, Oracle Corporation. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
32-bit Windows Error: 2: No such file or directory
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=india)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
32-bit Windows Error: 61: Unknown error


Does this mean that the listener is not running. If so, how do i make it running and finally connect to the newly created database ?
Re: ORA-12154: TNS:could not resolve service name when trying to connect to a newly created database [message #290540 is a reply to message #290525] Sat, 29 December 2007 10:22 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
You really should read & FOLLOW both the Installation Guide & Concepts manuals instead of doing trial & error poking at possible solutions.
Re: ORA-12154: TNS:could not resolve service name when trying to connect to a newly created database [message #290556 is a reply to message #290539] Sat, 29 December 2007 22:25 Go to previous messageGo to next message
Mohammad Taj
Messages: 2412
Registered: September 2006
Location: Dubai, UAE
Senior Member

TNS-00511: No listener
Cause: The connect request could not be completed because no application is listening on the address specified, or the application is unable to service the connect request in a sufficiently timely manner.
Action: Ensure that the supplied destination address matches one of the addresses used by the listener - compare the TNSNAMES.ORA entry with appropriate LISTENER.ORA file (or TNSNAV.ORA if the connection is to go by way of an Interchange. Start the listener on the remote machine.


1. Recreate listener.ora file
2. check listener is running :"lsnrctl status"
3. Recreate tnsnames.ora file
4. again check listener services for tns entry is registered.
5. then try with tns entry with username/pwd.
Re: ORA-12154: TNS:could not resolve service name when trying to connect to a newly created database [message #292810 is a reply to message #290525] Wed, 09 January 2008 22:50 Go to previous message
Arju
Messages: 1554
Registered: June 2007
Location: Dhaka,Bangladesh. Mobile:...
Senior Member

In windows I saw this problem when you use,

set ORACLE_SID=test;


to set ORACLE_SID. Here you see an ; is appended here after SID. Make sure you have not done this silly mistake.
Previous Topic: ERROR, ORA-12520: TNS:listener could not find available handler for requested type of server
Next Topic: Connecting to database services
Goto Forum:
  


Current Time: Wed Apr 24 03:49:54 CDT 2024