Created
September 25, 2015 10:29
-
-
Save booyaa/d4117948af04fdf54afc to your computer and use it in GitHub Desktop.
tnsnames.ora entries checker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ported from korn shell version | |
# original: http://orafaq.com/scripts/unix/cktnsnms.txt | |
grep -v -e '^ ' -e'^\t' -e'^$' -e '^#' -e'^)' tnsnames.ora | sed 's/=//g' | | |
while read NAME | |
do | |
OUT=$(tnsping $NAME | grep '^OK') | |
if [ "${?}" = "1" ]; then | |
echo "${NAME}: Unable to ping" | |
else | |
echo "${NAME} is alive" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment