Download as pdf or txt
Download as pdf or txt
You are on page 1of 53

<Insert Picture Here>

Oracle Partitioning – Yesterday, Today, and Tomorrow


Hermann Bär
Product Management, Oracle Partitioning
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 Oracle’s
products remain at the sole discretion of Oracle.
Agenda

• History and evolution of Oracle Partitioning


• Importance in BIWA environments
• Proven functionality in 7th generation
• Fundamental concepts for success
• Resolving some myths
• Upcoming new functionality
• “.. the biggest release since Oracle 8.0 ..”
• Q&A
Feature Usage for Large-Scale
Data Warehouses

Source: TB Club Report: A survey of 30+ multi-TB Oracle DW’s


How is Partitioning used?

Range

Range-
Hash

Hash

List

Range-List

0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Traditional Data Storage Approach

Data Lifecycle

Active
Active Less
Less Historical
Historical Archive
Archive
Active
Active
Data Lifecycle

High Performance Offline


Storage Tier Archive
Partitioning & Oracle ILM
Oracle Database 10g
with Partitioning Option

All Orders • Low Cost


Active
• Can use low crage to reduce
Q1 the cost of retaining data
High Performance
Orders Storage Tier
• Transparent to Applications
Q2 • Applications are unchanged
Orders • Enforceable Compliance
Q3 Less Active Policies
Low Cost
Orders Storage Tier • Sophisticated techniques to
define and enforce data
Q4 policies
Orders
• Fine Grained Control
• Lifecycle of groups of business
data is managed down to
Historical
Older
Online Archive
individual rows
Orders Storage Tier • Hardware Independent
Information Lifecycle Management

• ILM is a Data Management strategy designed to


• Reduce Cost of Retaining Data
• Comply with Legal, Regulatory, and Business Mandates

• From the database perspective, ILM is a set of


policies and techniques for Managing Data
• Managing data is Oracle’s core competency

• Oracle platform can be used to implement ILM


policies and techniques for business data
• Application of existing data management capabilities
Cost Savings by Storage Tier
Oracle Partitioning: 10 years of
development
Core functionality Performance Manageability
Oracle8 Range partitioning “Static” partition Basic maintenance
Global range indexes pruning operations: add,
drop, exchange
Oracle8i Hash and composite Partition-wise joins Merge operation
range-hash partitioning “Dynamic” pruning
Oracle9i List partitioning Global index
maintenance
Oracle9i R2 Composite range-list Fast partition split
partitioning

Oracle10g Global hash indexes Local Index


maintenance

Oracle10g R2 1M partitions per table “Multi-dimensional” Fast drop table


pruning
Oracle Partitioning: 10 years of
development
Core functionality Performance Manageability
Oracle8 Range partitioning “Static” partition Basic maintenance
Global range indexes pruning operations: add,
drop, exchange
Oracle8i Hash and composite Partition-wise joins Merge operation
range-hash partitioning “Dynamic” pruning
Oracle9i List partitioning Global index
maintenance
Oracle9i R2 Composite range-list Fast partition split
partitioning

Oracle10g Global hash indexes Local Index


maintenance

Oracle10g R2 1M partitions per table “Multi-dimensional” Fast drop table


pruning
Oracle11g Composite range-range Interval Partitioning
Composite list-range Partition Advisor
Composite list-list
Composite list-hash
REF Partitioning
Virtual ColumnPartitioning
Agenda

• History and evolution of Oracle Partitioning


• Importance in BIWA environments
• Proven functionality in 7th generation
• Fundamental concepts for success
• Resolving some myths
• Upcoming new functionality
• “.. the biggest release since Oracle 8.0 ..”
• Q&A
Fundamental Concepts for
Success

• While performance seems to be the most visible


one, don't forget about the rest, e.g.
• Partitioning must address all business-relevant areas of
Performance, Manageability, and Availability
• Partition autonomy is crucial
• Fundamental requirement for any partition maintenance
operations
• Acknowledge partitions as metadata in the data dictionary
Fundamental Concepts for
Success

• Provide full partition autonomy


• Use local indexes whenever possible
• Enable partition all table-level operations for partitions, e.g.
TRUNCATE, MOVE, COMPRESS
• Make partitions visible and usable for database
administration
• Partition naming for ease of use
• Maintenance operations must be partition-aware
• Also true for indexes
• Maintenance operations must not interfere with
online usage of a partitioned table
Agenda

