10.07.2015 Views

Expert Oracle Exadata - Parent Directory

Expert Oracle Exadata - Parent Directory

Expert Oracle Exadata - Parent Directory

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 3 HYBRID COLUMNAR COMPRESSION<strong>Oracle</strong> Database version 11.2.0.2, this procedure may be used on a non-<strong>Exadata</strong> platform to estimatecompression ratios for various levels of HCC as well as OLTP compression. The Advisor does not work onnon-<strong>Exadata</strong> platforms running Database versions prior to 11.2.0.2, although there may be a patchavailable to enable this functionality.The Compression Advisor may also be useful on <strong>Exadata</strong> platforms. Of course you could justcompress a table with the various levels to see how well it compresses, but if the tables are very large thismay not be practical. In this case you may be tempted to create a temporary table by selecting therecords where rownum < X and do your compression test on that subset of rows. And that’s basically whatthe Advisor does, although it is a little smarter about the set of records it chooses. Here’s an example ofits use:SYS@SANDBOX1> !cat get_compression_ratio.sqlset sqlblanklines onset feedback offaccept owner -prompt 'Enter Value for owner: 'accept table_name -prompt 'Enter Value for table_name: 'accept comp_type -prompt 'Enter Value for compression_type (OLTP): ' -default 'OLTP'DECLAREl_blkcnt_cmp BINARY_INTEGER;l_blkcnt_uncmp BINARY_INTEGER;l_row_cmp BINARY_INTEGER;l_row_uncmp BINARY_INTEGER;l_cmp_ratio NUMBER;l_comptype_str VARCHAR2 (200);l_comptype number;BEGINcase '&&comp_type'when 'OLTP' then l_comptype := DBMS_COMPRESSION.comp_for_oltp;when 'QUERY' then l_comptype := DBMS_COMPRESSION.comp_for_query_low;when 'QUERY_LOW' then l_comptype := DBMS_COMPRESSION.comp_for_query_low;when 'QUERY_HIGH' then l_comptype := DBMS_COMPRESSION.comp_for_query_high;when 'ARCHIVE' then l_comptype := DBMS_COMPRESSION.comp_for_archive_low;when 'ARCHIVE_LOW' then l_comptype := DBMS_COMPRESSION.comp_for_archive_low;when 'ARCHIVE_HIGH' then l_comptype := DBMS_COMPRESSION.comp_for_archive_high;END CASE;DBMS_COMPRESSION.get_compression_ratio (scratchtbsname => 'USERS',ownname=> '&owner',tabname=> '&table_name',partname=> NULL,comptype=> l_comptype,blkcnt_cmp => l_blkcnt_cmp,blkcnt_uncmp => l_blkcnt_uncmp,row_cmp=> l_row_cmp,92

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!