Oracle 数据库针对分区的信息,通过多个数据字典视图来维护,所以在获取信息时,经常会困惑 DBA 们。
例如,如何获取 分区索引的类型,如何判断一个索引,是 全局分区索引,还是本地分区索引?
通过 DBA_PART_INDEXES 中的 LOCALITY 字段就可以判断:
SQL> select distinct (locality) from dba_part_indexes; LOCALI ------ LOCAL
复制
LOCAL 意味着是本地索引;GLOBAL 则意味着是全局索引。
DBA_PART_INDEXES 和 ALL_PART_INDEXES、USER_PART_INDEXES 视图的字段相同,分别展示的是 数据库(DBA级别)、用户权限级别(ALL)和 用户所属级别(USER)的分区索引信息。
至于分区类型等,可以通过这个视图查询获得:
SQL> select TABLE_NAME,PARTITIONING_TYPE,LOCALITY from dba_part_indexes where rownum < 10; TABLE_NAME PARTITION LOCALI -------------------------------------------------- --------- ------ STREAMS$_APPLY_SPILL_MSGS_PART LIST LOCAL STREAMS$_APPLY_SPILL_MSGS_PART LIST LOCAL LOGMNRC_CONCOL_GG RANGE LOCAL LOGMNRC_CON_GG RANGE LOCAL LOGMNRC_CON_GG RANGE LOCAL LOGMNRC_CON_GG RANGE LOCAL LOGMNRC_GSBA RANGE LOCAL LOGMNRC_GSII RANGE LOCAL LOGMNRC_GTCS RANGE LOCAL
复制
视图信息引入如下,供参考:
Column | Datatype | NULL | Description |
---|---|---|---|
OWNER |
VARCHAR2(30) |
NOT NULL |
Owner of the partitioned index |
INDEX_NAME |
VARCHAR2(30) |
NOT NULL |
Name of the partitioned index |
TABLE_NAME |
VARCHAR2(30) |
NOT NULL |
Name of the partitioned table |
PARTITIONING_TYPE |
VARCHAR2(7) |
Type of partitioning method:
|
|
SUBPARTITIONING_TYPE |
VARCHAR2(7) |
Type of composite partitioning method:
|
|
PARTITION_COUNT |
NUMBER |
NOT NULL |
Number of partitions in the index |
DEF_SUBPARTITION_COUNT |
NUMBER |
For a composite-partitioned index, the default number of subpartitions, if specified | |
PARTITIONING_KEY_COUNT |
NUMBER |
NOT NULL |
Number of columns in the partitioning key |
SUBPARTITIONING_KEY_COUNT |
NUMBER |
For a composite-partitioned index, the number of columns in the subpartitioning key | |
LOCALITY |
VARCHAR2(6) |
Indicates whether the partitioned index is local (LOCAL ) or global (GLOBAL ) |
|
ALIGNMENT |
VARCHAR2(12) |
Indicates whether the partitioned index is PREFIXED or NON_PREFIXED |
|
DEF_TABLESPACE_NAME |
VARCHAR2(30) |
For a local index, the default tablespace to be used when adding or splitting a table partition | |
DEF_PCT_FREE |
NUMBER |
NOT NULL |
For a local index, the default PCTFREE value to be used when adding a table partition |
DEF_INI_TRANS |
NUMBER |
NOT NULL |
For a local index, the default INITRANS to be used when adding a table partition |
DEF_MAX_TRANS |
NUMBER |
NOT NULL |
For a local index, the default MAXTRANS to be used when adding a table partition |
DEF_INITIAL_EXTENT |
VARCHAR2(40) |
NOT NULL |
For a local index, the default INITIAL value (in Oracle blocks) to be used when adding a table partition, or DEFAULT if no INITIAL value was specified |
DEF_NEXT_EXTENT |
VARCHAR2(40) |
NOT NULL |
For a local index, the default NEXT (in Oracle blocks), or DEFAULT if no NEXT value was specified |
DEF_MIN_EXTENTS |
VARCHAR2(40) |
NOT NULL |
For a local index, the default MINEXTENTS value to be used when adding a table partition, or DEFAULT if no MINEXTENTS value was specified |
DEF_MAX_EXTENTS |
VARCHAR2(40) |
NOT NULL |
For a local index, the default MAXEXTENTS value to be used when adding a table partition, or DEFAULT if no MAXEXTENTS value was specified |
DEF_PCT_INCREASE |
VARCHAR2(40) |
NOT NULL |
For a local index, the default PCTINCREASE value to be used when adding a table partition, or DEFAULT if no PCTINCREASE value was specified |
DEF_FREELISTS |
NUMBER |
NOT NULL |
For a local index, the default FREELISTS value to be used when adding a table partition, or DEFAULT if no FREELISTS value was specified |
DEF_FREELIST_GROUPS |
NUMBER |
NOT NULL |
For a local index, the default FREELIST GROUPS value to be used when adding a table partition, or DEFAULT if no FREELIST GROUPS value was specified |
DEF_LOGGING |
VARCHAR2(7) |
For a local index, the default LOGGING attribute to be used when adding a table partition, or DEFAULT if no LOGGING attribute was specified |
|
DEF_BUFFER_POOL |
VARCHAR2(7) |
For a local index, the default buffer pool to be used when adding a table partition | |
DEF_PARAMETERS |
VARCHAR2(1000) |
Default parameter string for domain indexes |
最后修改时间:2020-04-10 15:56:07
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
相关阅读
【纯干货】Oracle 19C RU 19.27 发布,如何快速升级和安装?
Lucifer三思而后行
766次阅读
2025-04-18 14:18:38
Oracle RAC 一键安装翻车?手把手教你如何排错!
Lucifer三思而后行
649次阅读
2025-04-15 17:24:06
Oracle数据库一键巡检并生成HTML结果,免费脚本速来下载!
陈举超
575次阅读
2025-04-20 10:07:02
【ORACLE】你以为的真的是你以为的么?--ORA-38104: Columns referenced in the ON Clause cannot be updated
DarkAthena
526次阅读
2025-04-22 00:13:51
【活动】分享你的压箱底干货文档,三篇解锁进阶奖励!
墨天轮编辑部
521次阅读
2025-04-17 17:02:24
【ORACLE】记录一些ORACLE的merge into语句的BUG
DarkAthena
499次阅读
2025-04-22 00:20:37
一页概览:Oracle GoldenGate
甲骨文云技术
484次阅读
2025-04-30 12:17:56
火焰图--分析复杂SQL执行计划的利器
听见风的声音
452次阅读
2025-04-17 09:30:30
3月“墨力原创作者计划”获奖名单公布
墨天轮编辑部
381次阅读
2025-04-15 14:48:05
OR+DBLINK的关联SQL优化思路
布衣
374次阅读
2025-05-05 19:28:36