Re: tnsping phantom file

From: Niall Litchfield <niall.litchfield_at_gmail.com>
Date: Wed, 18 May 2016 13:07:39 +0100
Message-ID: <CABe10sYUFKfvYE8cZ0YbWzWyCzHoPStb0T3_WH+mV4jJcU4u_w_at_mail.gmail.com>



What Mladen means is that tnsping will attempt to resolve the name that you provide via the naming methods listed in your SQLNet.ora file and then contact the listener(s) specified for the service. It doesn't actually attempt to see if the service is currently up however, just that the specified listener is contactable. See below, tnsping succeeds in contacting my specified scan listener for demo_service even though demo_service is neither running nor registered with the database. only editing below is for host and database names - demo_service really is the service name.

$ tnsping demo_service

TNS Ping Utility for Linux: Version 12.1.0.2.0 - Production on 18-MAY-2016 12:01:02

Copyright (c) 1997, 2014, Oracle. All rights reserved.

Used parameter files:
/opt/oranet/sqlnet.ora

Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = scan-name)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = DEMO_SERVICE)))
OK (0 msec)
$srvctl status service -db DBNAME -service demo_service Service demo_service is not running.

$ lsnrctl status LISTENER_SCAN2|grep -i demo $

your error comes because the service name you provided is not in your tnsnames file.

$ tnsping made_up_name

TNS Ping Utility for Linux: Version 12.1.0.2.0 - Production on 18-MAY-2016 12:05:26

Copyright (c) 1997, 2014, Oracle. All rights reserved.

Used parameter files:
/opt/oranet/sqlnet.ora

*TNS-03505: Failed to resolve name*

On Wed, May 18, 2016 at 8:15 AM, Justin Mungal <justin_at_n0de.ws> wrote:

> Hmm, interesting... that comment got my attention. I get *TNS-03505:
> Failed to resolve name* if I try to tnsping an invalid service name.
>
> On Tue, May 17, 2016 at 5:26 PM, Mladen Gogala <gogala.mladen_at_gmail.com>
> wrote:
>
>> On 05/17/2016 02:32 PM, Storey, Robert (DCSO) wrote:
>>
>> A simple thing, tnsping. However, its causing me much grief today.
>>
>>
>>
>> Troubleshooting connectivity issue and so I immediately do a tnsping from
>> the client station. Tnsping returns the expected information. App still
>> will not connect.
>>
>>
>>
>> I go look at the tnsnames.ora file and the service name does NOT exist
>> in my file. Yet, the tnsping is returning the proper values for the
>> service name I am asking for (which is the default service name for our app
>> that we put on all computers).
>>
>>
>>
>> I added the service name via net manager but only setup 1 of the two
>> ports we normally used. I also created a different service name (Service
>> B) with the same information. Once I added the expected service name to my
>> tnsnames file, the app works.
>>
>>
>>
>> However, a tnsping returns BOTH ports I normally configure for the
>> service name. Not just the one I configured new. Tnsping of Service B
>> returns just the one value.
>>
>>
>>
>> The screen shows me it is using the TNSNAMES adapter, but, I have no idea
>> where it is finding the information.
>>
>>
>>
>> Thoughts?
>>
>>
>>
>> Robert, all that tnsping checks is whether the listener is running on the
>> port specified in the tnsnames.ora file. That's it. It doesn't check
>> whether the listener knows about the service. Listener emulated using the
>> "netcat" (nc) utility. I even have a perl script doing that.
>> Regards.
>>
>> --
>> Mladen Gogala
>> Oracle DBA
>> Tel: (347) 321-1217
>>
>>
>

-- 
Niall Litchfield
Oracle DBA
http://www.orawin.info

--
http://www.freelists.org/webpage/oracle-l
Received on Wed May 18 2016 - 14:07:39 CEST

Original text of this message