View
215
Download
1
Category
Preview:
Citation preview
Oracle 11gR2 Advanced Compression
Overview
Copyright © 2011 MyDBA CC
By Craig Moir of MyDBA June 2011
Version 1
Copyright © 2011 MyDBA CC
Advanced Compression Overview
What is Advanced Compression?
Oracle 11gR2 Advanced Compression is a combination of compression algorithms that have been introduced into a number of different areas of Oracle’s total database management solution. Advanced Compression implementations: Block compression
o Compression in table data blocks using columnar compression. DataPump compression
o Metadata and Table data compression of dump files. RMAN database and archivelog compression
o Compression of database backups. Data Guard log shipping compression
o Compression of archivelog file shipping over the network to the Data Guard (Standby) database/s. SecureFile deduplication
o Duplicate removal of unstructured database data. SecureFile compression
o Compression of unstructured data.
Copyright © 2011 MyDBA CC
Advanced Compression Overview
Advanced Compression inside the database
Compresses at block level
o Lowest compression granularity. o Tables can simultaneously contain blocks in uncompressed states as well as in various stages of compression.
Uses Columnar Compression for table blocks
o Different to traditional data compression techniques. o Removes column duplicates in blocks by replacing them with symbols.
Blocks stay compressed in memory
o Blocks are not uncompressed when read into memory, or re-compressed when written to disk. o Blocks remain compressed at all locations in the database i.e. cache and disk.
Suitable for OLTP environments
o Minimal to no CPU overhead as blocks are not compressed or uncompressed during ‘READS’ and ‘WRITES’. o Blocks are only compressed once they reach a ‘usage’ or ‘percent free’ threshold. o Blocks are compressed in the background and not during normal DML activity.
Manages blocks in various stages of compression
Stage 1 Stage 2 Stage 3 Stage 4 Stage 5
Empty block ready for ‘INSERTS’
Block is inserted until ‘percent free’ threshold
Compressed block is inserted until ‘percent free’ threshold
Inserted rows compressed in the background
Block is compressed in the background
Copyright © 2011 MyDBA CC
Advanced Compression Overview
How does columnar compression work?
Designed to work with OLTP applications. The algorithm works by eliminating duplicate values within a database block. Compressed blocks contain a symbol table used to represents duplicates. Duplicate values are assigned a symbol and are therefore stored only once in the block. Employee Data
with duplicate values Uncompressed Block
with duplicate values Compressed Block
eliminating duplicate values
Duplicate data stored in block Duplicate data
replaced with symbols
Symbol Table representing
duplicates
What benefits can be realized with Advanced Compression?
3x or more in disk storage savings.
Hugely increase database storage capacity: o without increasing hardware requirements
o without increasing power consumption
o without increasing cooling requirements
Greatly improved performance: o Faster I/O
o Reduced Network bandwidth usage
o Faster Full Table Scans (FTS)
o Faster Index Range Scans
o Improved cache efficiency
Minimal or no performance impact on DML operations.
Totally transparent to applications.
Huge savings in secondary, tertiary & off-line storage.
Copyright © 2011 MyDBA CC
Advanced Compression Overview
X Uncompressed Compressed
Uncompressed Cache Compressed Cache
x 3 =
Table A uncompressed uses 15 blocks of storage
Table A compressed uses 5 blocks
of storage
Full table scan (FTS) FTS
Buffer Cache Buffer Cache
Table A Table A
Copyright © 2011 MyDBA CC
Advanced Compression Overview
Advanced Compression and Solid-State Disks (SSD)
Advanced Compression and SSD delivers speeds up to 300x faster
than platter disks.
Advanced Compression makes a ‘diskless’ Oracle much more viable
and makes SSD far more affordable..
1-Terabyte SSD rack uses only 250 Watts, less than 3 light bulbs!
<
3 Terabyte Disk Storage
Advanced Compression
1 Terabyte SSD 1 Terabyte SSD uses < 250 Watts
Platter Disk with no Compression
Advanced Compression with SSD
=
=
Copyright © 2011 MyDBA CC
Advanced Compression Overview
Advanced Compression caveats
Tables do not compress themselves i.e. they do not shrink in size automatically.
The ‘alter table compress’ command does not actually compress the table or reduce it in size.
The ‘alter table compress’ only applies to new data being INSERTed into the table.
The ‘alter table compress’ only guarantees that a table will NOT increase in size.
Table blocks are only compressed when they reach PCT FREE threshold (default is 90%).
Existing table data will need to be specifically compressed using the ‘alter table move’ command.
The ‘alter table move’ command acquires an exclusive lock on the table during the ‘move’ which prohibits DML.
Tables can also be compressed online without exclusive locks by using the DBMS_REDEFINITION package.
Gather statistics on newly compressed tables and frequently gather statistics on compressed tables with active inserts.
Expect SQL plan regression after compressing a table.
You can add and drop columns to tables compressed with the ‘compress for all operations’ option.
You cannot drop columns on tables compressed with the ‘compress for direct_load’ option.
You can only add columns to tables compressed with ‘compress for direct_load’ if you do not specify default values.
Copyright © 2011 MyDBA CC
Advanced Compression Overview
Oracle table compression options available
COMPRESS FOR ALL OPERATIONS
o 10% free space reserved in blocks o Lowest compression ratio
COMPRESS FOR OLTP
o 10% free space reserved in blocks o Lower compression ratio
COMPRESS FOR DIRECT_LOAD OPERATIONS
o 0% free space in blocks o Higher compression ratio
COMPRESS
o 0% free space in blocks o Highest compression ratio
Copyright © 2011 MyDBA CC
Advanced Compression Overview
Oracle LOB compression options available
NOCOMPRESS
o No compression performed on LOBS. COMPRESS LOW
o Low LOB compression. COMPRESS MEDIUM
o Increased LOB compression ratio.
COMPRESS HIGH
o Maximum LOB compression. o Maximum storage savings.
KEEP_DUPLIDATES
o Duplicate LOBS stored. DEDUPLIDATE
o Duplicates not stored. o Provides greatest storage benefit. o Incredible storage savings when combined with maximum compression.
Copyright © 2011 MyDBA CC
Advanced Compression Overview
RMAN compression options available
COMPRESSION ALGORITHM ‘BASIC’
o BZIP2 (10g) algorithm o Medium compression o Slow performance o FREE (in both SE and EE and does not need Advanced Compression option)
COMPRESSION ALGORITHM ‘LOW’
o LZO algorithm o Low compression o High performance
COMPRESSION ALGORITHM ‘MEDIUM’
o ZLIB algorithm o Medium compression o Medium performance
COMPRESSION ALGORITHM ‘HIGH’
o BZIP2 (11g) algorithm o Highest compression o Low performance
Copyright © 2011 MyDBA CC
Advanced Compression Overview
In Summary
11gR2 Advanced Compression gives you the following: Incredible storage saving (60% reduction or more!). Huge compression savings with LOBS using SECUREFILE and COMPRESS HIGH storage. Huge storage savings in eliminating duplicate unstructured data with SECUREFILE DEDUPLICATE option. Massive I/O performance improvement for heavy queries. Less hardware, smaller data centre footprint. Save costs for power consumption and cooling requirements (very green). Invest in Software and not Hardware – Software is current, hardware ages.
MyDBA is an Oracle Gold Partner Specialized in the following:
Oracle Database 11G
Oracle Performance Tuning 11G
Copyright © 2011 MyDBA CC
Advanced Compression Overview
MyDBA Consulting Services
This presentation is just an small example of the immense value intrinsic to the Oracle database. MyDBA can assist you in unleashing the full potential of your Oracle software investment. For more information on MyDBA’s services, or to see a demo or presentation on any of the topics in this paper, please contact us on:
+27 11 027 9400 0861 911 DBA
http://www.mydba.co.za/ info@mydba.co.za
Copyright © 2011 MyDBA CC
Disclaimer: This document is provided for information purposes only. While MyDBA has taken care to ensure that the content on this document is accurate, the information is provided "as is" and is not warranted to be error-free. Your use of and reliance on the information is entirely at your own risk. This document may not be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the prior written permission of MyDBA.
Advanced Compression Overview
References
http://www.oracle.com/us/products/database/options/advanced-compression/index.html http://www.dba-oracle.com/oracle11g/sf_Oracle_11g_Data_Compression_Tips_for_the_DBA.html http://www.orafaq.com/wiki/Oracle_Advanced_Compression http://www.oracle.com/technetwork/database/focus-areas/storage/advanced-compression-whitepaper-130502.pdf http://www.scribd.com/doc/47398069/e-bus-r121-with-11gr1-advcompression http://www.morganslibrary.com/pres/oow09_hcc.pdf http://download.oracle.com/docs/cd/B28359_01/server.111/b28310/tables002.htm#CJAGFBFG http://www.oracleimg.com/technetwork/issue-archive/2008/08-jul/o48advcomp-101264.html http://www.oracle.com/technetwork/database/focus-areas/performance/deepdiveaco-oow2010-200701.pdf http://www.oracleimg.com/technetwork/testcontent/11gr1-compress-viewlet-swf-093999.html
Copyright © 2011 MyDBA CC
Advanced Compression Overview
Recommended