) create table #spt_space ( ) null, [rows] int null, ) null, ) null, ) null, ) null ) set nocount on declare c_tables cursor for select name from sysobjects where xtype = 'U' open c_tables fetch next from c_tables into @id begin /* Code from sp_space…
我们可以通过系统视图DBA_SEGMENTS.USER_SEGMETNS.DBA_TABLES来查看一个表所占空间的大小,如下所示: SELECT SEGMENT_NAME TABLE_NAME ,SUM(BLOCKS) BLOCKS ,SUM(BYTES)/(1024*1024) "TABLE_SIZE[MB]" FROM USER_SEGMENTS WHERE SEGMENT_TYPE='TABLE' AND SEGMENT_NAME=&TABLE_NAME GROUP B…