#!/bin/ksh function get_db_size { res=`sqlplus -s expman/expdp@${ORACLE_SID} <<-EOF SET ECHO OFF NEWP 0 SPA 0 PAGES 0 FEED OFF HEAD OFF TRIMS ON TAB OFF column bytes format 9999 select round(sum(bytes)/1024/1024/1024) from dba_extents; exit; EOF` return ${res} } # --------------- export ORACLE_SID=${1} echo "DB Size is `get_db_size`....." if [[ `get_db_size` -ge 10000000000 ]] # if [[ 100 -ge 101 ]] then echo "${ORACLE_SID} DB greater than 10GB......" else echo "${ORACLE_SID} DB less than 10GB......" fi