Yet another Wordpress weblog

Partitioning in Oracle

Partitioning enables tables and indexes or index-organized tables to be subdivided into smaller manageable pieces and these each small piece is called a “partition”.Tables are partitioned using a ‘partition key’, a set of columns which determine in which partition a given row will reside. Oracle 10g offers five techniques for partitioning the database. Each method of partitioning has its own advantages and disadvantages and the decision which one to use will depend on the data and type of application. Also one can MODIFY, RENAME, MOVE, ADD, DROP, TRUNCATE, SPLIT partitions.

Advantages of using Partition’s in Table:

Smaller and more manageable pieces of data (Partitions)

Reduced recovery time

Failure impact is less

Import / Export can be done at the “Partition Level”.

Faster access of data

Partitions work independent of the other partitions.

Very easy to use.

Types of Partitioning

Range Partitioning

Each partition is specified by using a range of values of the partition key. For a table with a date column as the partition key, the ‘January 2005’ partition contains rows with partition key values from ’01-Jan-2005’ to ’31-Jan-2005’.

List Partitioning

Each partition is specified by a list of values of the partition key. For a table with a region column as the partition key, the ‘North America’ partition may contain values ‘Canada’, ‘USA’ and ‘Mexico’.

Hash Partitioning

A hash algorithm is applied to the partition key to determine the partition for a given row.

Composite Range – Hash Partitioning

A combination of Range and Hash partitioning techniques, where a table is first range -partitioned and then each range partition is further partitioned using the hash partitioning technique.

Composite Range – List Partitioning

A table is first Range-partitioned and then each individual range-partition is further sub-partitioned using the list partitioning technique.