Solved

DBMS_COMPRESSION SAMPLE

Posted on 2014-04-07
9
1,117 Views
Last Modified: 2014-04-07
Anybody know where there is example of dbms_compression?

Need example that shows non partitioned table.
0
Comment
Question by:xoxomos
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
9 Comments
 
LVL 35

Expert Comment

by:Mark Geerlings
ID: 39984353
Are you asking a general question about compression of data in Oracle?  Oracle offers some different kinds of compression, but most (if not all)of them are only available as extra-cost options or at least require Enterprise Edition of Oracle.  Also, in my experience, compression is most useful in partitioned tables, where historical information can be compressed, but current partitions remain uncompressed.

Or are you asking specifically about something named "dbms_compression" in Oracle?  I don't recognize that name.
0
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 300 total points
ID: 39984367
There are only two subprograms in that package.

This one are you looking for an example with?

http://docs.oracle.com/cd/E11882_01/appdev.112/e40758/d_compress.htm#ARPLS65601

There are a few examples out there from a simple Google.

For example:
http://uhesse.com/2011/09/12/dbms_compression-example/

If you can provide more information on what you are trying to do with that package, we can likely provide better information.
0
 

Author Comment

by:xoxomos
ID: 39984665
I believe this is what I'm looking for.  In my case i'm trying to find an example of how to set  
this up for non-partitioned table.

set serveroutput on
declare
v_blkcnt_cmp pls_integer;
v_blkcnt_uncmp pls_integer;
v_row_cmp pls_integer;
v_row_uncmp pls_integer;
v_cmp_ratio number;
v_comptype_str varchar2(60);
begin
dbms_compression.get_compression_ratio(
scratchtbsname => upper('&ScratchTBS'),
ownname => user,
tabname => upper('&TableName'),
partname => NULL,
comptype => dbms_compression.comp_for_query_high,
blkcnt_cmp => v_blkcnt_cmp,
blkcnt_uncmp => v_blkcnt_uncmp,
row_cmp => v_row_cmp,
row_uncmp => v_row_uncmp,
cmp_ratio => v_cmp_ratio,
comptype_str => v_comptype_str, subset_numrows=>&num_rows );
dbms_output.put_line('Estimated Compression Ratio: '||to_char(v_cmp_ratio));
dbms_output.put_line('Blocks used by compressed sample: '||to_char(v_blkcnt_cmp));
dbms_output.put_line('Blocks used by uncompressed sample: '||to_char(v_blkcnt_uncmp));
end;
/
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:xoxomos
ID: 39984714
Tried it again, for some reason this time did not ask about partition name.   Still running.
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39984741
>>for some reason this time did not ask about partition nam

Then you must have had the partname parameter in the original script you ran?
0
 

Author Comment

by:xoxomos
ID: 39985075
Scratch table too small.  Bombed after three hours.  Start from scratch.
Thanx for the docs and sample.  That's the same sample i picked:-)
Will try digesting the docs in the morning
0
 

Author Comment

by:xoxomos
ID: 39985146
markgeer, it came with 11.2 and 12.  I think it was dbms_comp_advisor before 11.2
0
 

Author Comment

by:xoxomos
ID: 39985149
Finished.  Now to get a script that will execute dbms_compression once for each partition.
0
 

Author Closing Comment

by:xoxomos
ID: 39985150
Thanx
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question