DBA_SEGMENTS 数据字典 块数量和发生变化情况
2012-07-25 16:11
239 查看
Oracle® Database Reference
10g Release 2 (10.2)
http://docs.oracle.com/cd/B19306_01/server.102/b14237/statviews_4097.htm
Related View
我查看下表:
HEADER_BLOCK 表示段头块的ID号 可别认为是段的整个块数了;
分析下表
analyze table REP_COMMON_STAT compute statistics;
说明:
为什么要收集统计信息,因为dba_tables 中的blocks 是只有收集统计信息以后才有值,而且对于empty_blocks 参数,还必须使用analyze 分析之后才有值。 如果使用dbms_stats.gather_table_stats收集,只能收集到blocks的值,empty_blocks 收集不到。
Dba_Segments .blocks = Dba_Tables.Blocks+Dba_Tables.Empty_Blocks +1(segment header block)
这个多加的1是,是segment header block.
如果查询的结果不是这样,可能是你没有分析表。 不妨分析表之后在查一下看看。
这两张表对blocks 的定义也不一样:
DBA_SEGMENTS.BLOCKS holds the total number of blocks allocated to the table.
USER_TABLES.BLOCKS holds the total number of blocks allocated for data.
删除表里的所有数据
trncate table rep_common_stat;
数据段的信息发生变化,数据表信息不发生变化.
BYTES 65536
BLOCKS 8
EXTENTS 1
10g Release 2 (10.2)
http://docs.oracle.com/cd/B19306_01/server.102/b14237/statviews_4097.htm
DBA_SEGMENTS
DBA_SEGMENTSdescribes the storage allocated for all segments in the database.
Related View
USER_SEGMENTSdescribes the storage allocated for the segments owned by the current user's objects. This view does not display the
OWNER,
HEADER_FILE,
HEADER_BLOCK, or
RELATIVE_FNOcolumns.
Column | Datatype | NULL | Description |
---|---|---|---|
OWNER | VARCHAR2(30) | Username of the segment owner | |
SEGMENT_NAME | VARCHAR2(81) | Name, if any, of the segment | |
PARTITION_NAME | VARCHAR2(30) | Object Partition Name (Set to NULLfor non-partitioned objects) | |
SEGMENT_TYPE | VARCHAR2(18) | Type of segment: INDEX PARTITION, TABLE PARTITION, TABLE, CLUSTER, INDEX, ROLLBACK, DEFERRED ROLLBACK, TEMPORARY, CACHE, LOBSEGMENTand LOBINDEX | |
TABLESPACE_NAME | VARCHAR2(30) | Name of the tablespace containing the segment | |
HEADER_FILE | NUMBER | ID of the file containing the segment header | |
HEADER_BLOCK | NUMBER | ID of the block containing the segment header | |
BYTES | NUMBER | Size, in bytes, of the segment | |
BLOCKS | NUMBER | Size, in Oracle blocks, of the segment | |
EXTENTS | NUMBER | Number of extents allocated to the segment | |
INITIAL_EXTENT | NUMBER | Size in bytes requested for the initial extent of the segment at create time. (Oracle rounds the extent size to multiples of 5 blocks if the requested size is greater than 5 blocks.) | |
NEXT_EXTENT | NUMBER | Size in bytes of the next extent to be allocated to the segment | |
MIN_EXTENTS | NUMBER | Minimum number of extents allowed in the segment | |
MAX_EXTENTS | NUMBER | Maximum number of extents allowed in the segment | |
PCT_INCREASE | NUMBER | Percent by which to increase the size of the next extent to be allocated | |
FREELISTS | NUMBER | Number of process freelists allocated to this segment | |
FREELIST_GROUPS | NUMBER | Number of freelist groups allocated to this segment | |
RELATIVE_FNO | NUMBER | Relative file number of the segment header | |
BUFFER_POOL | VARCHAR2(7) | Default buffer pool for the object |
SELECT * from dba_segments where segment_name like 'REP_COMMON_STAT'
OWNER ZMAS
SEGMENT_NAME REP_COMMON_STAT
PARTITION_NAME
SEGMENT_TYPE TABLE
TABLESPACE_NAME ZMAS_DATA
HEADER_FILE 56
HEADER_BLOCK 449579
BYTES 6291456
BLOCKS 768
EXTENTS 21
INITIAL_EXTENT 65536
NEXT_EXTENT
MIN_EXTENTS 1
MAX_EXTENTS 2147483645
PCT_INCREASE
FREELISTS
FREELIST_GROUPS
RELATIVE_FNO 6
BUFFER_POOL DEFAULTHEADER_FILE 表示在哪个ID的数据文件里;
HEADER_BLOCK 表示段头块的ID号 可别认为是段的整个块数了;
分析下表
analyze table REP_COMMON_STAT compute statistics;
说明:
为什么要收集统计信息,因为dba_tables 中的blocks 是只有收集统计信息以后才有值,而且对于empty_blocks 参数,还必须使用analyze 分析之后才有值。 如果使用dbms_stats.gather_table_stats收集,只能收集到blocks的值,empty_blocks 收集不到。
BACKED_UP N
NUM_ROWS 58
BLOCKS 748
EMPTY_BLOCKS 19
***G_SPACE 0
CHAIN_CNT 0
***G_ROW_LEN 71
Dba_Segments .blocks = Dba_Tables.Blocks+Dba_Tables.Empty_Blocks +1(segment header block)
这个多加的1是,是segment header block.
如果查询的结果不是这样,可能是你没有分析表。 不妨分析表之后在查一下看看。
这两张表对blocks 的定义也不一样:
DBA_SEGMENTS.BLOCKS holds the total number of blocks allocated to the table.
USER_TABLES.BLOCKS holds the total number of blocks allocated for data.
删除表里的所有数据
delete rep_common_stat;两个数据表里的信息不发生变更
trncate table rep_common_stat;
数据段的信息发生变化,数据表信息不发生变化.
BYTES 65536
BLOCKS 8
EXTENTS 1
相关文章推荐
- 11.Oracle杂记——数据字典dba_segments
- 设计一指导足球博彩的分类器,以某足球队过往的比赛情况作为学习数据,预测在将要发生的赛事里,它将会获胜或输掉比赛?
- 控制台打印的数据展开后发生变化
- JMeter特殊情况二:针对某些请求数据每次请求都是变化的情况
- 游戏与显卡、cpu与缓存数据,硬盘与数量,有人说玩绝地求生的显卡是好显卡,并不这样的情况。
- C语言中,将结构体指针传入函数后,内存地址没变,内存数据发生变化
- STP-生成树协议-在交换网络中,存在备份链路的情况,防止2层数据转发环路的发生。
- 使用迭代器遍历集合时,当集合中的数据发生变化是会抛出java.util.ConcurrentModificationException异常
- Unity编辑器重写Inspector面板,面板中编辑的数据不触发场景发生变化的问题。
- DBA学习笔记 - chapter 4 数据字典和控制文件(2)
- jquery 实现DataTable表格中,药品总价格随数量或单价的变化发生动态变化
- Android ListView避免在GetView时数据发生变化导致找不到元素的Bug
- 总结:不同编译器下——数据类型的长度变化情况
- 保存时检测窗体上控件中的数据是否发生变化 asp
- Facebook开源时间序列内存数据库Beringei,追求极致压缩率——如果是int根据大多数时间序列中的值与相邻数据点相比并没有显著的变化,只要使用XOR将当前值与先前值进行比较,然后存储发生变化的比特。最终,该算法将整个数据集至少压缩了90%
- (转)在.NET程序运行过程中,什么是堆,什么是栈?什么情况下会在堆(栈)上分配数据?它们有性能上的区别吗?“结构”对象可能分配在堆上吗?什么情况下会发生,有什么需要注意的吗?
- JMeter特殊情况二:针对某些请求数据每次请求都是变化的情况
- 检查form表单数据是否发生变化
- SBOLicense硬件码会发生变化的情况
- 获取数据库中的数据变化情况