Oracle分區表range單分區


 

分區類型:rang、list、hash

sql語句:select partitioning_type, subpartitioning_type,partition_count from user_part_tables  where table_name ='RANGE_PART_TAB';

子分區:range-range、list-list、list-hash、list-range

分區總數:select partition_count from user_part_tables where table_name='表名';

 在哪一個列上建分區:

 select column_name, object_type, column_position from user_part_key_columns where name='RANGE_PART_TAB';

分區到底有多大:

select sum(bytes)/1024/1024 from user_segments where segment_name='RANGE_PART_TAB';

有多少個分區:

select partition_name,segment_type,bytes from user_segments where segment_name='RANGE_PART_TAB';

分區表的統計信息收集情況:

select table_name,partition_name,last_analyzed,partition_position,num_rows from user_tab_statistics t where table_name='RANGE_PART_TAB';

查該分區表有無索引,分別什么類型,全局索引是否失效,此外還可看統計信息收集情況:

select table_name,index_name,last_analyzed,blevel,num_rows,leaf_blocks,distinct_keys,status from user_indexes where table_name='RANGE_PART_TAB';

(N/A代表局部索引,否則就是全局索引)

分區表在哪些列上建了索引:

select index_name,column_name,column_position from user_ind_columns where table_name='RANGE_PART_TAB';

 

該分區表上的各索引分別有多大:

SQL> select segment_type,sum(bytes)/1024/1024 M  from user_segments where segment_name in (select index_name from user_indexes where table_name='RANGE_PART_TAB') group by segment_name,segment_type;

該分區表的索引段的分配情況:

select segment_name,partition_name,segment_type,bytes

  from user_segments

 where segment in (

   select index_name from user_indexes where table_name='RANGE_PART_TAB');

分區索引相關信息及統計信息、是否失效查看:

select t2.table_name,
          t1.index_name,
          t1.partition_name,
          t1.last_analyzed,
          t1.blevel,
          t1.num_rows,
          t1.leaf_blocks,
          t1.status
from user_ind_partitions t1, user_indexes t2
where t1.index_name = t2.index_name
and t2.table_name='RANGE_PART_TAB';

 

下一篇:range聯合分區


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM