Here's what I did to copy `tnsping` over to another machine. In my case, the oracle client is installed at `C:\Oracle\product\12.1.0\client_1`.
This assumes there's already an Instant Client or similar installed on the destination machine; and that the oracle path and registry keys are set.
(1) Copy `tnsping.exe` from the source to the destination machine, into `client_1\bin`.
(2) Copy the following files from `client_1\bin` to `client_1\bin`:
oraasmclnt12.dll
oracell12.dll
oraclient12.dll
oraclsce12.dll
oracommon12.dll
oracore12.dll
orageneric12.dll
orahasgen12.dll
oraldapclnt12.dll
oran12.dll
orancds12.dll
orancrypt12.dll
oranhost12.dll
oranl12.dll
oranldap12.dll
oranls12.dll
oranro12.dll
orantcp12.dll
orantns12.dll
oraocr12.dll
oraocrb12.dll
oraocrutl12.dll
oraplp12.dll
orapls12.dll
ORASLAX12.DLL
orasnls12.dll
oraunls12.dll
orauts.dll
oravsn12.dll
oraxml12.dll
orazt12.dll
oraztkg12.dll
This should be about 84.6 MB.
(3) In the `client_1` on the destination machine, make a backup of the following files:
oci.dll
orannzsbb12.dll
oraons.dll
orasql12.dll
orawsec12.dll
Now on the source machine, find those files in `client_1\bin` and copy them to `client_1\` (no bin) on the destination machine, overwriting the existing files. (Note: oci.dll is ~330 kb smaller, orasql12.dll is ~300 kb smaller. I'm not sure what's lost, hence the backup).
(4) On the destination machine, create the directory `mesg` in `client_1\Network`. Now copy the following file from the source to the destination:
client_1\Network\mesg\tnsus.msb
(5) Open up regedit. Create the following key:
HKEY_LOCAL_MACHINE\SOFTWARE\Oracle\KEY_OraClient12Home1_32bit
(From another machine, it looks like the x64 version is named `HKEY_LOCAL_MACHINE\SOFTWARE\Oracle\KEY_OraClient12Home1`, but the `tnsping` program I'm using says it's 64 bit, so ...)
Under the key, create a string named `ORACLE_HOME` with the value `C:\Oracle\product\12.1.0\client_1`.
You should be done now (`$$$` = redacted):
C:\Users\$$$>tnsping $$$
TNS Ping Utility for 64-bit Windows: Version 12.1.0.2.0 - Production on 03-APR-2
019 08:47:37
Copyright © 1997, 2014, Oracle. All rights reserved.
Used parameter files:
C:\Oracle\product\12.1.0\client_1\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = $$$)(PORT = $$$))) (CONNECT_DATA = (SERVICE_NAME = $$$
$$$) (SERVER = DEDICATED)))
OK (30 msec)
-----
# Troubleshooting
Here's the process I followed, sharing for when these steps invariably fail to work on a later version.
First off, I just copied the `tnsping.exe` over.
I didn't haphazardly pick the above dlls, as far as I can tell everyone is required. I ran the exe, and it would popup an error, I would copy the dll over and try again:
[![missing from your computer][1]][1]
After a few dlls, you'll run into a different kind of error:
[![application unable to start][2]][2]
If that happens, fire up [process monitor](
[To see links please register here]
) and put a filter in for the ProcessName to contain `tnsping` and try to run the program again. You should see something like the following. The main thing to notice is that it tries to load (in this example) `orawsec12.dll`, which succeeds, but then it continues to try to load the dll looking in different paths, and then at the end it triggers `werfault` and the program ends. I guess it realizes there's some kind of version mismatch and keeps looking for the right version.
[![application unable to start][3]][3]
The missing registry key will show up like the following in process monitor (operation `RegOpenKey`, result `NAME NOT FOUND`):
[![registry name not found][4]][4]
If the `tnsus.msb` file is missing, you should see something like the following in process monitor (operation `CreateFile`, result `NAME NOT FOUND`):
[![filesystem name not found][5]][5]
[1]:
[2]:
[3]:
[4]:
[5]: