Skip to content

Instantly share code, notes, and snippets.

@booyaa
Created September 25, 2015 10:29
Show Gist options
  • Save booyaa/d4117948af04fdf54afc to your computer and use it in GitHub Desktop.
Save booyaa/d4117948af04fdf54afc to your computer and use it in GitHub Desktop.
tnsnames.ora entries checker
#!/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