Skip to content
This repository has been archived by the owner on Feb 15, 2021. It is now read-only.

Commit

Permalink
Merge pull request #33 from amreo/master
Browse files Browse the repository at this point in the history
Added pmon presence check
  • Loading branch information
amreo committed Sep 30, 2019
2 parents 45b3f10 + 2096425 commit fc92c70
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fetch/dbstatus
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ export ORACLE_SID=$SID
export ORACLE_HOME=$HOME
export PATH=$HOME/bin:$PATH

RUNNING=$(ps -ef | grep pmon_$SID | grep -v grep | wc -l)
if [ "$RUNNING" -eq "0" ]; then
echo "unreachable!"
exit 0
fi


DB_STATUS=$(sqlplus -S / as sysdba << EOF
set pages 0 feedback off
select status from v\$instance;
Expand Down

0 comments on commit fc92c70

Please sign in to comment.