SQL> select partition_name,
2 sum(case when segment_type like 'TABLE%' then bytes else 0 end)/1024/1024 as data_size,
3 sum(case when segment_type like 'INDEX%' then bytes else 0 end)/1024/1024 as index_size,
4 sum(bytes)/1024/1024 as full_size
5 from user_segments
6 where partition_name='P20051408.01'
7 group by partition_name
8 /
PARTITION_NAME DATA_SIZE INDEX_SIZE FULL_SIZE
------------------------------ ---------- ---------- ----------
P20051408.01 31 38.3125 69.3125
Elapsed: 00:00:00.08
SQL>
SQL> alter table ama add partition "P01.2005081402" values ('01.2005081402')
2 /
Table altered.
Elapsed: 00:00:14.95
SQL> update ama set ama_file='01.2005081402' where ama_file='20051408.01'
2 /
639886 rows updated.
Elapsed: 00:53:16.48
SQL> alter table ama drop partition "P20051408.01"
2 /
Table altered.
Elapsed: 00:05:43.12
SQL>
SQL> select partition_name,
2 sum(case when segment_type like 'TABLE%' then bytes else 0 end)/1024/1024 as data_size,
3 sum(case when segment_type like 'INDEX%' then bytes else 0 end)/1024/1024 as index_size,
4 sum(bytes)/1024/1024 as full_size
5 from user_segments
6 where partition_name='P01.2005081402'
7 group by partition_name
8 /
PARTITION_NAME DATA_SIZE INDEX_SIZE FULL_SIZE
------------------------------ ---------- ---------- ----------
P01.2005081402 53 42.8125 95.8125
Elapsed: 00:00:01.92
|