How to view OracleStorage space of tables and Indexes
In biI often see the data size of a month.
The data size of a month includes two parts:
LThe storage space of the table's data volume;
LThe storage space of the corresponding index of this table.
Here is an SQL statement used to view the total Bucket:
SelectTo_char (sum_mb/(Select count (1)
From (select period_name
From f_sbu_allocate_result_sum t
Group by period_name)),
'999g999d999') sum_mb
From(Select Sum(Bytes)/(1024*1024) sum_mb
FromDba_extents
WhereOwner = 'amdm'
AndSegment_nameIn
('F _ sbu_allocate_result ', 'f _ sbu_allocate_result_all ',
'F _ sbu_allocate_result_sum ', 'f _ sbu_allocate_result_n3 ',
'F _ sbu_allocate_result_n2 ', 'f _ sbu_allocate_result_n ',
'F _ sbu_allocate_result_sum_u '))
The following describes how the preceding SQL statements are used:
First, look at the red part. This is an SQL statement used to calculate the month.
Then, the light blue part, the involved table, and the table index.
Of course, we still need to pay attention to the owner, which is mandatory and mainly used to differentiate users. Because different users may have tables with the same name or table indexes.
Of course, there are many ways to calculate tables and their indexes. Here is only one example.
For your reference.