Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

DBMS_COMPRESSION SAMPLE

Posted on 2014-04-07
9
Medium Priority
?
1,185 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 1200 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

650 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