P. 1
Partitioning 11g Whitepaper 159443

Partitioning 11g Whitepaper 159443

|Views: 0|Likes:
Published by Svr Ravi

More info:

Published by: Svr Ravi on May 12, 2014
Copyright:Traditional Copyright: All rights reserved


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





Partitioning in Oracle Database 11g

An Oracle White Paper
June 2007
The following is intended to outline our general product direction. It is intended
for information purposes only, and may not be incorporated into any contract. It is
not a commitment to deliver any material, code, or functionality, and should not
be relied upon in making purchasing decisions. The development, release, and
timing of any features or functionality described for Oracles products remains at
the sole discretion of Oracle.
Partitioning in Oracle Database 11g Page 2
Partitioning in Oracle Database 11g
Partitioning $ %oncepts..........................................................................&
'enefits of Partitioning .........................................................................&
'asics of Partitioning.........................................................................&
Partitioning for (anageability ...........................................................)
Partitioning for Performance .............................................................)
Partitioning for *vailability ...............................................................+
Partitioning $ (odeling for your 'usiness.............................................,
'asic Partitioning -trategies...............................................................,
Partitioning ./tensions.....................................................................10
Partition *dvisor..............................................................................11
Partitioning -trategies and ./tensions at a 1lance...........................1#
Information 2ifecycle (anagement with Partitioning..........................1#
Partitioning in Oracle Database 11g Page 3
Partitioning in Oracle Database 11g
Oracle Partitioning, first introduced in Oracle +.0 in 1,,), is one of the most
important and successful functionalities of the Oracle database, improving the
performance, manageability, and availability for tens of thousands of applications.
Oracle Database 11g introduces the +
generation of partitioning which continues
to offer ground4breaking new and enhanced functionality5 new partitioning
techni6ues enable customers to modeleven more business scenarios while a
complete new framework of partition advice and automationenables the usage of
Oracle Partitioning for everybody. Oracle Database 11g is considered the biggest
new release for partitioning since its first introduction, continuing to protect our
customers7 investment in partitioning for a decade.
Partitioning can provide tremendous benefits to a wide variety of applications by
improving manageability, performance, andavailability. It is not unusual for
partitioning to improve the performance of certain 6ueries or maintenance
operations by an order of magnitude. (oreover, partitioning can greatly reduce
the total cost of data ownership, using a 8tiered archiving9 approach of keeping
older relevant information still online on low cost storage devices. Oracle
Partitioning enables an efficient and simple, yet very powerful approach when
considering Information 2ifecycle (anagement for large environments.
Partitioning also enables database designers and administrators to tackle some of
the toughest problems posed by cutting4edge applications. Partitioning is a key
tool for building multi4terabyte systems or systems with e/tremely high
availability re6uirements.
asics o" Partitioning
Partitioning allows a table, inde/ or inde/4organi:ed table to be subdivided into
smaller pieces. .ach piece of the database ob;ect is called a partition. .ach
partition has its own name, and may optionally have its own storage
characteristics. <rom the perspective of a database administrator, a partitioned
ob;ect has multiple pieces that can be managed either collectively or individually.
This gives the administratorconsiderable fle/ibility in managing partitioned
Partitioning in Oracle Database 11g Page #
ob;ect. =owever, from the perspective of the application, a partitioned table is
identical to a non4partitioned table5 no modifications are necessary when
accessing a partitioned table using ->2 D(2 commands.
Figure 1: Application and DBA perspective of a partitioned table
Database ob;ects 4 tables, inde/es, and inde/4organi:ed tables 4 are partitioned
using a 7partitioning key7, a set of columns which determine in which partition a
given row will reside. <or e/ample the sales table shown in figure 1 is range4
partitioned on sales date, using a monthly partitioning strategy5 the table appears
to any application as a single, 7normal7 table. =owever, the D'* can manage and
store each monthly partition individually, potentially using different storage tiers,
applying table compression to the older data, or store complete ranges of older
data in read only tablespaces.
Irrespective of the chosen inde/ partitioning strategy, an inde/ is either coupled or
uncoupled with the underlying partitioning strategy of the underlying table. The
appropriate inde/ partitioning strategy is chosen based on the business
re6uirements, making partitioning well suited to support any kind of application.
Oracle Database 11g differentiates between three types of partitioned inde/es.
 Local Indexes: * local inde/ is an inde/ on a partitioned table that is
coupled with the underlying partitioned table, 7inheriting7 the partitioning
strategy from the table. %onse6uently, each partition of a local inde/
corresponds to one 4 and only one 4 partition of the underlying table. The
coupling enables optimi:ed partitionmaintenance5 for e/ample, when a
table partition is dropped, Oracle simply has to drop the corresponding
inde/ partition as well. !o costly inde/ maintenance is re6uired. 2ocal
inde/es are most common in data warehousing environments.
 Global Partitioned Indexes:* global partitioned inde/ is an inde/ on a
partitioned or non4partitioned table that is partitioned using a different
partitioning4key or partitioning strategy than the table. 1lobal4partitioned
inde/es can be partitioned using range or hash partitioning and are
uncoupled from the underlying table. <or e/ample, a table could be range4
partitioned by month and have twelve partitions, while an inde/ on that
table could be range4partitioned using a different partitioning key and have
Partitioning in Oracle Database 11g Page $
a different number of partitions. 1lobal partitioned inde/es are more
common for O2TP than for data warehousing environments.
 Global Non-Partitioned Indexes:* global non4partitioned inde/ is
essentially identical to an inde/ on a non4partitioned table. The inde/
structure is not partitioned and uncoupled from the underlying table. In data
warehousing environments, the most common usage of global non4
partitioned inde/es is to enforce primary key constraints. O2TP
environments on the other hand mostly rely on global non4partitioned
Oracle additionally provides a comprehensive set of ->2 commands for
managing partitioning tables. These include commandsfor adding new partitions,
dropping, splitting, moving, merging, truncating, and optionally compressing
Partitioning "or %anageabilit&
Oracle Partitioning allows tables and inde/es to be partitioned into smaller, more
manageable units, providing database administrators with the ability to pursue a
?divide and con6uer? approach to data management.
@ith partitioning, maintenance operations can be focused on particular portions of
tables. <or e/ample, a database administrator could compress a single partition
containing say the data for the year #00A of a table, rather than compressing the
entire table. <or maintenance operations across an entire database ob;ect, it is
possible to perform these operations on a per4partition basis, thus dividing the
maintenance process into more manageable chunks.
* typical usage of partitioning for manageability is to support a 7rolling window7
load process in a data warehouse. -uppose that a D'* loads new data into a table
on weekly basis. That table could be range4partitioned so that each partition
contains one week of data. The load process is simply the addition of a new
partition. *dding a single partition is much more efficient than modifying the
entire table, since the D'* does not need to modify any other partitions.
*nother advantage of using partitioning is when it is time to remove data, an
entire partition can be dropped which is very efficient and fast, compared to
deleting each row individually.
Partitioning "or Per"or'ance
'y limiting the amount of data to be e/amined or operated on, partitioning
provides a number of performance benefits. These features include"
 Partitioning Pruning" Partitioning pruning Ba.k.a. Partition eliminationC
is the simplest and also the most substantialmeans to improve
performance using partitioning. Partition pruning can often improve
6uery performance by several orders of magnitude. <or e/ample, suppose
an application contains an ODD.D- table containing an historical record
Partitioning in Oracle Database 11g Page (
of orders, and that this table has been partitioned by week. * 6uery
re6uesting orders for a single week would only access a single partition
of the ODD.D- table. If the table had # years of historical data, this
6uery would access one partition instead of 10E partitions. This 6uery
could potentially e/ecute 100/ faster simply because of partition pruning.
Partition pruning works with all of Oracle7s other performancefeatures.
Oracle will utili:e partition pruning in con;unction with any inde/ing
techni6ue, ;oin techni6ue, or parallel access method.
 Partition-wise Joins" Partitioning can also improve the performance of
multi4table ;oins, by using a techni6ue known as partition4wise ;oins.
Partition4wise ;oins can be applied when two tables are being ;oined
together, and at least one of these tables is partitioned on the ;oin key.
Partition4wise ;oins break a large ;oin into smaller ;oins of 7identical7 data
sets for the ;oined tables. 7Identical7 here is defined as covering e/actly
the same set of partitioning key values on both sides of the ;oin, thus
ensuring that only a ;oin of these 7identical7 data sets will produce a result
and that other data sets do not have to be considered. Oracle is using
either the fact of already BphysicalC e6ui4partitioned tables for the ;oin or
is transparently redistributing BF 8repartitioning9C one table at runtime to
create e6ui4partitioned data sets matching the partitioning of the other
table, completing the overall ;oin in less time. This offers significant
performance benefits both for serial and parallel e/ecution.
Partitioning "or A)ailabilit&
Partitioned database ob;ects provide partition independence. This characteristic of
partition independence can be an important part of a high4availability strategy. <or
e/ample, if one partition of a partitioned table is unavailable, all of the other
partitions of the table remain online and available. The application can continue to
e/ecute 6ueries and transactions against this partitioned table, and these database
operations will run successfully if they do not need to access the unavailable
The database administrator can specify that each partition be stored in a separate
tablespace5 this would allow the administrator to do backup and recovery
operations on each individual partition, independent of the other partitions in the
table. Therefore in the event of a disaster, the database could be recovered with
;ust the partitions comprising of the active data, and then the inactive data in the
other partitions could be recovered at a convenient time. Thus decreasing the
system down4time.
(oreover, partitioning can reduce scheduled downtime. The performance gains
provided by partitioning may enable database administrators to complete
maintenance operations on large database ob;ects in relatively small batch
Partitioning in Oracle Database 11g Page *
Oracle Database 11g provides the most comprehensiveset of partitioning
strategies, allowing a customer to optimally align the data subdivision with the
actual business re6uirements. *ll available partitioning strategies rely on
fundamental data distribution methodsthat can be used for either single Bone4
levelC or composite partitioned tables. <urthermore, Oracle provides a variety of
partitioning extensions, increasing the fle/ibility for the partitioning key
selection, providing automated partition creation as4needed, and advising on
partitioning strategies for non4partitioned ob;ects.
asic Partitioning Strategies
Oracle Partitioning offers three fundamental data distributionmethods that control
how the data is actually going to placed into the various individual partitions,
 ange: The data is distributed based on a range of values of the
partitioning key Bfor a date column as the partitioning key, the 7Ganuary4
#00)7 partition contains rows with the partitioning4key values between
7014G*!4#00)7 and 7314G*!4#00)7C. The data distribution is a continuum
without any holes and the lower boundary of a range is automatically
defined by the upper boundary of the preceding range.
 List: The data distribution is defined by a list of values of the partitioning
key Bfor a region column as the partitioning key, the 7!orth *merica7
partition may contain values 7%anada7, 7H-*7, and 7(e/ico7C. * special
7D.<*H2T7 partition can be defined to catch all values for a partition key
that are not e/plicitly defined by any of the lists.
 !ash: * hash algorithm is applied to the partitioning key to determine
the partition for a given row. Hnlike the other two data distribution
methods, hash does not provide any logical mapping between the data
and any partition.
Hsing the above4mentioned data distribution methods, a table can be partitioned
either as single or composite partitioned table"
 "ingle #one-le$el% Partitioning:* table is defined by specifying one of
the data distribution methodologies, using one or more columns as the
partitioning key. <or e/ample consider a table with a number column as
the partitioning key and two partitions 7lessIthanIfiveIhundred7 and
7lessIthanIthousand7, the 7lessIthanIthousand7 partition contains rows
where the following condition is true" &00 JF Partitioning key J1000.
Kou can specify Dange, 2ist, and =ash partitioned tables.
 &omposite Partitioning: * combination of two data distribution
methods are used to define a composite partitioned table. <irst, the table
is partitioned by data distribution method one and then each partition is
Partitioning in Oracle Database 11g Page -
further subdivided into subpartitions using a second data distribution
method. *ll sub4partitions for a given partition together represent a
logical subset of the data. <or e/ample, a range4hash composite
partitioned table is first range4partitioned, and then each individual range4
partition is further sub4partitioned using the hash partitioning techni6ue.
*vailable composite partitioningtechni6ues are range4hash, range4list,
range4range, list4range, list4list, and list4hash.
 Inde/4organi:ed tables BIOTsC can be partitioned using range, hash, and
list partitioning. %omposite partitioningis not supported for IOTs.
Partitioning E.tensions
In addition to the basic partitioning strategies, Oracle provides partitioning
e/tensions. The e/tensions in Oracle Database 11g mainly focus on two
BaC .nhance the manageability of a partitioned table significantly.
BbC ./tend the fle/ibility in defining a partitioning key.
The e/tensions are namely"
Inter$al Partitioning: * new partitioning strategy in Oracle Database 11g,
Interval partitioning e/tends the capabilities of the range method to define e6ui4
partitioned ranges using an interval definition. Dather than specifying individual
ranges e/plicitly, Oracle will create any partition automatically as4needed
whenever data for a partition is inserted for the very first time. Interval
partitioning greatly improves the manageability of a partitioned table. <or
e/ample, an interval partitioned table could be defined so that Oracle creates a
new partition for every month in a calendar year5 a partition is then automatically
created for 7-eptember #00)7 as soon as the first record for this month is inserted
into the database.
The available techni6ues for an interval partitioned table are Interval, Interval4
2ist, Interval4=ash, and Interval4Dange.
'( Partitioning: Oracle Database 11g allows to partition a table by leveraging
an e/isting parent4child relationship. The partitioning strategy of the parent table
is inherited to its child table without the necessity to store the parent7s partitioning
key columns in the child table. @ithout D.< Partitioning you have to duplicate all
partitioning key columns from the parent table to the child table if you want to
take advantage from the same partitioning strategy5 D.< Partitioning on the other
hand allows you to naturally partition tables according to the logical data model
without re6uiring to store the partitioning key columns, thus reducing the manual
overhead for denormali:ation and saving space. D.< Partitioning also
transparently inherits all partition maintenance operations that change the logical
shape of a table from the parent table to the child table. <urthermore, D.<
Partitioning automatically enables partition4wise ;oins for the e6ui4partitions of
Partitioning in Oracle Database 11g Page /
the parent and child table, improving the performance for this operation. <or
e/ample, a parent table ODD.D- is Dange partitioned on the ODD.DID*T.
column5 its child table ODD.D IT.(- does not contain the ODD.DID*T.
column but can be partitioned by reference to the ODD.D- table. If the ODD.D-
table is partitioned by month, all order items for orders in 7Gan4#00)7 will then be
stored in a single partition in the ODD.D IT.(- table, e6ui4partitioned to the
parent table ODD.D-. If a partition 7<eb4#00)7 is added to the ODD.D- table
Oracle will transparently add the e6uivalent partition to the ODD.D IT.(- table.
*ll basic partitioning strategies are available for D.< Partitioning.
)irtual column-based Partitioning" In previous versions of Oracle, a table could
only be partitioned if the partitioning key physically e/isted in the table. Lirtual
columns, a new functionality in Oracle Database 11g, removes that restriction
and allows the partitioning key to be defined by an e/pression, using one or more
e/isting columns of a table, and storing the e/pression as metadata only.
Partitioning has been enhanced to allow a partitioning strategy being defined on
virtual columns, thus enabling a more comprehensivematch of the business
re6uirements. It is not uncommon to see columns being overloaded with
information5 for e/ample a 10 digit account ID can include an account branch
information as the leading three digits. @ith the e/tension of virtual column4
based Partitioning, the *%%OH!T- table containing a column *%%OH!TIID
can be e/tended with a virtual BderivedC column *%%OH!TI'D*!%=that is
derived from the first three digits of the *%%OH!TIID column which becomes
the partitioning key for this table.
Lirtual column4based Partitioning is supported with all basic partitioning
Partition A0)isor
The ->2 *ccess *dvisor in Oracle Database 11g has been enhanced to generate
partitioning recommendations, in addition to the ones it already provides for
inde/es, materiali:ed views and materiali:ed view logs. Decommendations
generated by the ->2 *ccess *dvisor $ either for Partitioning only or holistically
4 will show the anticipated performance gains that will result if they are
implemented. The generated script can either be implemented manually or
submitted onto a 6ueue within Oracle .nterprise (anager.
@ith the e/tension of partitioning advice, customers not only can get
recommendation specifically for partitioning but also a more comprehensive
holistic recommendation of ->2 *ccess *dvisor, improving the collective
performance of ->2 statements overall.
The Partition *dvisor, integrated into the ->2 *ccess *dvisor, is part of Oracle7s
Tuning Pack, an e/tra licensable option. It can be used from within .nterprise
(anager or via a command line interface.
Partitioning in Oracle Database 11g Page 11
Partitioning Strategies an0 E.tensions at a Glance
The following table gives a conceptual overviewof all available basic partitioning
strategies in Oracle Database 11g"
Partitioning Strategy Data Distribution Sample Business Case
Range Partitioning Based on consecutive ranges of
 Orders table range
partitioned by order_date
List Partitioning Based on unordered lists of
 Orders table list partitioned
by country
Has Partitioning Based on a as algoritm.  Orders table as partitioned
by customer_id
Composite Partitioning
 Range!Range
 Range!List
 Range!Has
 List!List
 List!Range
 List!Has
Based on a combination of t"o
of te above!mentioned basic
tecni#ues of Range$ List$
Has$ and %nterval Partitioning
 Orders table is range
partitioned by order_date
and sub!partitioned by as
on customer_id
 Orders table is range
partitioned by order_date
and sub!partitioned by range
on sipment_date
In addition to the available partitioning strategies, Oracle Database 11g provides
the following partitioning e/tensions"
Partitioning &'tension Partitioning (ey Sample Business Case
%nterval Partitioning
 %nterval
 %nterval!Range
 %nterval!List
 %nterval!Has
)n e'tension to Range
Partition. Defined by an
interval$ providing e#ui!"idt
ranges. *it te e'ception of
te first partition all partitions
are automatically created on!
demand "en matcing data
 Orders table partitioned by
order_date "it a predefined
daily interval$ starting "it
R&1 Partitioning Partitioning for a cild table is
inerited from te parent table
troug a primary 2ey 3
foreign 2ey relationsip. 4e
partitioning 2eys are not stored
in actual columns in te cild
 5Parent6 Orders table range
partitioned by order_date
and inerits te partitioning
tecni#ue to 5cild6 order
lines table. Column
order_date is only present in
te parent orders table
7irtual column based
Defined by one of te above!
mentioned partition tecni#ues
and te partitioning 2ey is
based on a virtual column.
7irtual columns are not stored
on dis2 and only e'ist as
 Orders table as a virtual
column tat derives te sales
region based on te first
tree digits of te customer
account number. 4e orders
table is ten list partitioned
by sales region.
Partitioning in Oracle Database 11g Page 11
Today7s challenge of storing vast 6uantities of data for the lowest possible cost
can be optimally addressedusing Oracle Partitioning. The independence of
individual partitions is the key enabler for addressing the online portion of a
8tiered archiving9 strategy. -pecifically in tables containing historical data, the
importance 4 and access pattern $ of the data heavily relies on the age of the data5
Partitioning enables individual partitions Bor groups of partitionsC to be stored on
different storage tiers, providing different physical attributes and price points. <or
e/ample an Orders table containing # years worth of data could have only the
most recent 6uarter being stored on an e/pensive high4end storage tier and keep
the rest of the table Balmost ,0M of the dataC on an ine/pensive low cost storage
tier. Through Oracle Partitioning, the storage costs are reduced by factors Bcost
savings of &0M or more are not uncommonC, without impacting the end user
access, thus optimi:ing the cost of ownership for the stored information.
The Oracle I2( *ssistant which is a freely available tool downloadable from
OT!, can illustrate those cost savings, show you how to partition the table and
advise when it is time to move partitions to other storage tiers.
%onsidering the new and improved functionality for Oracle Partitioning, Oracle
Database 11g is the most significant release since the introduction of Oracle
Partitioning in 1,,). In every ma;or release, Oracle has enhanced the functionality
of Partitioning, by either adding new partitioning techni6ues, enhancing the
scalability, or e/tending the manageability and maintenance capabilities. Oracle
plans to continue to add new partitioning techni6ues to ensure that an optimal
partitioning techni6ue is available for every business re6uirement.
Partitioning is for everybody. Oracle Partitioning can greatly enhance the
manageability, performance, and availability of almost any database application.
Partitioning can be applied to cutting4edge applications and indeed partitioning
can be a crucial technology ingredient to ensure these applications success.
Partitioning can also be applied to more commonplace database applications in
order to simplify the administration and costs of managing such applications.
-ince partitioning is transparent to the application, it can be easily implemented
because no costly and time4consuming application changes are re6uired.
Partitioning in Oracle Database 11g Page 12
Partitioning in Oracle Database 11g
45ne 211*
A5t6or: 3er'ann aer
Contrib5ting A5t6ors:
Oracle Cor7oration
2orl0 3ea085arters
$11 Oracle Par9:a&
Re0:oo0 S6ores; CA /#1($
2orl0:i0e In85iries:
P6one: =1<($1<$1(<*111
!a.: =1<($1<$1(<*211
Co7&rig6t > 211*; Oracle< All rig6ts reser)e0<
T6is 0oc5'ent is 7ro)i0e0 "or in"or'ation 75r7oses onl& an0 t6e
contents 6ereo" are s5b?ect to c6ange :it6o5t notice<
T6is 0oc5'ent is not :arrante0 to be error@"ree; nor s5b?ect to an&
ot6er :arranties or con0itions; :6et6er e.7resse0 orall& or i'7lie0
in la:; incl50ing i'7lie0 :arranties an0 con0itions o" 'erc6antabilit&
or "itness "or a 7artic5lar 75r7ose< 2e s7eci"icall& 0isclai' an&
liabilit& :it6 res7ect to t6is 0oc5'ent an0 no contract5al obligations
are "or'e0 eit6er 0irectl& or in0irectl& b& t6is 0oc5'ent< T6is 0oc5'ent
'a& not be re7ro05ce0 or trans'itte0 in an& "or' or b& an& 'eans;
electronic or 'ec6anical; "or an& 75r7ose; :it6o5t o5r 7rior :ritten 7er'ission<
Oracle is a registere0 tra0e'ar9 o" Oracle Cor7oration an0Aor its a""iliates<
Ot6er na'es 'a& be tra0e'ar9s o" t6eir res7ecti)e o:ners<

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->