Partition Types
Partition Types
------------------------
1. Range Partition.
2. List Partition.
3. Hash Partition.
4. Sub Partition (Composite Partition).
Range Partition:
----------------
It is the most common type of partitioning and is often used with dates.
Example:
--------
List Partition:
---------------
List partitioning enables you to explicitly control how rows map to partitions.
You do this by specifying a list of discrete values for the partitioning key in
the description for
each partition.
Example:
-------
Hash Partition:
--------------
Hash partitioning enables easy partitioning of data that does not lend itself to
range or list
partitioning. It does this with a simple syntax and is easy to implement.
Example:
-------
Composite Partition:
--------------------
Composite partitioning partitions data using the range method, and within each
partition,
sub-partitions it using the hash or list method.
Index Partition:
----------------
This enables Oracle to automatically keep the index partitions in sync with the
table partitions,
and makes each table-index pair independent.
Any actions that make one partition's data invalid or unavailable only affect a
single partition.
You cannot explicitly add a partition to a local index. Instead, new partitions
are added to local
indexes only when you add a partition to the underlying table.
Likewise, you cannot explicitly drop a partition from a local index. Instead,
local index partitions
are dropped only when you drop a partition from the underlying table.
Example:
--------
CREATE INDEX invoices_idx ON invoices (invoice_date) LOCAL
(PARTITION invoices_q1 TABLESPACE users,
PARTITION invoices_q2 TABLESPACE users,
PARTITION invoices_q3 TABLESPACE users,
PARTITION invoices_q4 TABLESPACE users);
Global partitioned indexes are flexible in that the degree of partitioning and
the partitioningkey
are independent from the table's partitioning method.
They are commonly used for OLTP environments and offer efficient access to
anyindividual
record.
Example:
--------
ADD (HASH)
COALESCE (HASH)
DROP
EXCHANGE
MERGE
MOVE
SPLIT
TRUNCATE