Created
February 4, 2022 10:51
-
-
Save sgargel/e99ec8966c161545fd8eb5973683144d to your computer and use it in GitHub Desktop.
Oracle DB SQL Ping
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
| SQLCONN="user/pass@//db_ip:db_port/service_name" | |
| while true ; do OUT=$(echo "SELECT /*json*/ * FROM DUAL;" | sql -s $SQLCONN 2>&1) ; echo $OUT | jq -e '(.results[].items[].dummy == "X")' && (echo -e '\a'; echo "$(date) PONG" ; sleep 1) || (echo "$(date) : $OUT"; sleep 5); done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment