Oracle 统计表空间和对象历史增长量
最近7天内 每天(某个)表空间的增长量
col TS_NAME for a15
SELECT a.snap_id,
a.rtime,
c.tablespace_name ts_name,
round(a.tablespace_size * c.block_size / 1024 / 1024 / 1024, 2) TOTAL_SIZE_GB,
round(a.tablespace_usedsize * c.block_size / 1024 / 1024 / 1024, 2) USED_SIZE_GB,
round(a.tablespace_maxsize * c.block_size / 1024 / 1024 / 1024, 2) MAX_SIZE_GB,
round((a.tablespace_size - a.tablespace_usedsize) * c.block_size / 1024 / 1024 / 1024, 2) FREE_SIZE_GB,
round(a.tablespace_usedsize / a.tablespace_size * 100, 2) pct_used
FROM dba_hist_tbspc_space_usage a,
(SELECT tablespace_id,
substr(rtime, 1, 10) rtime,
max(snap_id) snap_id
FROM dba_hist_tbspc_space_usage nb
group by tablespace_id, substr(rtime, 1, 10)) b,
dba_tablespaces c,
v$tablespace d
where a.snap_id = b.snap_id
and a.tablespace_id = b.tablespace_id
and a.tablespace_id = d.TS#
and d.NAME = c.tablespace_name
and d.NAME = 'USERS'
and to_date(a.rtime, 'mm/dd/yyyy hh24:mi:ss') >= sysdate - 7
order by a.tablespace_id, to_date(a.rtime, 'mm/dd/yyyy hh24:mi:ss') desc;
每个AWR快照间的(某个)表空间的增长量
col TS_NAME for a15
select distinct a.snap_id,
a.rtime,
d.NAME ts_name,
round(a.tablespace_maxsize * c.block_size / 1024 / 1024 / 1024, 2) MAX_SIZE_GB,
round(a.tablespace_size * c.block_size / 1024 / 1024 / 1024, 2) TOTAL_SIZE_GB,
round(a.tablespace_usedsize * c.block_size / 1024 / 1024 / 1024, 2) USED_SIZE_GB,
round((a.tablespace_size - a.tablespace_usedsize) * c.block_size / 1024 / 1024 / 1024, 2) FREE_SIZE_GB,
round(a.tablespace_usedsize / a.tablespace_size * 100, 2) pct_used
from DBA_HIST_TBSPC_SPACE_USAGE a,
dba_hist_snapshot sn,
dba_tablespaces c,
V$TABLESPACE d
where a.snap_id = sn.snap_id
and d.TS# = a.TABLESPACE_ID
and d.NAME = 'USERS'
and sn.end_interval_time between to_timestamp('2019-12-01','YYYY-MM-DD') and to_timestamp('2019-12-02','YYYY-MM-DD')
order by a.snap_id desc;
某个表空间下的对象在某个AWR快照之间的增长量
-- DELTA_USED_SIZE_GB 已用空间的增长量
select distinct a.snap_id,
to_char(sn.BEGIN_INTERVAL_TIME, 'YYYY-MM-DD hh24:mi:ss') BEGIN_TIME,
to_char(sn.END_INTERVAL_TIME, 'YYYY-MM-DD hh24:mi:ss') END_TIME,
b.name TBS_NAME,
c.owner,
c.object_name,
c.object_type,
round(a.space_used_total / 1024 / 1024 / 1024, 2) TOTAL_USED_SIZE_GB,
round(a.space_used_delta / 1024 / 1024 / 1024, 2) DELTA_USED_SIZE_GB
from dba_hist_seg_stat a,
dba_hist_snapshot sn,
V$TABLESPACE b,
dba_hist_seg_stat_obj c
where a.snap_id = sn.snap_id
and a.obj# = c.obj#
and a.TS# = b.TS#
and b.NAME = 'USERS'
and a.snap_id between 17958 and 17959
order by DELTA_USED_SIZE_GB desc,a.snap_id desc;
在特定时间段的AWR快照之间的数据库对象的增长量
select obj.owner, obj.object_name,obj.OBJECT_TYPE,a.TS#,
to_char(sn.BEGIN_INTERVAL_TIME, 'YYYY-MM-DD hh24:mi:ss') BEGIN_TIME,
to_char(sn.END_INTERVAL_TIME, 'YYYY-MM-DD hh24:mi:ss') END_TIME,
round(a.space_used_delta / 1024 / 1024 / 1024, 2) DELTA_USED_SIZE_GB
from dba_hist_seg_stat a,
dba_hist_snapshot sn,
dba_objects obj
where sn.snap_id = a.snap_id
and obj.object_id = a.obj#
and obj.owner not in ('SYS','SYSTEM')
and end_interval_time between to_timestamp('01-12-2019','DD-MM-RRRR') and to_timestamp('02-12-2019','DD-MM-RRRR')
order by DELTA_USED_SIZE_GB desc,obj.owner, obj.object_name
最近七天数据库的增长情况,这个只是一个估算值
select sum(space_used_total) / 1024 / 1024 / 1024 "last 7 days db increase - G"
from dba_hist_seg_stat s, dba_hist_seg_stat_obj o, dba_hist_snapshot sn
where s.obj# = o.obj#
and sn.snap_id = s.snap_id
and begin_interval_time > sysdate - 8
order 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
Oracle 统计表空间和对象历史增长量的更多相关文章
- Oracle表空间概述及其基本管理
最近在工作中遇到有同事对Oracle表空间的理解有问题,所以写了这篇文章.我会从概念,管理及特别需要关注的点等几个维度对表空间进行一些介绍.本文以介绍表空间为主,涉及到的其他概念不展开描述.有问题的地 ...
- Oracle表空间,用户,用户授权
一:Oracle表空间 1,Oracle表空间与SQL Server文件组对比 SQL Server的文件组(文件组包括若干MDF,NDF数据文件)对我们来说并不陌生,前段时间我在博客“怎样玩转千万级 ...
- ORACLE临时表空间
ORACLE临时表空间总结 2014-10-05 11:35 by 潇湘隐者, 临时表空间概念 临 时表空间用来管理数据库排序操作以及用于存储临时表.中间排序结果等临时对象,当ORACLE里需要用到S ...
- Oracle 表空间联机(online)与脱机(offline)
数据库管理员可以在数据库处于开启(open)状态时令除 SYSTEM 表空间(tablespace)之外的任何表空间联机(online)(可访问)或脱机(offline)(不可访问).SYSTEM 表 ...
- oracle表空间不足相关问题解决办法
欢迎和大家交流技术相关问题: 邮箱: jiangxinnju@163.com 博客园地址: http://www.cnblogs.com/jiangxinnju GitHub地址: https://g ...
- Oracle表空间不足
Oracle临时表空间不足 -- 用户的缺省表空间.临时表空间 select t.username, t.default_tablespace, t.temporary_tablespace from ...
- Oracle表空间管理
oracle表空间相关常用命令小结: 1.ALTER DATABASE SET DEFAULT BIGFILE TABLESPACE; //修改表空间数据文件类型 2.ALT ...
- 【转】Oracle 表空间与数据文件
--============================== --Oracle 表空间与数据文件 --============================== /* 一.概念 表空间:是一个或 ...
- oracle 表空间、用户名 相关语句
一.oracle查询表空间文件所在路径 select * from dba_data_files t where t.tablespace_name='FLW' 二.计算出表空间各相关数据 SELE ...
随机推荐
- 网页解析库-Xpath语法
网页解析库 简介 除了正则表达式外,还有其他方便快捷的页面解析工具 如:lxml (xpath语法) bs4 pyquery等 Xpath 全称XML Path Language, 即XML路径语言, ...
- mysql如何处理高并发(转)
mysql高并发的解决方法有:优化SQL语句,优化数据库字段,加缓存,分区表,读写分离以及垂直拆分,解耦模块,水平切分等. 高并发大多的瓶颈在后台,在存储mysql的正常的优化方案如下: (1)代码中 ...
- 基于V6的中移动物联测试例子,当前测试还挺稳定
下载: 链接:https://pan.baidu.com/s/1Gz8mEffDGXNSK8lIsAIUEg 提取码:2sur 测试步骤看此贴,跟V7开发板是一样的: 基于H7的中移动物联例子以及 ...
- APP 安全测试点概述
一.安装包测试 1.1 关于反编译 目的是为了保护公司的知识产权和安全方面的考虑等,一些程序开发人员会在源码中硬编码一些敏感信息,如密码.而且若程序内部一些设计欠佳的逻辑,也可能隐含漏洞,一旦源码 ...
- .NET Core 3.0 Preview 6中对ASP.NET Core和Blazor的更新
我们都知道在6月12日的时候微软发布了.NET Core 3.0的第6个预览版.针对.NET Core 3.0的发布我们国内的微软MVP-汪宇杰还发布的官翻版的博文进行了详细的介绍.具体的可以关注&q ...
- C lang:Pointer operation
Xx_Pointer opteration Do not dereference initialized Pointers Ax_Code #include<stdio.h> int ma ...
- MySQL相关参数总结
保留个原文链接,避免被爬虫爬了过去,以便后续更正补充:https://www.cnblogs.com/wy123/p/11273023.html MySQL参数繁多,是一个需要根据具体业务.软硬件环境 ...
- 解读并加工BeautifulReport 报告模板
使用unittest框架的脚本执行完成后,会生成一个html格式的报告 这个报告是提前制作了一个html的模板,然后将对应的内容写入到模板中,并生成一个最终的报告,这个报告模板在通过 pip inst ...
- Appium(二):Node.js下载与安装、非GUI版本appium下载与安装、GUI版本appium下载与安装
1. 下载并安装Node.JS 进入官网:https://nodejs.org/en/. 由于我们是新手嘛,所以肯定是越稳定越好啦,所以选择下载LTS版本. 进入文件下点击文件就进入安装界面了,点击n ...
- 关于ajax请求不到后台页面提示400 bad request的问题
解决方法一: 在contrller控制器中对应方法的 @RequestMapping注解中添加 method="RequestMethod.POST"属性