Oracle 统计表空间和对象历史增长量

最近7天内 每天(某个)表空间的增长量

1col TS_NAME for a15 2SELECT a.snap_id, 3a.rtime, 4c.tablespace_name ts_name, 5round(a.tablespace_size * c.block_size / 1024 / 1024 / 1024, 2) TOTAL_SIZE_GB, 6round(a.tablespace_usedsize * c.block_size / 1024 / 1024 / 1024, 2) USED_SIZE_GB, 7round(a.tablespace_maxsize * c.block_size / 1024 / 1024 / 1024, 2) MAX_SIZE_GB, 8round((a.tablespace_size - a.tablespace_usedsize) * c.block_size / 1024 / 1024 / 1024, 2) FREE_SIZE_GB, 9round(a.tablespace_usedsize / a.tablespace_size * 100, 2) pct_used 10FROM dba_hist_tbspc_space_usage a, 11(SELECT tablespace_id, 12substr(rtime, 1, 10) rtime, 13max(snap_id) snap_id 14FROM dba_hist_tbspc_space_usage nb 15group by tablespace_id, substr(rtime, 1, 10)) b, 16dba_tablespaces c, 17v$tablespace d 18where a.snap_id = b.snap_id 19and a.tablespace_id = b.tablespace_id 20and a.tablespace_id = d.TS# 21and d.NAME = c.tablespace_name 22and d.NAME = 'USERS' 23and to_date(a.rtime, 'mm/dd/yyyy hh24:mi:ss') >= sysdate - 7 24order by a.tablespace_id, to_date(a.rtime, 'mm/dd/yyyy hh24:mi:ss') desc;

每个AWR快照间的(某个)表空间的增长量

1col TS_NAME for a15 2select distinct a.snap_id, 3a.rtime, 4d.NAME ts_name, 5round(a.tablespace_maxsize * c.block_size / 1024 / 1024 / 1024, 2) MAX_SIZE_GB, 6round(a.tablespace_size * c.block_size / 1024 / 1024 / 1024, 2) TOTAL_SIZE_GB, 7round(a.tablespace_usedsize * c.block_size / 1024 / 1024 / 1024, 2) USED_SIZE_GB, 8round((a.tablespace_size - a.tablespace_usedsize) * c.block_size / 1024 / 1024 / 1024, 2) FREE_SIZE_GB, 9round(a.tablespace_usedsize / a.tablespace_size * 100, 2) pct_used 10from DBA_HIST_TBSPC_SPACE_USAGE a, 11dba_hist_snapshot sn, 12dba_tablespaces c, 13V$TABLESPACE d 14where a.snap_id = sn.snap_id 15and d.TS# = a.TABLESPACE_ID 16and d.NAME = 'USERS' 17and sn.end_interval_time between to_timestamp('2019-12-01','YYYY-MM-DD') and to_timestamp('2019-12-02','YYYY-MM-DD') 18order by a.snap_id desc;

 某个表空间下的对象在某个AWR快照之间的增长量

1-- DELTA_USED_SIZE_GB 已用空间的增长量 2select distinct a.snap_id, 3to_char(sn.BEGIN_INTERVAL_TIME, 'YYYY-MM-DD hh24:mi:ss') BEGIN_TIME, 4to_char(sn.END_INTERVAL_TIME, 'YYYY-MM-DD hh24:mi:ss') END_TIME, 5b.name TBS_NAME, 6c.owner, 7c.object_name, 8c.object_type, 9round(a.space_used_total / 1024 / 1024 / 1024, 2) TOTAL_USED_SIZE_GB, 10round(a.space_used_delta / 1024 / 1024 / 1024, 2) DELTA_USED_SIZE_GB 11from dba_hist_seg_stat a, 12dba_hist_snapshot sn, 13V$TABLESPACE b, 14dba_hist_seg_stat_obj c 15where a.snap_id = sn.snap_id 16and a.obj# = c.obj# 17and a.TS# = b.TS# 18and b.NAME = 'USERS' 19and a.snap_id between 17958 and 17959 20order by DELTA_USED_SIZE_GB desc,a.snap_id desc;

在特定时间段的AWR快照之间的数据库对象的增长量

1select obj.owner, obj.object_name,obj.OBJECT_TYPE,a.TS#, 2to_char(sn.BEGIN_INTERVAL_TIME, 'YYYY-MM-DD hh24:mi:ss') BEGIN_TIME, 3to_char(sn.END_INTERVAL_TIME, 'YYYY-MM-DD hh24:mi:ss') END_TIME, 4round(a.space_used_delta / 1024 / 1024 / 1024, 2) DELTA_USED_SIZE_GB 5from dba_hist_seg_stat a, 6dba_hist_snapshot sn, 7dba_objects obj 8where sn.snap_id = a.snap_id 9and obj.object_id = a.obj# 10and obj.owner not in ('SYS','SYSTEM') 11and end_interval_time between to_timestamp('01-12-2019','DD-MM-RRRR') and to_timestamp('02-12-2019','DD-MM-RRRR') 12order by DELTA_USED_SIZE_GB desc,obj.owner, obj.object_name

最近七天数据库的增长情况,这个只是一个估算值

1select sum(space_used_total) / 1024 / 1024 / 1024 "last 7 days db increase - G" 2from dba_hist_seg_stat s, dba_hist_seg_stat_obj o, dba_hist_snapshot sn 3where s.obj# = o.obj# 4and sn.snap_id = s.snap_id 5and begin_interval_time > sysdate - 8 6order by begin_interval_time

表空间暴涨原因核查
http://blog.itpub.net/28389881/viewspace-1301550/

查看表空间每天增长和每周增长情况

http://blog.itpub.net/24500180/viewspace-1062905/

一文看懂Oracle查询表空间的每日增长量和历史情况统计

http://www.solves.com.cn/it/sjk/Oracle/2019-10-14/6070.html

点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

皕杰报表之UUID

​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

swap空间的增减方法

(1)增大swap空间去激活swap交换区:swapoff v /dev/vg00/lvswap扩展交换lv:lvextend L 10G /dev/vg00/lvswap重新生成swap交换区:mkswap /dev/vg00/lvswap激活新生成的交换区:swapon v /dev/vg00/lvswap