Skip to content
This repository has been archived by the owner on Aug 17, 2020. It is now read-only.

Commit

Permalink
Merge pull request #31 from amreo/master
Browse files Browse the repository at this point in the history
Added pmon presence check
  • Loading branch information
amreo authored Sep 30, 2019
2 parents 5367bba + 9e668bb commit 3b28551
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fetch/dbstatus
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ 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 3b28551

Please sign in to comment.