ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 备忘,巡检常用脚本

备忘,巡检常用脚本

原创 Linux操作系统 作者:great_li 时间:2010-08-22 23:47:49 0 删除 编辑

一:表空间使用率

set linesize 150
column file_name format a65
column tablespace_name format a20

select f.tablespace_name tablespace_name,round((d.sumbytes/1024/1024/1024),2) total_g,
round(f.sumbytes/1024/1024/1024,2) free_g,
round((d.sumbytes-f.sumbytes)/1024/1024/1024,2) used_g,
round((d.sumbytes-f.sumbytes)*100/d.sumbytes,2) used_percent
from (select tablespace_name,sum(bytes) sumbytes from dba_free_space group by tablespace_name) f,
(select tablespace_name,sum(bytes) sumbytes from dba_data_files group by tablespace_name) d
where f.tablespace_name= d.tablespace_name
order by d.tablespace_name;
二:自动扩展的表空间:
select FILE_NAME,AUTOEXTENSIBLE from dba_data_files;
 
三:归档的生成频率:
set linesize 120
column begin_time for a26
column end_time for a26
select a.recid,to_char(a.first_time,'yyyy-mm-dd hh24:mi:ss') begin_time,
b.recid,to_char(b.first_time,'yyyy-mm-dd hh24:mi:ss') end_time,
round((b.first_time - a.first_time)*24*60,2) minutes
from v$log_history a,v$log_history b
where b.recid = a.recid+1;

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7969839/viewspace-671597/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-03-27

  • 博文量
    59
  • 访问量
    85700