Home » Other » Marketplace » McTnsping: a tnsping-like program for Windows (Oracle: all versions, OS: MS/Windows all versions)
Re: McTnsping: a tnsping-like program for Windows [message #674933 is a reply to message #674907] Sat, 23 February 2019 04:12 Go to previous messageGo to next message
Michel Cadot
Messages: 68634
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

The file is too big to be sent via PM so I attach it here.
Tell me if it works for you.


[Edit: no answer so file is removed]

[Updated on: Wed, 17 April 2019 10:08]

Report message to a moderator

Re: McTnsping: a tnsping-like program for Windows [message #674992 is a reply to message #674933] Fri, 01 March 2019 03:35 Go to previous messageGo to next message
Michel Cadot
Messages: 68634
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Does this specific version work for you or for anyone having the same kind of and downloaded it?

Re: McTnsping: a tnsping-like program for Windows [message #675761 is a reply to message #674992] Wed, 17 April 2019 09:53 Go to previous messageGo to next message
sloc
Messages: 8
Registered: January 2019
Junior Member
Hi there again. The last version (January 2019)worked great on my environment. Now we have it installed on our user workstations and the only thing that happens it's...nothing. No help, no usage. Just doesn't do anything. Any idea what it can be? The directory where it's installed has a lot of restrictions: does it need write permissions anywhere (temp etc)? Thank you very much
Re: McTnsping: a tnsping-like program for Windows [message #675763 is a reply to message #675761] Wed, 17 April 2019 10:08 Go to previous messageGo to next message
Michel Cadot
Messages: 68634
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

It needs read/write/execute permissions on the directory pointed by %TEMP% variable which should be the case as many standard programs require them too.
It also requires you are able to execute an executable that is not provided by your enterprise (some blocks all .exe/.cmd/.bat that are not in a white list).

Re: McTnsping: a tnsping-like program for Windows [message #675768 is a reply to message #675763] Thu, 18 April 2019 01:34 Go to previous messageGo to next message
sloc
Messages: 8
Registered: January 2019
Junior Member
Hi again and thank you for the feedback.
Why does it need execute permissions on %TEMP%. That seems to be the issue for us.
The company policy only allows execution in program files(32-bit and 64-bit).

Re: McTnsping: a tnsping-like program for Windows [message #675769 is a reply to message #675768] Thu, 18 April 2019 01:51 Go to previous messageGo to next message
Michel Cadot
Messages: 68634
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

It needs it as it embeds all its needed environment to not rely on yours and not ask you to install stuffs and so has to put it in the %TEMP% directory.
I'm surprised you have no permissions on this directory (or maybe it is not correctly set) as many usual programs require it like Acrobat Reader, 7-Zip, MS Outlook logging or even Windows internal perflib/perfdata or Windows Update as well as Oracle installer...

Re: McTnsping: a tnsping-like program for Windows [message #675772 is a reply to message #675769] Thu, 18 April 2019 04:09 Go to previous messageGo to next message
sloc
Messages: 8
Registered: January 2019
Junior Member
The programs run under the User permissions, they can read and execute but not write in the installation directory and on TEMP the user is only allowed to read and write, but not EXECUTE.
The reason is that anyone could smuggle other programs (exe), copy them to the temp directory and execute them there.
is there any chance that the could redirect the temp directory, so that the installation directory would be used? Maybe over a parameter? I think that is maybe an exception I could negotiate.
Re: McTnsping: a tnsping-like program for Windows [message #675775 is a reply to message #675772] Thu, 18 April 2019 07:35 Go to previous messageGo to next message
Michel Cadot
Messages: 68634
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Set TEMP variable to another directory before launching McTnsping.

Re: McTnsping: a tnsping-like program for Windows [message #680190 is a reply to message #648221] Mon, 27 April 2020 11:32 Go to previous messageGo to next message
xerces8
Messages: 3
Registered: March 2011
Junior Member
I also have problems resolving names:

McTnsping my-server.my-domain.com:1521
McTnsping -s my-server.my-domain.com:1521
McTnsping -s my-server.my-domain.com

All return, in order:
*** Invalid server name or IP: my-server.my-domain.com:1521
*** Invalid server name or IP: my-server.my-domain.com:1521
*** Invalid server name or IP: my-server.my-domain.com

Using just the hostname (my-server) is the same:
*** Invalid server name or IP: my-server


ping and nslookup work fine, so it is not a problem with DNS.


The version is:
McTnsping Utility by Michel Cadot: Version 2019.01.31 on 27-APR-2020 18:31:30


Using the numerical IP address works fine.
Re: McTnsping: a tnsping-like program for Windows [message #680191 is a reply to message #680190] Mon, 27 April 2020 12:05 Go to previous messageGo to next message
Michel Cadot
Messages: 68634
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

My bad: "-" is missing in a regular expression.
A new version supporting 19c will come soon; the fix for this bug will be included.

Re: McTnsping: a tnsping-like program for Windows [message #680245 is a reply to message #680191] Thu, 30 April 2020 03:07 Go to previous messageGo to next message
Michel Cadot
Messages: 68634
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Program is fixed, new version is available to download.

McTnsping now supports Oracle version 19c.

Re: McTnsping: a tnsping-like program for Windows [message #681237 is a reply to message #648221] Mon, 29 June 2020 00:11 Go to previous messageGo to next message
Jeruschkat
Messages: 2
Registered: June 2020
Junior Member
Yet another bug report:
if port is specified before host, mctnsping claims "Invalid syntax in tns entry"

ERROR.DOMAIN.DE =(DESCRIPTION= (ADDRESS=(PROTOCOL=TCP)(PORT=1521)(HOST=db))(CONNECT_DATA=(SERVICE_NAME=DB)) )

WORKS.DOMAIN.DE =(DESCRIPTION= (ADDRESS=(PROTOCOL=TCP)(HOST=db)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=DB)) )
Re: McTnsping: a tnsping-like program for Windows [message #681238 is a reply to message #681237] Mon, 29 June 2020 00:15 Go to previous messageGo to next message
Michel Cadot
Messages: 68634
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Thanks for the report.
However it is not a bug, it is a program restriction as stated in the first post and help of the program:

McTnsping -h
Note: PORT must be after HOST in the tnsnames entry description (program restriction).

[Updated on: Mon, 29 June 2020 00:16]

Report message to a moderator

Re: McTnsping: a tnsping-like program for Windows [message #681309 is a reply to message #681238] Tue, 07 July 2020 03:22 Go to previous messageGo to next message
Michel Cadot
Messages: 68634
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

A new version is available to download (see link in the first post of this topic).
This version removes the restriction on the order of HOST and PORT parameters in the tnsnames.ora entry:

Example from the previous post:
C:\>McTnsping -dir e: -t WORKS.DOMAIN.DE

McTnsping Utility by Michel Cadot: Version 2020.07.07 on 07-JUIL.-2020 10:20:48

Copyright (c) Michel Cadot, 2016-2020. All rights reserved.

Using ping version 11

Used parameter files:
e:\tnsnames.ora

Found tnsnames.ora entry:
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=DB)))

Attempting to contact db:1521
TNS-12545: Connect failed because target host or object does not exist

C:\>McTnsping -dir e: -t ERROR.DOMAIN.DE

McTnsping Utility by Michel Cadot: Version 2020.07.07 on 07-JUIL.-2020 10:21:00

Copyright (c) Michel Cadot, 2016-2020. All rights reserved.

Using ping version 11

Used parameter files:
e:\tnsnames.ora

Found tnsnames.ora entry:
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(PORT=1521)(HOST=db))(CONNECT_DATA=(SERVICE_NAME=DB)))

Attempting to contact db:1521
TNS-12545: Connect failed because target host or object does not exist
Re: McTnsping: a tnsping-like program for Windows [message #681311 is a reply to message #681309] Tue, 07 July 2020 03:47 Go to previous messageGo to next message
Jeruschkat
Messages: 2
Registered: June 2020
Junior Member
thank you!
Re: McTnsping: a tnsping-like program for Windows [message #681433 is a reply to message #648221] Thu, 16 July 2020 12:59 Go to previous messageGo to next message
gseeley
Messages: 2
Registered: July 2020
Junior Member
It would be nice if McTnsping supported the same ERRORLEVEL return as the Oracle tnsping tool.

I call tnsping via batch script to check database(s) by DNS names used in TNSNames.ora and if ERRORLEVEL = 1 then there was no reply so next I check DNS to try and determine if the problem is DNS or network related. If ERRORLEVEL = 0 then I know the tnsping worked.

While this works well, it requires an Oracle (fat) client and I want to replace that with the Instant Client you just unzip and use but unfortunately it doesn't provide tnsping and that brought me here...
Re: McTnsping: a tnsping-like program for Windows [message #681434 is a reply to message #681433] Thu, 16 July 2020 13:28 Go to previous messageGo to next message
Michel Cadot
Messages: 68634
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Nice idea.
As far as I know tnsping returns 0 if ping is OK and 1 if not.
For tnsping it is clear as he checks only the first address of an entry.
But McTnsping checks all addresses, what should be the return code if some addresses are OK and others not?

[Edit: missing word]

[Updated on: Fri, 17 July 2020 00:25]

Report message to a moderator

Re: McTnsping: a tnsping-like program for Windows [message #681435 is a reply to message #681434] Thu, 16 July 2020 15:37 Go to previous messageGo to next message
gseeley
Messages: 2
Registered: July 2020
Junior Member
Right.

Given the fact that ERRORLEVEL is a single return value, I would say the logic to derive it's value from multiple checks should OR the results together so that if one check fails, the overall ERRORLEVEL is also failure (i.e. 1)

However, for a TNS entry with multiple servers (HA) then one server being up and the other down is a legitimate "state" so perhaps you need another switch that let's one control the behavior (AND/OR) on combining the results for ERRORLEVEL. Hope that makes sense...
Re: McTnsping: a tnsping-like program for Windows [message #681437 is a reply to message #681435] Fri, 17 July 2020 00:25 Go to previous messageGo to next message
Michel Cadot
Messages: 68634
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
That makes sense and this is why I posted the (open) question.
This needs some thoughts.
The new option/switch is a good idea and let the user choose how the program has to behave for him/her.

Thanks for this; I noted it in my todo list.

[Updated on: Fri, 17 July 2020 00:26]

Report message to a moderator

Re: McTnsping: a tnsping-like program for Windows [message #681468 is a reply to message #681437] Mon, 20 July 2020 12:25 Go to previous messageGo to next message
Michel Cadot
Messages: 68634
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

A new version is available to download (see link in the first post of this topic).

This version adds a new option on command line: -rc
This option tells what would be the return code of McTnsping in cases there are several addresses in a tnsnames.ora entry and some addresses work and others not (see first post for details).


[Updated on: Mon, 20 July 2020 12:27]

Report message to a moderator

Re: McTnsping: a tnsping-like program for Windows [message #683542 is a reply to message #648221] Thu, 28 January 2021 07:16 Go to previous messageGo to next message
krow7
Messages: 2
Registered: January 2021
Junior Member
Hi!

I wanted to try McTnsping on Windows 10 x64 but haven't succeeded so far
See:
C:\>echo %TNS_ADMIN%
C:\Oracle\tnsnames

C:\>sqlplus test/test@dev

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Jan 28 16:09:07 2021
Version 19.9.0.0.0

Copyright (c) 1982, 2020, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Release 11.2.0.4.0 - 64bit Production

SQL> exit
Disconnected from Oracle Database 11g Release 11.2.0.4.0 - 64bit Production

C:\>mctnsping dev

McTnsping Utility by Michel Cadot: Version 2020.07.20 on 28- эт-2021 16:09:29

Copyright (c) Michel Cadot, 2016-2020. All rights reserved.

*** Invalid tns entry name: dev

Usage 1: McTnsping.exe { <tns entry> | <host>:<port> } [<count>]
I have for sure "dev" tns record in my tnsnames.sql file which is located in %TNS_ADMIN% directory (equals to C:\Oracle\tnsnames).
As it is described on help message tnsnames file had to be used to determine what "dev" is.
The only reason that might affect is that my tnsnames.ora file was created as a link (mklink in Windows) but it's not an issue for sqlplus as you can see above.

Any help would be appreciated. If you need to be provided with some extra information feel free to ask.
Re: McTnsping: a tnsping-like program for Windows [message #683544 is a reply to message #683542] Thu, 28 January 2021 13:55 Go to previous messageGo to next message
Michel Cadot
Messages: 68634
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

This is very strange, the message comes from the checking parameters section far before I try anything with the configuration files.
What are your character sets, Windows and OEM (this one used by the DOS box: "chcp")?

I will PM you a new executable, you can use and give me the result.

Re: McTnsping: a tnsping-like program for Windows [message #683551 is a reply to message #683544] Fri, 29 January 2021 11:59 Go to previous messageGo to next message
Michel Cadot
Messages: 68634
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

The problem came from an hyphen in the service name.

It appears that Oracle does not follow its rules defined in Database Net Services Reference, section 3.4 Permitted Listener and Net Service Name Character Set:

Quote:
Listener names and net service names are limited to the following character set:
[a...z] [A...Z] [0...9] _
The first character in the listener name or net service name must be an alphanumeric character.

but more the ones defined in section 3.3 Network Character Set for Keywords.

So McTnsping now accepts service names starting with an alphanumeric character followed by zero or more characters in the following set (and you can actually connect with service names following this rule):
[a...z] [A...Z] [0...9] < > / \ : - _ $ + * & ! % ? @ . ;
(Some of them are meaningful shell characters, good luck for those who want to use them. Wink )

[Updated on: Fri, 29 January 2021 14:50]

Report message to a moderator

Re: McTnsping: a tnsping-like program for Windows [message #683561 is a reply to message #683551] Sun, 31 January 2021 03:27 Go to previous messageGo to next message
krow7
Messages: 2
Registered: January 2021
Junior Member
Thank you for fixed version! Now it works like magic!

However as far as I got it that rule
Quote:
[a...z] [A...Z] [0...9] _
applies only to Service Names and Listeners while what I pass to McTnsping (or regular tnsping) utility is parameter which is allowed to have hyphens in it.
But it's just my guess. I agree that it's not quite clear described on docs.oracle.com.
Re: McTnsping: a tnsping-like program for Windows [message #683562 is a reply to message #683561] Sun, 31 January 2021 06:20 Go to previous messageGo to next message
Michel Cadot
Messages: 68634
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

What I meant is that knowing Oracle stated some rules for service names, McTnsping checked that the given parameter satisfies these rules as the given parameter is a service name.

Now it checks against the posted extended character set.

Negative Values using McTnsping [message #685026 is a reply to message #648221] Tue, 12 October 2021 03:25 Go to previous messageGo to next message
MarkusBaer
Messages: 1
Registered: October 2021
Location: Germany
Junior Member
Hello,

i have a Problem using McTnsping. Sometimes i get negative Results on McTnsping. I use McTnsping in a DOS-Box with the following command:

mctnsping.exe <IP-ADRESS>:1521 1000 > TNSPING_%COMPUTERNAME%_01.log

Result:

McTnsping Utility by Michel Cadot: Version 2021.01.29 on 08-SEP-2021 15:00:44

Copyright (c) Michel Cadot, 2016-2021. All rights reserved.

Using ping version 11

Attempting to contact <IP-ADRESS>:1521
OK (11 msec)
OK (1 msec)
OK (2 msec)
OK (11 msec)
OK (-237 msec)
OK (12 msec)
OK (13 msec)

I don't know what this means. Can you help me? Thank you.

Markus Baer
Re: Negative Values using McTnsping [message #685027 is a reply to message #685026] Tue, 12 October 2021 03:58 Go to previous messageGo to next message
Michel Cadot
Messages: 68634
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Your post has been appended to McTnsping topic, please use this thread for all your remarks or reports to McTnsping.

It seems the internal time counter is fooled when the interval is too short.
This is now fixed, you will find the new version in tnsping wiki page.

[Updated on: Tue, 12 October 2021 07:53]

Report message to a moderator

Re: Negative Values using McTnsping [message #685279 is a reply to message #685027] Fri, 03 December 2021 11:22 Go to previous messageGo to next message
Michel Cadot
Messages: 68634
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

McTnsping now supports Oracle version 21c format.

Re: Negative Values using McTnsping [message #686316 is a reply to message #685279] Tue, 26 July 2022 02:25 Go to previous messageGo to next message
sloc
Messages: 8
Registered: January 2019
Junior Member
Hi again Michel,
Hope this finds you well Smile. As far as I know McTnsping does not support LDAP resolution. Do you have plans to support this?
Regards
Re: Negative Values using McTnsping [message #686317 is a reply to message #686316] Tue, 26 July 2022 06:26 Go to previous messageGo to next message
Michel Cadot
Messages: 68634
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

This is indeed in the todo list but no date.

Currently I'm busy renovating my house to sell it and move, so activity on my tools is "null".

Re: McTnsping: a tnsping-like program for Windows [message #686349 is a reply to message #686317] Fri, 12 August 2022 06:48 Go to previous messageGo to next message
namviet
Messages: 1
Registered: August 2022
Junior Member
Hi guys,

Thanks for sharing this application. I reached to this topic when finding the way to validate my ODAC driver installation. I need that ODAC for PowerBi Desktop connection to Oracle. However after installation of ODAC, PowerBI still can´t connect to Oracle. I wonder if my ODAC installation was successful.
I downloaded this tool McTnsping and run the test, result says OK:
C:\Users\xxx\Downloads\McTnsping>McTnsping -dir C:\Users\xxx\Downloads\McTnsping -t TTTT

McTnsping Utility by Michel Cadot: Version 2021.12.03 on 12-AUG-2022 12:59:13

Copyright (c) Michel Cadot, 2016-2021. All rights reserved.

Using ping version 11

Used parameter files:
C:\Users\xxx\Downloads\McTnsping\tnsnames.ora

Found tnsnames.ora entry:
(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(COMMUNITY=CENTRAL)(PROTOCOL=TCP)(HOST=company.com)(PORT=1530)))(CONNECT_DATA=(SID=TTTT)))

Attempting to contact company.com:1530
OK (380 msec)
Does this mean the ODAC driver was correctly configured or this application (McTnsping) has nothing to do with ODAC driver ?

Thank you,
namviet
Re: McTnsping: a tnsping-like program for Windows [message #686351 is a reply to message #686349] Fri, 12 August 2022 09:13 Go to previous messageGo to next message
Michel Cadot
Messages: 68634
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

McTnsping like Oracle tnsping just validates you can send a connection request to a remote instance service/sid defined by the parameters you give it.

Here you asked it to search for the net service name TTTT in the tnsnames.ora file residing in C:\Users\xxx\Downloads\McTnsping directory.
McTnsping returned that these parameters refer to an instance named TTTT residing in server company.com accessing it on port 1530 and told (status OK) you can send a connection request with these parameters.

It has nothing to do with your ODAC installation and configuration: it works on standalone and needs no Oracle or Oracle related products.

Now "can't connect" may refer to many errors network access, instance error, user error... you may create a topic to our Networking and Gateways forum specifying what you did and what Oracle error you got. Maybe the error comes from your PowerBi Desktop configuration, in this case I'm afraid we can't help you much.

Re: McTnsping: a tnsping-like program for Windows [message #687746 is a reply to message #686351] Tue, 23 May 2023 08:47 Go to previous messageGo to next message
sloc
Messages: 8
Registered: January 2019
Junior Member
Hi again

I wanted to ask if there are plans to support LDAP resolution with McTnsping.

Thank you again for the great work and support Smile
Re: McTnsping: a tnsping-like program for Windows [message #687747 is a reply to message #687746] Tue, 23 May 2023 09:00 Go to previous messageGo to next message
Michel Cadot
Messages: 68634
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

It should arrive in the early summer.

Re: McTnsping: a tnsping-like program for Windows [message #687856 is a reply to message #687747] Thu, 29 June 2023 09:19 Go to previous messageGo to next message
Michel Cadot
Messages: 68634
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

McTnsping now supports LDAP resolution method (using only an anonymous bind).

DESCRIPTION part of tns entry is now displayed in a pretty way instead of on a single line (see examples in the first post).

Next step (no date): support of IFILE in tnsnames.ora file.

Re: McTnsping: a tnsping-like program for Windows [message #687887 is a reply to message #687856] Tue, 11 July 2023 03:36 Go to previous message
Michel Cadot
Messages: 68634
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

McTnsping now supports IFILE in sqlnet.ora and tnsnames.ora.

Note that IFILE in these files is not documented and only partially supported (many bugs) by Oracle which recommends to not use it, thus the behavior of McTnsping may be different than Oracle's.

McTnsping (unlike Oracle) displays the files referenced in IFILE statements, indented.
Here's an example (tnsnames.ora from TNS_ADMIN calls foo1.ora which calls foo2 and foo3 (inexistent), and foo4 (inexistent) and in the end the standard tnsnames.ora; foo2 calls foo1 which creates a loop in IFILE calls):
C:\> McTnsping mikl

McTnsping Utility by Michel Cadot: Version 2023.07.11 on 11-JUIL.-2023 10:19:10

Copyright (c) Michel Cadot, 2016-2023. All rights reserved.

Using ping version 11

TNS_ADMIN set to e:\
ORACLE_HOME set to E:\oracle\ora11204

Used parameter files:
e:\sqlnet.ora

Used TNSNAMES adapter to resolve the alias:
e:\tnsnames.ora
  e:\foo1.ora
    e:\foo2.ora
      ** e:\foo1.ora: loop in IFILE, file skipped
    * foo3.ora: file not found
  * foo4.ora: file not found
  E:\Oracle\Ora11204\NETWORK\ADMIN\tnsnames.ora

Found entry:
(DESCRIPTION=
  (ADDRESS_LIST=
    (ADDRESS=
      (PROTOCOL=TCP)
      (HOST=10.0.0.3)
      (PORT=1538)))
  (CONNECT_DATA=
    (SERVICE_NAME=mikl.arda)
    (SERVER=DEDICATED)))

Attempting to contact 10.0.0.3:1538
OK (142 msec)
From my tests, Oracle does the same thing (about not found files and loops) but silently.

Note: if "-dir" option is not given, McTnsping now displays TNS_ADMIN and ORACLE_HOME values (if set).

Previous Topic: Explore the Oracle data dictionary with VISKey
Next Topic: Oracle Enterprise Manager plugin testers required
Goto Forum:
  


Current Time: Tue Apr 16 04:32:51 CDT 2024