Oracle Partitioning in Oracle Database 11g
Oracle Partitioning in Oracle Database 11g
Oracle Partitioning
Ten Years of Development
Core functionality Performance Static partition pruning Partition-wise joins Dynamic pruning Manageability Basic maintenance operations: add, drop, exchange Merge operation Global index maintenance Fast partition split Local Index maintenance Multi-dimensional pruning Fast drop table
Oracle8
Range partitioning Global range indexes Hash and composite range-hash partitioning List partitioning Composite range-list partitioning Global hash indexes 1M partitions per table
Oracle Partitioning
Ten Years of Development
Core functionality Performance Static partition pruning Partition-wise joins Dynamic pruning Manageability Basic maintenance operations: add, drop, exchange Merge operation Global index maintenance Fast partition split Local Index maintenance Multi-dimensional pruning Fast drop table Interval Partitioning Partition Advisor
Oracle8
Range partitioning Global range indexes Hash and composite range-hash partitioning List partitioning Composite range-list partitioning Global hash indexes 1M partitions per table More composite choices REF Partitioning Virtual Column Partitioning
...
...
...
...
...
May 2006
...
Jan 2006 Feb 2006 order_date
...
...
...
...
...
May 2006
...
Jan 2006 Feb 2006 order_date
...
...
...
...
...
May May 2006
...
Jan 2006 Feb 2006 order_date
...
...
...
...
...
May May 2006
...
Jan 2006 Feb 2006 order_date
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 can have statistics eligible as partitioning key Enhanced performance and manageability
CREATE TABLE accounts (acc_no number(10) not null, acc_name varchar2(50) not null, ...
12 12 12 12
12 12 12 12
...
32 32 32 32
Interval Partitioning
Interval Partitioning
Partitioning is key-enabling functionality for managing
Application
one logical object for application transparency multiple physical segments for administration
SQL
CDRs
but Physical segmentation requires additional data management overhead new partitions must be created on-time for new data
Jan Feb
Mar
Interval Partitioning
Interval Partitioning
extension to range partitioning full automation for equi-sized range partitions
Interval Partitioning
How it works
CREATE TABLE sales (order_date DATE, ...) PARTITON BY RANGE (order_date) INTERVAL(NUMTOYMINTERVAL(1,'month') (PARTITION p_first VALUES LESS THAN ('01-FEB-2006');
Table SALES
...
Jan 2006 Feb 2006 Mar 2006 Jan 2007
...
Oct 2009 Nov 2009
...
Interval Partitioning
How it works
CREATE TABLE sales (order_date DATE, ...) PARTITON BY RANGE (order_date) INTERVAL(NUMTOYMINTERVAL(1,'month') (PARTITION p_first VALUES LESS THAN ('01-FEB-2006');
Table SALES
...
Jan 2006 Feb 2006 Mar 2006 Jan 2007
...
Oct 2009 Nov 2009
...
Interval Partitioning
How it works
CREATE TABLE sales (order_date DATE, ...) PARTITON BY RANGE (order_date) INTERVAL(NUMTOYMINTERVAL(1,'month') (PARTITION p_first VALUES LESS THAN ('01-FEB-2006');
Table SALES
...
Jan 2006 Feb 2006 Mar 2006 Jan 2007
...
Oct 2009 Nov 2009
...
Interval Partitioning
How it works
CREATE TABLE sales (order_date DATE, ...) PARTITON BY RANGE (order_date) INTERVAL(NUMTOYMINTERVAL(1,'month') (PARTITION p_first VALUES LESS THAN ('01-FEB-2006');
Table SALES
...
Jan 2006 Feb 2006 Mar 2006 Jan 2007
...
Oct 2009 Nov 2009
...
Interval Partitioning
How it works
Interval partitioned table can have classical range and
...
Jan 2006 Feb 2006 Mar 2006 Jan 2007
...
Oct 2009 Nov 2009
...
Interval Partitioning
How it works
Interval partitioned table can have classical range and
...
2006 Range partition section MERGE and move old partitions for ILM Jan 2007
...
Oct 2009 Nov 2009
...
Interval Partitioning
How it works
Interval partitioned table can have classical range and
...
2006 Range partition section MERGE and move old partitions for ILM Insert new data - Automatic segment creation
...
Jan 2007 Oct 2009 Interval partition section Nov 2009
...
REF Partitioning
REF Partitioning
Business Problem
Related tables benefit from same partitioning strategy
Solution
Oracle Database 11g introduces REF Partitioning
child table inherits the partitioning strategy of parent table through PK-FK relationship intuitive modelling
...
Jan 2006 Feb 2006
...
Redundant maintenance
Table LINEITEMS
...
Jan 2006 Feb 2006
...
REF Partitioning
Table ORDERS
RANGE(order_date)
...
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
...
Partitioning Advisor
Packaged Apps Custom Apps
SQL Workload SQL Advisor SQL SQL Plan Access Structure Tuning Analysis Analysis
New!
Partition Analysis
SQL Profile
SQL Advice
Partition Advice
Integrated, non-conflicting
Q&A
Challenges
Explosion in data volume managed by Enterprises Government regulations (Sarbanes-Oxley, HIPPA, etc) User generated content (Web 2.0) IT managers must support larger volumes of data with
Structured/Relational data compression Unstructured data compression Compression for backup data Network transport compression
and costs
Redo logs
Standby
Backups
Table Compression
Introduced in Oracle9i Release 2
Supports compression during bulk load operations (Direct Load, CTAS) Data modified using conventional DML not compressed
Optimized compression algorithm for relational data Improved performance for queries accessing large amounts of data
Each block contains own compression metadata improves IO efficiency Local symbol table dynamically adapts to data changes
Compression can be specified at either the table or partition levels Completely transparent to applications Noticeable impact on write performance
data
Support for conventional DML Operations (INSERT, UPDATE, DELETE)
New algorithm significantly reduces write overhead Batched compression ensures no impact for most OLTP transactions No impact on reads Reads may actually see improved performance due to fewer IOs and enhanced memory efficiency
Compressed
reaches PCTFREE Compression eliminates holes created due to deletions and maximizes contiguous free space in block
SecureFiles - Deduplication
Secure hash
SecureFiles - Compression
Huge storage savings
Industry standard compression algorithms 2-3x compression for typical files (doc, pdf, xml) Minimal CPU overhead during compression
Database 10g Oracle Database 11g extends compression to table data during exports
no need to decompress before import
Single step compression of both data and metadata compressed data directly hits disk resulting in reduced disk space requirements 75% reduction in dump file size on export of sample OE and SH schemas Compression factor comparable to GNU gzip utility Application transparent complete Data Pump functionality available on compressed files
Summary
Advanced Compression Option contains
VLDB
Partitioning Compression