Solved

DBMS_COMPRESSION SAMPLE

Posted on 2014-04-07
9
1,106 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
Independent Software Vendors: 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Create Index on a Materialized View 5 59
Row_number in SQL 6 52
Oracle SQL Developer - SubString 2 48
Dbms_job.change procedure 16 27
Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
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…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.

736 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