tnsping command not found
This type of error message tnsping command not found in Linux or tnsping is not recognized as an internal or external command in Windows indicates that the command you issued is missing in ordinary execution directories. As a result, the shell does not recognize it. Let's see some more details.
[oracle@test ~]$ tnsping compdb
-bash: tnsping: command not found
The shell returned tnsping command not found.
'tnsping' is not recognized as an internal or external command,
operable program or batch file.
tnsping command not found means that the shell cannot find tnsping command in $PATH, you should add the path $ORACLE_HOME/bin to it.
[oracle@primary01 ~]$ echo $ORACLE_HOME
[oracle@primary01 ~]$ export PATH=$PATH:$ORACLE_HOME/bin
[oracle@primary01 ~]$ echo $PATH
To check the exact location of tnsping command, we can do this:
[oracle@primary01 ~]$ which tnsping
Actually, tnsping is not recognized as an internal or external command is a DOS shell error. DOS shell cannot recognize your command in any directories in %PATH% variable. That's because you have not append bin directory of Oracle Client to the environment variable %PATH%. You may check the variable like this:
You have to append the bin location of Oracle Client to the environment variable %PATH% in Windows or $PATH in Linux.