如何获取表增长历史记录信息? (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)又 ...
随机推荐
- ConcurrentHashMap(1.7)分析
1. 先来了解ConcurrentHashMap中的几个成员,当然大多数与HashMap中的相似,我们只看独有的成员 /** * The default concurrency level for ...
- SecureCRT远程连接The remote system refused the connection问题
今天用SecureCRT远程连接Linux(Centos 7)时,连不上,报错The remote system refused the connection.于是就百度,首先查看sshd服务有没有启 ...
- Linux下设置mysql允许远程连接
最近在Linux上安装了Mysql,然后在Windows环境下通过Navicat来连接时,出现报错:1045 Access denied for user 'root'@'XXX' (using pa ...
- ECMAScript 5 特性
ECMAScript 5 也称为 ES5 和 ECMAScript 2009. ECMAScript 5 特性 这些是 2009 年发布的新特性: "use strict" 指令 ...
- HALCON数据类型和C#对应数据类型的对比
摘要:HALCON数据类型:Iconic Variables(图形变量).Control Variables(控制变量).在C#中,图形变量用HObject声明,控制变量用HTuple声明.(halc ...
- centos7下安装客户端rabbitmq9.0
下载目前最新rabbitmq客户端版本: wget https://github.com/alanxz/rabbitmq-c/archive/v0.9.0.tar.gz php扩展 : wget ht ...
- Docker Compose部署GitLab服务,搭建自己的代码托管平台(图文教程)
场景 Docker-Compose简介与Ubuntu Server 上安装Compose: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/deta ...
- vue2y引入iview,在ie11报错的解决办法
在ie11中打开vue项目一片空白,F12打开控制台发现如下错误 只需要在build/webpack.base.conf.js中加一行代码即可
- vue如何debugger源码
在我们阅读vue源码时,一般引用vue的版本都是打包编译后的版本,无法debugger源码,要debugger源码,就需要给代码添加sourcemap,他存储源码与编译后代码的一种对应关系,详细内容可 ...
- DOMContentLoaded vs jQuery.ready vs onload, How To Decide When Your Code Should Run
At a Glance Script tags have access to any element which appears before them in the HTML. jQuery.rea ...