oracle 了解表是如何分区的

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/44042706/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 03:25:40  来源:igfitidea点击:

Find out how is table partitioned

oraclepartitiondatabase-metadata

提问by kristofyk

Is there any way to find out, whether is table partitioned by Hash, Range or List in Oracle? I could not find such info in metadata tables.

有什么办法可以查明,oracle中的表是按Hash、Range还是List分区的?我在元数据表中找不到这样的信息。

Thanks for help.

感谢帮助。

回答by nop77svk

You haven't searched metadata tables enough.

您还没有充分搜索元数据表。

Connected to Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 
Connected as xxx@yyy

SQL> select owner, table_name, partitioning_type, subpartitioning_type
SQL> from all_part_tables
SQL> where owner = 'SYS'
SQL>     and rownum <= 10
SQL> ;

OWNER                                                                            TABLE_NAME                                                                       PARTITIONING_TYPE SUBPARTITIONING_TYPE
-------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ----------------- --------------------
SYS                                                                              AQ$_SUBSCRIBER_LWM                                                               HASH              NONE
SYS                                                                              WRH$_FILESTATXS                                                                  RANGE             NONE
SYS                                                                              WRH$_SQLSTAT                                                                     RANGE             NONE
SYS                                                                              WRH$_SYSTEM_EVENT                                                                RANGE             NONE
SYS                                                                              WRH$_WAITSTAT                                                                    RANGE             NONE
SYS                                                                              WRH$_LATCH                                                                       RANGE             NONE
SYS                                                                              WRH$_LATCH_CHILDREN                                                              RANGE             NONE
SYS                                                                              WRH$_LATCH_PARENT                                                                RANGE             NONE
SYS                                                                              WRH$_LATCH_MISSES_SUMMARY                                                        RANGE             NONE
SYS                                                                              WRH$_EVENT_HISTOGRAM                                                             RANGE             NONE
10 rows selected

SQL> 

You should be better off with using the user_part_tablesinstead of all_part_tables, and then please omit the owner = 'SYS'predicate from the whereclause.

最好使用user_part_tables代替all_part_tables,然后请省略子句中的owner = 'SYS'谓词where