tnsping: command not found
I want to test the listener of a database. But as I type the tnsping, it fails and show the error as follow:
Code:
-bash: tnsping: command not found |
"tnsping" is an Oracle command.
You need Oracle installed on your system, and you need the Oracle programs in your search path. To modify your $PATH, of course, you can edit your $HOME/.bashrc user environment initialization file. 'Hope that helps .. PSM |
Quote:
I've installed the oracle 10 client. But couldn't find the tnsping. Seems from oralce 10 no tnsping anymore? |
Quote:
Code:
env | grep ORACLE_HOME Code:
cd $ORACLE_HOME/bin Code:
PATH=$PATH:$ORACLE_HOME/bin ; export PATH |
tnsping implemented as ksh script
You probably have an Oracle Instant Client. That client install option does not come with the 'tnsping' command.
I think you can get 'sqlplus' command as an optional RPM package. Anyhow, I wrote my own 'tnsping' using a Korn shell script, which relies upon 'sqlplus' command being installed and tnsnames.ora file. Entries in tnsnames.ora are case-insensitive. We do a fake login (regit / tiger) with 'sqlplus' command and watch for the expected login error. If we get the login error, we display 'OK' along with how many milliseconds it took to run the 'sqlplus' attempt. If we get something else, we display that error (either ORA-xxxxx or TNS-xxxxx). This is intended to be a quick and dirty solution to my immediate need, on RHEL 8.7 If you find it useful, GREAT! Code:
#!/bin/ksh |
All times are GMT -5. The time now is 06:13 AM. |