• History and evolution of Oracle Partitioning


• Importance in BIWA environments
• Proven functionality in 8th generation
• Fundamental concepts for success
• Resolving some myths
• Upcoming new functionality
• “.. the biggest release since Oracle 8.0 ..”
• Q&A
Resolving some Myths

“Global Index maintenance is bad”


• Partition maintenance takes longer when global
indexes are updated
• Global index maintenance is incremental
• No complete rebuild
• Fully transparent
• Table and partition are not locked
• Continuous and transparent availability
Resolving some Myths

“Oracle cannot add or remove data from a


partitioned table”
• Oracle provides the most comprehensive set of data
add and removal operations
• DROP removes a partition, including data and metadata
• TRUNCATE provides a fast data removal, preserving the
metadata
• EXCHANGE provides the capability to exchange a partition
with a standalone table
• Preserves data for both sides of the exchange
• Fast data in
• Fast data out
Resolving some Myths

“Local indexes are not important and cannot


be used as primary or unique index”
• Local indexes are crucial for full partition autonomy
• Logical grouping of partition and index segments enables fast
maintenance operations
• Only local indexes enable full physical data separation for
partitioned objects
• Local indexes can be unique or primary keys
• Inclusion of partitioning key mandatory for local autonomy
• Most indexes are non-unique
Agenda

• History and evolution of Oracle Partitioning


• Importance in BIWA environments
• Proven functionality in 7th generation
• Fundamental concepts for success
• Resolving some myths
• Upcoming new functionality
• “.. the biggest release since Oracle 8.0 ..”
• Q&A
Future Directions
(OW 2004/2005 slide)
Extended Partitioning Strategies

• Partition techniques enable partitioning for your


business
• The more techniques the better
• Map your business process the most optimal way
• Oracle Database 11g enhances the existing
partitioning strategies significantly
• Extended composite partitioning strategies
• Virtual column based partitioning
• Interval Partitioning
• REF Partitioning
<Insert Picture Here>

Extended Composite
Partitioning
Composite Partitioning Strategies

• Two-dimensional partitioning schemes


• Extensions in Oracle Database 11g:
Range List Hash
Range 11g 9iR2 8i
List 11g 11g 11g

• Example:
• List-range:
• Partition by country, then by week
• Partition by line-of-business, then by week
• Already widely emulated today by customers
Composite Partitioning - Concept
Table SALES
RANGE(order_date)-RANGE(ship_date)

• All records with


Jan
2006 ... ... order_date in
March 2006
AND
Feb ship_date in
2006 ... ... May 2006
... ...
May
May
2006 ... ...
... ...
Jan 2006 Feb 2006 Mar2006
Mar 2006 Jan 2007
<Insert Picture Here>

Virtual Column based


Partitioning
Virtual Columns
Business Problem
• Extended Schema attributes are fully derived and
dependent on existing common data
• Redundant storage or extended view definitions are
solving this problem today
• Requires additional maintenance and creates overhead

Solution
• Oracle Database 11g introduces virtual columns
• Purely virtual, meta-data only
• Treated as real columns except no DML
• Virtual columns can have statistics
• Virtual columns are eligible as partitioning key
• Enhanced performance and manageability
Virtual Columns - Example
• Base table with all attributes ...

CREATE TABLE accounts


