如何获取表增长历史记录信息? (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)又 ...
随机推荐
- sparql 查询语句快速入门
介绍 RDF is a directed, labeled graph data format for representing information in the Web. RDF is ofte ...
- React 组件的生命周期方法
React 组件的生命周期方法 按渲染顺序: 1: componentWillMount() – 在渲染之前执行,在客户端和服务器端都会执行. 2: componentDidMount() – 仅在第 ...
- 数据库查询性能 LinqDB vs Sql查询
使用LinqDB查询Sqlite数据库数据,不管是大数据还是少量的数据,感觉特别耗时,尤其是首次查询 一个含有2.7万条数据的数据表 首次查询: 查询2.7万条数据,耗时1s 查询指定的1条数据,也要 ...
- 43.QT-访问远程SQLite数据库
在上章42.QT-QSqlQuery类操作SQLite数据库(创建.查询.删除.修改)详解学习了如何操作SQLite,本章来学习如何访问远程SQLite 1.首先设置共享,映射(用来实现远程访问) 将 ...
- Linux常用命令及详细说明 — 结合工作(侧重性能监控,包括CPU、内存、IO、网络、磁盘等)
(一)Linux监控的几个常用命令(对于服务器后端程序猿很重要,必须掌握): 命令 功能 命令 功能 iostat 统计CPU及网络.设备和分区IO的数据 vmstat 展示给定时间服务器的状态值(包 ...
- 如何在linux上有2个python的情况下安装gensim
安装python的问题 https://blog.51cto.com/liqingbiao/2083869 安装gensim https://blog.csdn.net/zhujiyao/articl ...
- sql server编写脚本求解第1天1分钱之后每天两倍持续一个月的等比数列问题
一.问题 问题1 场景:如果你未来的丈母娘要求你,第1天给她1分钱,第2天给2分钱,第3天给4分钱,以此类推,每天给前一天的2倍,给1个月(按30天)算就行.问:第30天给多少钱,总共给多少钱? 问题 ...
- Tornado—options.define()方法与options.options解读
tornado为我们提供了一个便捷的工具,tornado.options模块——全局参数定义.存储.转换. tornado是facebook开源的非阻塞web容器,类似java的netty,torna ...
- 搭建Harbor
搭建Harbor 一.安装准备 二.安装docker-ce 三.安装docker-compose 四.安装harbor 5.1下载安装程序 5.2配置harbor.yml 5.3运行install.s ...
- sass参考手册
http://sass.bootcss.com/docs/sass-reference/