ts1.ksh 521 B

12345678910111213141516171819202122232425
  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 9999999999999
  7. select round(sum(bytes)/1024/1024/1024) from dba_extents;
  8. exit
  9. EOF`
  10. echo ${res}
  11. }
  12. # ---------------
  13. export ORACLE_SID=${1}
  14. if [[ `get_db_size` -ge 10000000000 ]]
  15. # if [[ 100 -ge 101 ]]
  16. then
  17. echo "${ORACLE_SID} DB greater than 10GB......"
  18. else
  19. echo "${ORACLE_SID} DB less than 10GB......"
  20. fi