(acc_no number(10) not null,
acc_name varchar2(50) not null, ...

12500 Adams
12507 Blake
12666 King
12875 Smith
Virtual Columns - Example
• Base table with all attributes ...
• ... is extended with the virtual (derived) column

CREATE TABLE accounts


(acc_no number(10) not null,
acc_name varchar2(50) not null, ...
acc_branch number(2) generated always as
(to_number(substr(to_char(acc_no),1,2)))

12500 Adams 12
12507 Blake 12
12666 King 12
12875 Smith 12
Virtual Columns - Example
• Base table with all attributes ...
• ... is extended with the virtual (derived) column
• ... and the virtual column is used as partitioning key
CREATE TABLE accounts
(acc_no number(10) not null,
acc_name varchar2(50) not null, ...
acc_branch number(2) generated always as
(to_number(substr(to_char(acc_no),1,2)))
partition by list (acc_branch) ...

12500 Adams 12 32320 Jones 32


12507 Blake 12 32407 Clark 32
12666 King 12 ... 32758 Hurd 32
12875 Smith 12 32980 Phillips 32
<Insert Picture Here>

Interval Partitioning
Interval Partitioning

• Partitioning is key-enabling functionality for


managing large volumes of data Application

• One logical object for application transparency SQL


CDRs
• Multiple physical segments for Administration
• Improves Manageability, Availability, and
Performance Jan Mar
Feb

BUT
• Physical segmentation requires additional data
management overhead
• E.g. new partitions must be created on-time for new data

Automate the partition management


Interval Partitioning

• Interval Partitioning
• Extension to Range Partitioning
• Full automation for equi-sized range partitions
• Partitions are created as metadata information only
• Start Partition is made persistent
• Segments are allocated as soon as new data
arrives
• No need to create new partitions
• Local indexes are created and maintained as well

No need for any partition management


Interval Partitioning
• As easy as One, Two, Three ..
CREATE TABLE sales (order_date DATE, ...)
PARTITON BY RANGE (order_date)
INTERVAL(NUMTOYMINTERVAL(1,'month')
(PARTITION p_first VALUES LESS THAN ('01-JAN-2006');

Table SALES

... ... ...


Jan 2006 Feb 2006 Mar 2006 Jan 2007 Oct 2009 Nov 2009

First segment is created


Interval Partitioning
• As easy as One, Two, Three ..
CREATE TABLE sales (order_date DATE, ...)
PARTITON BY RANGE (order_date)
INTERVAL(NUMTOYMINTERVAL(1,'month')
(PARTITION p_first VALUES LESS THAN ('01-JAN-2006');

Table SALES

... ... ...


Jan 2006 Feb 2006 Mar 2006 Jan 2007 Oct 2009 Nov 2009

Other partitions only exist in metadata


Interval Partitioning
• As easy as One, Two, Three ..
CREATE TABLE sales (order_date DATE, ...)
PARTITON BY RANGE (order_date)
INTERVAL(NUMTOYMINTERVAL(1,'month')
(PARTITION p_first VALUES LESS THAN ('01-JAN-2006');

Table SALES

... ... ...


Jan 2006 Feb 2006 Mar 2006 Jan 2007 Oct 2009 Nov 2009

New segment is automatically allocated


INSERT INTO sales (order_date DATE,
...)
VALUES ('04-MAR-2006',...);
Interval Partitioning
• As easy as One, Two, Three ..
CREATE TABLE sales (order_date DATE, ...)
PARTITON BY RANGE (order_date)
INTERVAL(NUMTOYMINTERVAL(1,'month')
(PARTITION p_first VALUES LESS THAN ('01-JAN-2006');

Table SALES

... ... ...


Jan 2006 Feb 2006 Mar 2006 Jan 2007 Oct 2009 Nov 2009

... whenever data for a new partition arrives


INSERT INTO sales (order_date DATE,
...)
VALUES ('17-OCT-2009',...);
Interval Partitioning
• Interval partitioned table can have classical range and
automated interval section
• Automated new partition management plus full partition
maintenance capabilities: “Best of both worlds”

Table SALES

... ... ...


Jan 2006 Feb 2006 Mar 2006 Jan 2007 Oct 2009 Nov 2009
Interval Partitioning
• Interval partitioned table can have classical range and
automated interval section
• Automated new partition management plus full partition
maintenance capabilities: “Best of both worlds”

Table SALES

... ... ...


Jan 2006 Feb 2006 Mar 2006 Jan 2007 Oct 2009 Nov 2009
Range partition section

• MERGE and move old partitions for ILM


Interval Partitioning
• Interval partitioned table can have classical range and
automated interval section
• Automated new partition management plus full partition
maintenance capabilities: “Best of both worlds”

Table SALES

... ... ...


Jan 2006 Feb 2006 Mar 2006 Jan 2007 Oct 2009 Nov 2009
Range partition section Interval partition section

• MERGE and move old partitions for ILM


• Insert new data VALUES ('13-NOV-2009')
• - Automatic segment creation
Interval Partitioning
• Range partitioned tables can be extended into interval
partitioned tables
• Simple metadata command
• Investment protection

Table SALES

... ...
2005 Q1 2006 Q2 2006 Oct 2006
Interval Partitioning
• Range partitioned tables can be extended into interval
partitioned tables
• Simple metadata command
• Investment protection

Table SALES

... ... ...


2005 Q1 2006 Q2 2006 Oct 2006
Old range partition table New monthly
Interval partitions

ALTER TABLE sales (order_date DATE, ...)


SET INTERVAL(NUMTOYMINTERVAL(1,'month');
<Insert Picture Here>

REF Partitioning
REF Partitioning

Business Problem
• Related tables benefit from same partitioning strategy
• Sample order – lineitem
• Redundant storage of the same information solves
this problem
• Data overhead
• Maintenance overhead

Solution
• Oracle Database 11g introduces REF Partitioning
• Child table inherits the partitioning strategy of parent table
through PK-FK relationship
• Intuitive modelling
• Enhanced Performance and Manageability
Before REF Partitioning

Table ORDERS
• RANGE(order_date)
... ... • Primary key order_id

Jan 2006 Feb 2006

• Redundant storage of order_date


• Redundant maintenance
Table LINEITEMS
• RANGE(order_date)
... ... • Foreign key order_id
Jan 2006 Feb 2006
REF Partitioning

Table ORDERS
• RANGE(order_date)
... ... • Primary key order_id

Jan 2006 Feb 2006


PARTITION BY REFERENCE
• Partitioning key inherited through
PK-FK relationship
Table LINEITEMS
• RANGE(order_date)
... ... • Foreign key order_id
Jan 2006 Feb 2006
Oracle Partitioning

• Proven functionality in 7th generation


• Experience comes with age and customer usage
• Fundamental concepts for success
• The most comprehensive and complete offering
• There will be always myths
• .. and envious competitors
• Ground-breaking new functionality available soon
• 8th generation will be even better
Oracle Partitioning

• Proven functionality in 8th generation


• Experience comes with age and customer usage
• Fundamental concepts for success
• The most comprehensive and complete offering
• There will be always myths
• .. and envious competitors
• Ground-breaking new functionality available soon
• 9th generation will be even better
• There is always room for improvements
• Any ideas?? Email hermann.baer@oracle.com
The preceding 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 Oracle’s
products remain at the sole discretion of Oracle.
Oracle Business Intelligence,
Warehousing and Analytics (BIWA SIG)
Mission Statement
• BIWA, an IOUG SIG, represents a worldwide association of
professionals who use Oracle technology for the shared goal:
“Better Information Better Results”. The mission of BIWA SIG
shall be to serve as an open forum to foster success in the use and
development of Oracle BIWA products. BIWA’s goals include the
sharing of “best practices” and “novel and interesting use cases” of
Oracle BIWA-centric technology.
• Oracle Database, Oracle OLAP Option, Oracle Data Mining Option,
Partitioning Option, statistical functions, SQL Analytics, Oracle Text,
Oracle interMedia, regular expression searches, text mining, XML
Publisher, etc.
• Query and reporting tools, BI tools and BI dashboards including Oracle
BI SE, Oracle BI EE, and similar tools from Oracle ISVs and partners.
• BIWA community include business analysts, database
administrators, data analysts, third-party solution providers, and
developers of Oracle BIWA-centric products
BIWA Summit 2007
October 2-3, 2007, Oracle Corporation Reston VA, USA

• Call for Presentations!


• Send abstracts by June 15th, 2007 to conference@oraclebiwa.org
• BIWA themes: Transforming data to information for competitive advantage
—”Better Information Better Results”
• Data Access and Data Integration •Best Practices” & Case Studies
• Data quality •Advanced Analytics
• Extraction, transformation, & load • Predictive analytics
(ETL) • Data mining and text mining
• Accessing Distributed Data • OLAP - building and using “cubes”
• SOA integration • Statistical functions
• Managing Data Warehouses • Managing information from images
• “Best practices” • Dealing with spatial data
• Partitioning • Time series and forecasting
• Tuning your warehouse • Harvesting new insights
• Faster cubes • Mining unstructured data
• Basic Reporting and BI Dashboards • Fraud detection
• Better reports and better information • Market basket analysis
• Custom BI environments • Churn prevention
• Real-time analytics •Tips & Tricks
• Interactive dashboards
Q&
A
For More Information

http://search.oracle.com

Oracle Partitioning

or
http://www.oracle.com/

You might also like