分享

Oracle监视表空间,并自动增加数据文件脚本

 昵称9283147 2016-08-10
       ALTER TABLESPACE DB_TABLESPACE ADD DATAFILE '/opt/oracle/oradata/DB/DB_DATA$sigNO.dbf' SIZE 500M AUTOEXTEND ON NEXT 50M;  
EOF  
# we need send email to report the tablespace stats info to check whether add data file successful  
      sqlplus -s "/as sysdba" <<\EOF   
        col tablespace_name for a30  
        col file_name for a60  
        col auto_extend for a12  
        col tablespace_name justify center  
        col file_name justify center  
        col autoextend justify right  
        set linesize 200  
        set pagesize 500  
        @/opt/bocc/sql/chktabspstats.sql  
        EXIT  
EOF  
# out put the disk space useage  
df -h  
fi  
#we will don't send email from there the crontab will do  
#  if [ `cat tablespace.alert|wc -l` -gt 0 ]  
#  then  
#    cat tablespace.alert >tablespace.tmp  
#  mailx -s "TABLESPACE ALERT for DB" YOUR_EMAIL_ADDRESS t  < tablespace.alert  
#  fi    

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多