We help IT Professionals succeed at work.

oracle TNS error

patmoli
patmoli asked
on
11,675 Views
Last Modified: 2013-12-19
HI,

These are my TNS files I have two database on the testserv
and I face the error when I am try to connect with the database
there is no listener   -- ora-12541:tns:no listener

I am waiting for you replay

bye



# LISTENER.ORA Network Configuration File: C:\oracle\ora92\network\admin\listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST =  testserv)(PORT = 1521))
      )
    )
  )

    (SID_DESC =
      (GLOBAL_DBNAME = oratest)
     (ORACLE_HOME = C:\oracle\ora92)
      (SID_NAME = oratest)
    )

    (SID_DESC =
      (GLOBAL_DBNAME = db652)
      (ORACLE_HOME = C:\oracle\ora92)
      (SID_NAME = db652)
    )
  )
-----
# TNSNAMES.ORA Network Configuration File: C:\oracle\ora92\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
--------
ORATEST =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = TESTSERV)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = oratest)
    )
  )


db652=
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = TESTSERV)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = db652)
    )
  )
-------------
# SQLNET.ORA Network Configuration File: C:\oracle\ora92\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.

SQLNET.AUTHENTICATION_SERVICES= (NTS)



Comment
Watch Question

Guy Hengel [angelIII / a3]Billing Engineer
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2009

Commented:
that is the configuration, now, which listener processes are started on the server?
run this from the command line:

lsnrctl status

Author

Commented:
Hi angelIII:
I am connect through command prompt with listener and this command

LSNRCTL> status
TNS-01150: The address of the specified listener name is incorrect
 NL-00303: syntax error in NV string
LSNRCTL>
Guy Hengel [angelIII / a3]Billing Engineer
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2009

Commented:
that explains why you get "no listener", as the listener fails to parse the listener.ora, hence is not started.
http://www.error-code.org.uk/view.asp?e=ORACLE-TNS-01150

now, to solve the TNS-01150, we have to look carefully at your listener.ora file, here a sample file:
http://www.mike-devlin.com/oracle/listener_ora.htm

and in fact, simply, you miss 2 lines:
 SID_LIST_LISTENER =
  (SID_LIST =

before the second part of the file

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST =  testserv)(PORT = 1521))
      )
    )
  )

 SID_LIST_LISTENER =
  (SID_LIST =
   (SID_DESC =
      (GLOBAL_DBNAME = oratest)
     (ORACLE_HOME = C:\oracle\ora92)
      (SID_NAME = oratest)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = db652)
      (ORACLE_HOME = C:\oracle\ora92)
      (SID_NAME = db652)
    )
  )

save that modified listener.ora, and issue the following 2 commands:
lsnrctl stop
lsnrctl start

the stop will raise some errors, as the listener is not started, actually, so is just to ensure it stops cleanly anyhow.
once that is done, try to issue:

tnsping ORATEST
or
tnsping db652

should work better, now, and hence, the connection should work also.

Author

Commented:
Hi,

When I am use stop and start command the result is

LSNRCTL> stop
TNS-01150: The address of the specified listener name is incorrect

 NL-00303: syntax error in NV string
LSNRCTL>
LSNRCTL> start
Starting tnslsnr: please wait...

Service OracleOraHome92TNSListener already running.
TNS-12560: TNS:protocol adapter error
LSNRCTL>

------
and user the tnsping command in command prompt  result is


C:\>tnsping ORATEST

TNS Ping Utility for 32-bit Windows: Version 9.2.0.1.0 - Production on 01-OCT-20
07 14:25:28

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 = TESTSERV)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_N
AME = oratest)))
OK (10 msec)

C:\>tnsping db652

TNS Ping Utility for 32-bit Windows: Version 9.2.0.1.0 - Production on 01-OCT-20
07 14:25:59

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 = TESTSERV)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_N
AME = db652)))
OK (20 msec)

C:\>



bye
Guy Hengel [angelIII / a3]Billing Engineer
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2009

Commented:
what about using
lsnrctl reload

i assume you saved/modified the file as shown?

Author

Commented:
hi
 
Yes I save the fiel as you shown
but i am not use the lsnrctl reload command
I just stop and start listener
but now my listener is working and i am able to connect with both database


by
Billing Engineer
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2009
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.