Oracle 查询表空间与表大小 有两种含义的表大小
一种是分配给一个表的物理空间数量,而不管空间是否被使用
可以这样查询获得字节数: select segment_name, bytes from user_segments where segment_type = 'TABLE'; 或者 Select Segment_Name,Sum(bytes)/1024/1024 From User_Extents Group By Segment_Name 另一种表实际使用的空间
这样查询: analyze table emp compute statistics; select num_rows * avg_row_len from user_tables where table_name = 'EMP'; 查看每个表空间的大小 Select Tablespace_Name,Sum(bytes)/1024/1024 From Dba_Segments Group By Tablespace_Name 1
查看剩余表空间大小 SELECT tablespace_name 表空间,sum(blocks*8192/1000000) 剩余空间 M FROM dba_free_space GROUP BY tablespace_name; 2
检查系统中所有表空间总体空间 select b
name,sum(a
bytes/1000000)总空间 from v$datafile a,v$tablespace b where a
ts# group by b
name; 1、查看 Oracle 数据库中表空间信息的工具方法: 使用 oracle enterprise manager console 工具,这是 oracle 的客户端工具