ts1.ksh 641 B

123456789101112131415161718192021222324252627
  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 9999999
  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. DB_SIZE=`get_db_size`
  15. echo "DB_SIZE is ${DB_SIZE}." > /home/oracle/Scripts/DP/TS1.log
  16. if [[ ${DB_SIZE} -gt 10 ]]
  17. then
  18. echo "${ORACLE_SID} DB greater than 10GB......" >> /home/oracle/Scripts/DP/TS1.log
  19. else
  20. echo "${ORACLE_SID} DB less than 10GB......" >> /home/oracle/Scripts/DP/TS1.log
  21. fi