ts2.ksh 552 B

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