DBA_SEGMENTS - 查看数据库对象所分配的物理存储空间

如何查看某个数据库对象(TABLE, INDEX ....)所占得物理存储空间

SELECT SEGMENT_NAME,SEGMENT_TYPE,TABLESPACE_NAME,EXTENTS,BLOCKS,BYTES/1024/1024/1024 GB
FROM DBA_SEGMENTS 
WHERE SEGMENT_NAME = Upper('MTL_MATERIAL_TRANSACTIONS');


Oracle逻辑结构全景结构图

Oracle 逻辑结构的相关数据字典:

SELECT * FROM DBA_TABLESPACES -- 记录各个表空间的详细信息
SELECT * FROM DBA_TABLESPACE_USAGE_METRICS -- 记录各个表空间的使用状况
SELECT * FROM DBA_DATA_FILES -- 记录各个数据文件的详细信息
SELECT * FROM DBA_SEGMENTS -- 记录各个段的详细信息,与 DBA_TABLES,DBA_INDEXES,DBA_LOBS,DBA_PART_TABLES,DBA_PART_INDEXES,DBA_PART_LOBS,DBA_OBJECTS 搭配使用
SELECT * FROM DBA_LOBS    --BLOB 字段所对应的字段名称
SELECT * FROM DBA_INDEXES -- 分区索引需要通过 DBA_INDEXS 来找到对应的表名
SELECT * FROM DBA_EXTENTS -- 记录各个区间对象的详细信息 

Question: What is the difference between dba_segments and dba_tables?
Answer: The dba_tables view describes a "logical" structure while dba_segments describes the "physical" data segment, like a data file.
Also, columns like "blocks" are different between dba_tables and dba_segments. In dba_tables, the "blocks" are calculated when you run dbms_stats, while in dba_segments, "blocks" is the actual number of blocks used by the object on disk.


Reference:http://baoqiangwang.blog.51cto.com/1554549/312705

http://dba-oracle.com/t_difference_dba_tables_dba_segments.htm


你可能感兴趣的:(DBA_SEGMENTS - 查看数据库对象所分配的物理存储空间)