ts.ksh 470 B

123456789101112131415161718192021222324
  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 sum(bytes) bytes from dba_extents;
  8. exit
  9. EOF`
  10. echo ${res}
  11. }
  12. # ---------------
  13. if [ `get_db_size` -gt 10000000000 ]
  14. then
  15. echo "Greater than......"
  16. # SIZE_FLAG="exclude=SCHEMA:\"in ('MDMADM','CCBADM')\""
  17. else
  18. echo "Less than...."
  19. fi