2. www.company.com
What is partitioning?
When to partition a table?
Partitioning stratergies
Partitioning operations
Advantages of partitioning
Disadvantages of partitioning
What We'll Cover ...
3. www.company.com
What Is Partitioning ??
Partitioning allows tables, indexes to be subdivided into
smaller pieces.
Each piece of database object is called PARTITIONS.
Tables are partitioned using a 'PARTITION KEY', a set of
column/columns which determine in which partition a given row will
reside.
Company
LOGO
5. www.company.com
When to Partition a table???
โSlowโ queries ??
Tables containing historical data, in which new data is
added into newest partition.
When the contents of a table need to be distributed across
different types of storage devices.
Company
LOGO
7. www.company.com
1. Range Partitioning
It maps data into partition based on ranges of partition key
values.
Partitioning done based on consecutive range of values.
Ex : Partition sales data into monthly partitions.
Company
LOGO
10. www.company.com
2. Interval Partitioning
Extension of range partitioning.
Automatically create new partition when data inserted into
a table exceeds transition point.
TRANSITION POINT โ highest range partition.
You must specify atleast one range partition.
Company
LOGO
16. www.company.com
4. Hash Partitioning
Company
LOGO
Hash partitioning stores data to partitions based on a
hashing algorithm that oracle applies to the partitioning
key.
Distribution is handled by oracle.
Ex : order table โ partitioned by cust_id
Company
LOGO
23. www.company.com
Adding a Partition
Company
LOGO
1. ADDING PARTITIONS :
Range :
We can't add partition when maxvalue specified in range
partition.
We can't add partition for the lower ranges.
List :
We can't add partition when default specified in list partition
method.
Interval :
We can't add partitions.
Partitioning Operations
24. www.company.com
Dropping a Partition
Company
LOGO
2. DROPING PARTITIONS :
Syntax :
ALTER TABLE table_name DROP PARTITION
partition_name ;
Hash :
We can't drop partitions created by hash method.
Partitioning Operations
26. www.company.com
Splitting a Partition
Company
LOGO
4. SPLITTING PARTITIONS :
Syntax :
ALTER TABLE table_name SPLIT PARTITION
partition_name AT (value) INTO ( PARTITION
partition_name1 , PARTITION partition_name2);
Partitioning Operations
28. www.company.com
Merging a Partition
Company
LOGO
5. MERGING PARTITIONS :
Syntax :
ALTER TABLE table_name MERGE PARTITION
partition_name1,partition_name2 INTO PARTITION
partition_name3;
Partitioning Operations