This module examined Oracle's partitioning facility from first principles through practical maintenance — covering the foundational concepts, the data dictionary views used to monitor partitioned objects, the two index types available for partitioned tables, and the procedures for keeping those indexes healthy over time.
Partitioning addresses a class of performance and manageability problems that no amount of index tuning, SQL rewriting, or buffer cache sizing can solve: the problems that arise when a table or index becomes too large to operate on as a single unit. The divide-and-conquer approach that partitioning enables — independently manageable segments that appear as one logical object to SQL — is the foundation for scaling Oracle databases to enterprise data volumes.
The main points of this module are:
DBA_TAB_PARTITIONS and
DBA_IND_PARTITIONS.Lesson 1 — Tuning with Oracle Partitioning: Partitioning is the Oracle feature that addresses the performance and manageability challenges of very large databases. Four capabilities drive the performance benefit: partition pruning, parallel partition operations, independent partition management, and partition-level index management. Partitioning is transparent to the application — the same SQL works against partitioned and non-partitioned tables without modification. Oracle 23ai extends partitioning with interval partitioning, In-Memory Column Store integration at the partition level, and Automatic Indexing recommendations for large tables.
Lesson 2 — Oracle Partitioned Objects: Partitioning allows tables, indexes, and index-organized tables to be subdivided into partitions, each with its own name and optionally its own storage characteristics. Three primary partitioning strategies exist: range (for sequential or date-based data), hash (for even distribution without a natural range key), and composite (range primary with hash subpartitions). Interval partitioning automatically creates new partitions as data arrives. Partitioning is the foundational technology for Information Lifecycle Management — dropping a partition is an instantaneous metadata operation that resets the high water mark, compared to a DELETE that leaves the HWM elevated until a full reorganization.
Lesson 3 — DBA Views for Partitioned Objects: The primary data dictionary
views for partitioned tables are DBA_TAB_PARTITIONS, ALL_TAB_PARTITIONS,
and USER_TAB_PARTITIONS. Three columns in these views are the primary indicators for
deciding when to reorganize a partition: NUM_ROWS (to detect HWM elevation after large
DELETEs), AVG_ROW_LEN (to detect row migration from insufficient PCTFREE), and
CHAIN_CNT (to detect chained rows). Individual partitions can be reorganized with
ALTER TABLE ... MOVE PARTITION and their local indexes rebuilt with
ALTER INDEX ... REBUILD PARTITION — targeting only the affected partition without
taking the rest of the table offline.
Lesson 4 — Global Partitioned Indexes: A global partitioned index maintains a
single B-tree structure that indexes all rows across all table partitions. Because there is only one
index tree, index partition probes are minimized — making global indexes the preferred choice for
OLTP applications where single-row lookups dominate and queries do not always filter on the
partition key. The maintenance tradeoff is significant: when partition DDL is performed on the
underlying table (DROP, SPLIT, MERGE, MOVE), all partitions of the global index are potentially
affected. Use UPDATE GLOBAL INDEXES in the ALTER TABLE statement to keep the index
valid without a full rebuild. Without this clause, the global index is marked UNUSABLE and must be
rebuilt before it can serve queries.
Lesson 5 — Local Partitioned Indexes: A local partitioned index scopes each index partition to exactly the rows in its corresponding table partition. Creating a local index with the same partition key as the table — called equipartitioning — allows the optimizer to use partition-wise index access and eliminates cross-partition index probes for queries filtered on the partition key. Local indexes are the preferred choice for data warehouse and DSS workloads. Each local index partition can be rebuilt, moved, or recovered independently of the rest of the index. Partition maintenance operations that would require rebuilding an entire global index (DROP PARTITION, for example) are transparent to local indexes — the local index partition drops with its table partition automatically.
Lesson 6 — Partitioned Index Maintenance: Index partitions can become
fragmented or be marked UNUSABLE by bulk data loads or partition DDL. The primary maintenance
command is ALTER INDEX REBUILD PARTITION, which regenerates a single partition without
affecting others. The ONLINE clause keeps the partition usable throughout the rebuild. For composite
partitioned indexes, ALTER INDEX REBUILD SUBPARTITION extends this capability to the
subpartition level. Always specify the TABLESPACE clause when rebuilding — the tablespace must have
room for both the existing partition and the temporary segments for the new partition being built.
When choosing between rebuild and coalesce: rebuild creates a new index tree and can move the index
to a different tablespace; coalesce frees leaf blocks within the existing tree without requiring
additional disk space.
Partitions can be used to isolate data physically and to tune data manipulation operations at a granularity that is not possible with non-partitioned tables. Practical applications include:
ALTER TABLE ... DROP PARTITION — an instantaneous
metadata operation that immediately reclaims space and resets the partition HWM.EXCHANGE PARTITION to load data into a non-partitioned staging table,
validate it, and then exchange the staging table into the partitioned table as a new partition
— an instantaneous metadata swap with no data movement.From a performance perspective, the chief advantage of partitions is their ability to be managed independently from the rest of the table. Truncating a partition avoids generating redo information for deleted rows and does not raise the HWM. Dropping a partition eliminates the need for DELETE statements on large data volumes and immediately reclaims the storage. The EXCHANGE PARTITION pattern reduces data-loading downtime to near zero for rolling window implementations in data warehouses.
Having completed this module, you should now be able to:
DBA_TAB_PARTITIONS, ALL_TAB_PARTITIONS, and
USER_TAB_PARTITIONS to monitor partition health and determine when to
reorganize.ALTER INDEX REBUILD PARTITION,
ALTER INDEX REBUILD SUBPARTITION, and the UPDATE GLOBAL INDEXES
clause on partition DDL statements.