Oracle 视图 DBA_FREE_SPACE_COALESCED 官方解释,作用,如何使用详细说明

本站中文解释

Oracle视图DBA_FREE_SPACE_COALESCED可以提供用户对数据库中空闲空间的总结信息,例如每个表空闲空闲大小、比例、空闲空闲的连续块大小等。用户可以利用该视图来分析是否需要给每个表扩大存储空间,调整空闲连续块大小避免单磁盘I/O操作,以保证高可用性。

使用方法:

1、查询某一表空闲大小和百分比:

SELECT SUM(BYTES) FREE_BYTES,
TO_CHAR( (SUM(BYTES)/(NUM_FREELISTS*FREELIST_GROUPS*c.VALUE))*100, ‘FM999999.00’ ) AS “Free Space %”
FROM DBA_FREE_SPACE_COALESCED a, SYS.obj$ b, SYS.col$ c
WHERE a. owner# = b.owner#
AND a.OBJ# = b.OBJ#
AND b.obj# = c.obj#
AND b.name = ‘TABLE_NAME’;

2、查询某一表有多少空闲存储块:

SELECT COUNT(DISTINCT FILE#) AS EMPTY_BLOCKS
FROM DBA_FREE_SPACE_COALESCED
WHERE owner# =USER#
AND OBJ# =(SELECT OBJ# FROM SYS.obj$ WHERE NAME =’TABLE_NAME’);

官方英文解释

DBA_FREE_SPACE_COALESCED describes statistics on coalesced space in all tablespaces in the database.

Column Datatype NULL Description

TABLESPACE_NAME

VARCHAR2(30)

Name of the tablespace

TOTAL_EXTENTS

NUMBER

Total number of free extents in the tablespace

EXTENTS_COALESCED

NUMBER

Total number of coalesced free extents in the tablespace

PERCENT_EXTENTS _COALESCED

NUMBER

Percentage of coalesced free extents in the tablespace

TOTAL_BYTES

NUMBER

Total number of free bytes in the tablespace

BYTES_COALESCED

NUMBER

Total number of coalesced free bytes in the tablespace

TOTAL_BLOCKS

NUMBER

Total number of free Oracle blocks in the tablespace

BLOCKS_COALESCED

NUMBER

Total number of coalesced free Oracle blocks in the tablespace

PERCENT_BLOCKS _COALESCED

NUMBER

Percentage of coalesced free Oracle blocks in the tablespace


数据运维技术 » Oracle 视图 DBA_FREE_SPACE_COALESCED 官方解释,作用,如何使用详细说明