Skip to content

Instantly share code, notes, and snippets.

@anthonywu
Created December 15, 2014 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anthonywu/4a02c3e58c28ddea134b to your computer and use it in GitHub Desktop.
Save anthonywu/4a02c3e58c28ddea134b to your computer and use it in GitHub Desktop.
Oracle db ping test
#!/bin/bash
if [ $# -lt 1 ]; then
echo "Usage: $(basename $0) <connection string>"
exit 1
fi
CONN_STRING=$1
sqlplus $CONN_STRING << EOF
select to_char(sysdate, 'YYYY-MM-DD') as "date" from dual;
exit;
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment