如何获取表增长历史记录信息? (Doc ID 1395195.1)
How To Get Table Growth History Information? (Doc ID 1395195.1)
APPLIES TO:
Oracle Database - Enterprise Edition - Version 10.2.0.1 to 12.1.0.2 [Release 10.2 to 12.1]
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Database Cloud Exadata Service - Version N/A and later
Information in this document applies to any platform.
GOAL
With AWR snapshots set up and running at regular intervals, e.g. every 15 or 30 minutes, how to get (recent) table growth history info?
使用AWR快照设置并定期运行,例如 每15或30分钟,如何获取(最近)表增长历史记录信息?
SOLUTION
To view the object (segment) growth in blocks, you can use the views dba_hist_seg_stat and dba_hist_snapshot like below.
要查看 object (segment) 中 blocks 的增长,可以使用如下所示的视图 dba_hist_seg_stat 和 dba_hist_snapshot 。
column owner format a16
column object_name format a36
column start_day format a11
column block_increase format 9999999999 select obj.owner, obj.object_name,
to_char(sn.BEGIN_INTERVAL_TIME,'RRRR-MON-DD') start_day,
sum(a.SPACE_USED_DELTA) block_increase_bytes
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-JAN-2012','DD-MON-RRRR')
and to_timestamp('02-FEB-2012','DD-MON-RRRR')
group by obj.owner, obj.object_name,
to_char(sn.BEGIN_INTERVAL_TIME,'RRRR-MON-DD')
order by obj.owner, obj.object_name
/
Please adapt the time interval and the rest of the query for your own needs. And block_increase_bytes can be negative number indicating that row data in the table might have been deleted / purged.
Sample output:
OWNER OBJECT_NAME START_DAY BLOCK_INCREASE
---------------- ------------------------------------ ----------- --------------
TEST FIR_FASTIGH 2012-JAN-26 128
TEST FIR_FASTIGH_FUNC 2012-JAN-26 64
TEST FIR_FASTIGH_FUNC1 2012-JAN-26 112
TEST FIR_FASTIGH_FUNC2 2012-JAN-26 112
TEST FIR_FASTIGH_FUNC4 2012-JAN-27 0
TEST XX 2012-JAN-30 16
...
如何获取表增长历史记录信息? (Doc ID 1395195.1)的更多相关文章
- 12C-使用跨平台增量备份减少可移动表空间的停机时间 (Doc ID 2005729.1)
12C - Reduce Transportable Tablespace Downtime using Cross Platform Incremental Backup (Doc ID 20057 ...
- C# 获取SqLite数据库表信息以及获取表内字段信息
#region 最新数据表信息显示事件 /// <summary> /// 最新数据表信息显示事件 /// </summary> /// <param name=&quo ...
- 使用 TSPITR 恢复删除的表空间的步骤 (Doc ID 1277795.1)
Steps To Recover A Dropped Tablespace Using TSPITR (Doc ID 1277795.1) APPLIES TO: Oracle Database - ...
- orcale获取表、字段信息
获取表字段: select * from user_tab_columns where Table_Name='用户表' order by column_name 获取表注释: select * fr ...
- Hive通过Jdbc获取表的字段信息
参考代码如下: /** * 按顺序返回字段 * desc table的返回结果形式如下: hive> describe ind01acoM; OK acq_ins_id_cd string cu ...
- MYSQL 获取表的列信息
SELECT COLUMN_NAME as '列名' ,DATA_TYPE as '字段类型' ,COLUMN_TYPE as '长度加类型' FROM information_schema.`COL ...
- mysql获取自增长插入行的ID
insert into {14}.SEGMENT(CODE_STARTPOINTID,CODE_STARTFIR,CODE_TYPE_START,CODE_ENDPOINTID,CODE_ENDFIR ...
- Checklist for an RMAN Restore (Doc ID 1554636.1)
Checklist for an RMAN Restore (Doc ID 1554636.1) APPLIES TO: Oracle Database - Enterprise Edition - ...
- SQLSERVER和ORACLE系统表获取表名 列名以及列的注释
在工作中从数据库取的数据要导出来,但是发现导出的EXCEL中列名都是字段名(英文),为此搜集资料怎么把字段名变为中文名称,而发现ORACLE和SQLSERVER(用的SQLSERVER2008R2)又 ...
随机推荐
- Python学习:50 行 Python 代码,带你追到最心爱的人
程序员世纪难题 人们一提到程序员第一反应就是:我知道!他们工资很高啊!但大部分都是单身狗,不懂得幽默风趣,只是每天穿格子 polo 衫的宅男一个.甚至程序员自己也这样形容自己:钱多话少死的早.程序员总 ...
- WPF使用FlowDocument实现图文混排
代码: <RichTextBox CaretBrush="#fff" Background="Transparent" BorderThickness=& ...
- Vue结合后台导入导出Excel问题详解后续
接前几天写的一篇博客 https://www.cnblogs.com/ttjm/p/11307462.html 在ie浏览器测试发现打不开,经调查问题如下 1 如果在本地开发调试,请求接口报错如下 ...
- JS---DOM---点击操作---part2---14个案例
案例1:点击按钮禁用文本框 <input type="button" value="禁用文本框" id="btn" /> < ...
- [ERR] Node 172.16.6.154:7002 is not empty. Either the node already knows other nodes (check with CLUSTER NODES) or contains some key in database 0.
关于启动redis集群时: [ERR] Node 172.168.63.202:7001 is not empty. Either the nodealready knows other nodes ...
- docker下MySQL的主从复制
MySql的主从复制 sudo docker pull MySQL:5.7 拉取MySQL的镜像文件(版本号为 5.7) sudo docker run -p 3339:3306 --name mas ...
- swiper手滑导航圆点不同步
// 滚动图 var mySwiper = new Swiper('.swiper-container', { // 如果需要分页器 pagination: { el: '.swiper-pagina ...
- C++ 进阶笔记之一
优化相关 使用灵活的.动态分配的数据,不要使用固定大小多数组: 优先使用线性算法或者尽可能快的算法: push_back 散列表查询:O(1) set/map lower_bound/upper_bo ...
- maven多仓库配置 公司仓库和阿里仓库
针对公司内网私服仓库,私服仓库不能访问外网,此时无法在私服仓库代理阿里的maven仓库.我们的maven就需要配置多个仓库: maven目录下的conf/settings.xml配置文件: 一.在pr ...
- [Go]TCP服务中读写进行协程分离
读写两部分进行一下分离,中间通过chan进行传递数据 ,这样可以方便的在write中进行一些业务处理 single/snet/tcpconn.go package snet import ( &quo ...