#!/bin/bash #. /home/oracle/.bash_profile MOI=`basename ${0}` LANG=C ############# test_instance() { ps -ef | grep pmon_${ORACLE_SID}\$ | grep -v grep | grep -- ${ORACLE_SID} >/dev/null if [ $? -eq 1 ]; then return 1 else return 0 fi } usage() { cat << EOF usage: ${MOI} options This script show the Flash Recovery Area usage (if any) OPTIONS: -h Show this message -i Instance name (default \$ORACLE_SID) EOF } VERBOSE=0 while getopts "hi:" OPTION; do case ${OPTION} in h) usage exit 0 ;; i) ORACLE_SID=${OPTARG} ;; ?) usage exit 0 ;; esac done if [ -z "${ORACLE_SID}" ]; then echo "\$ORACLE_SID not set and no INSTANCE Supplied on the command line." exit 1 fi test_instance || { echo "Instance ${ORACLE_SID} not started !!"; exit 1 ; } # Set up the environment export ORACLE_SID export ORAENV_ASK=NO . oraenv -s >/dev/null SIZE=`${ORACLE_HOME}/bin/sqlplus -s / as sysdba <