oracle表空间查看脚本-成都创新互联网站建设

关于创新互联

多方位宣传企业产品与服务 突出企业形象

公司简介 公司的服务 荣誉资质 新闻动态 联系我们

oracle表空间查看脚本

#!/bin/bash
echo -e "\n\n*********~~~~~~~~~~~~~~~~~~~~~~~~~~~~DATE:" `date '+%Y/%m/%d   %T'` "~~~~~~~~~~~~~~~~~~~~~~~*********" >>/home/oracle/tablespace.log
export PATH=/opt/oracle/1102/db01/bin:$PATH
export ORACLE_HOME=/opt/oracle/1102/db01/
sqlplus -S /nolog <conn xx/xx@orcl
spool /home/oracle/tablespace.log append

set line 200;
set feedback off;
set pagesize 50000;
col member for a45;

select a.tablespace_name,a.summary,b.free,b.maxf "MAX_FREE_EXTENT",b.free_exts "FREE_EXTENTS",
    100-b.free/a.summary*100 "USED%"
        from
           (select tablespace_name,sum(bytes/1024/1024) "SUMMARY" from dba_data_files
               group by tablespace_name) a,
                   (select tablespace_name,sum(bytes/1024/1024) "FREE",max(bytes/1024/1024)
                      "MAXF" ,count(*) free_exts
                          from dba_free_space group by tablespace_name) b
                              where a.tablespace_name=b.tablespace_name
                                 order by 6 desc;
--col SQL_TEXT for a50
--select t.SQL_TEXT,t.VERSION_COUNT,t.SHARABLE_MEM from v\$sqlarea t where t.VERSION_COUNT>6;
                                 spool off;

eof
df -m >>/home/oracle/tablespace.log

                                 exit;

成都创新互联不只是一家网站建设的网络公司;我们对营销、技术、服务都有自己独特见解,公司采取“创意+综合+营销”一体化的方式为您提供更专业的服务!我们经历的每一步也许不一定是最完美的,但每一步都有值得深思的意义。我们珍视每一份信任,关注我们的成都网站设计、做网站、成都外贸网站建设公司质量和服务品质,在得到用户满意的同时,也能得到同行业的专业认可,能够为行业创新发展助力。未来将继续专注于技术创新,服务升级,满足企业一站式营销型网站建设需求,让再小的品牌网站制作也能产生价值!

######################################################

将上述内容保存到/tmp/tablespace.sh中

然后通过crontab  -l -u oracle命令新建计划任务如下:

1 * * * * /bin/bash  tmp/tablespace.sh

则每小时将会执行一次脚本,结果将会保存到home/oracle/tablespace.log中

######################################################

以上为在redhat6.4中验证


名称栏目:oracle表空间查看脚本
文章转载:http://kswsj.cn/article/johppe.html

其他资讯