HCC works by storing data in a nontraditional format—nontraditional for Oracle, anyway. Data stored using HCC still resides in Oracle blocks, and each block still has a block header. But the data storage has been reorganized. In the first place, the blocks are combined into logical structures called compression
units, or CUs. A CU consists of multiple Oracle blocks (usually adding up to 32K or 64K).
CREATE TABLE ... COMPRESS FOR QUERY LOW;
CREATE TABLE ... COMPRESS FOR QUERY HIGH;
CREATE TABLE ... COMPRESS FOR ARCHIVE LOW;
CREATE TABLE ... COMPRESS FOR ARCHIVE HIGH;
Generally speaking, records that will be updated should not be compressed. When you update a record
in an HCC table, the record will be migrated to a new a block that is flagged as an OLTP compressed
block. Of course, a pointer will be left behind so that you can still get to the record via its old rowid, but
the record will be assigned a new rowid as well. Since updated records are downgraded to OLTP
compression you need to understand how that compression mechanism works on updates. Figure 3-6
demonstrates how non-direct path loads into an OLTP block are processed.
Introduced in Oracle 11g R2, Hybrid Columnar Compression provides exceptional compression
capabilities that are far beyond anything available in prior releases. This is thanks in large part to the
adoption of industry-standard compression algorithms and an increase in the size of the compression
unit from a single database block (typically 8K) to a larger unit of 32K or 64K. The feature is only
appropriate for data that is no longer being modified, though, because of locking issues and the fact that
updated rows are moved into a much less compressed format (OLTP compression format). For this
reason, HCC should only be used with data that is no longer being modified (or only occasionally
modified). Since compression can be defined at the partition level, it is common to see tables that have a
mixture of compressed and uncompressed partitions. This technique can in many cases replace ILM
approaches that require moving data to alternate storage media and then purging it from the database.
来自 “ ITPUB博客 ” ，链接：http://blog.itpub.net/758322/viewspace-741978/，如需转载，请注明出处，否则将追究法律责任。