简体   繁体   English

Oracle 12c - 如何查看某个表的所有分区和子分区以及每个表的记录数

[英]Oracle 12c - how to see all partitions and sub-partitions for some table and number of records for each

I got to explore table 't1'.我必须探索表't1'。

How to see:如何查看:

  • All partitions and which column is being used for partitions所有分区以及用于分区的列
  • All sub-partitions and which column is being used for sub-partitions所有子分区以及哪个列用于子分区
  • Number of records for each partition and number of record for each sub-partition每个分区的记录数和每个子分区的记录数

This gives a good start but need more info (above):这提供了一个良好的开端,但需要更多信息(上图):

select * from ALL_PART_TABLES where table_name = 't1'

Thanks.谢谢。

The below query gives the number of rows in SUBPARTITION下面的查询给出了 SUBPARTITION 中的行数

select num_rows, PARTITION_NAME , SUBPARTITION_NAME 
  FROM ALL_TAB_SUBPARTITIONS
where table_name = 'yourtable';

The below query gives the number of rows in PARTITION and also the number of sub partitions.下面的查询给出了 PARTITION 中的行数以及子分区的数量。

select num_rows, PARTITION_NAME, SUBPARTITION_COUNT     
  FROM ALL_TAB_SUBPARTITIONS
where table_name = 'yourtable';

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM