ts3.ksh 468 B

123456789101112131415161718192021
  1. #!/bin/ksh
  2. export ORACLE_SID=${1}
  3. res=`sqlplus -s expman/expdp@${ORACLE_SID} <<-EOF
  4. SET ECHO OFF NEWP 0 SPA 0 PAGES 0 FEED OFF HEAD OFF TRIMS ON TAB OFF
  5. column bytes format 9999
  6. select trim(round(sum(bytes)/1024/1024/1024)) from dba_extents;
  7. exit;
  8. EOF`
  9. echo "${ORACLE_SID} DB Size is -${res}-."
  10. if [[ ${res} -ge 10 ]]
  11. then
  12. echo "${ORACLE_SID} DB greater than 10GB......"
  13. else
  14. echo "${ORACLE_SID} DB less than 10GB......"
  15. fi