Solved

DBMS_COMPRESSION SAMPLE

Posted on 2014-04-07
9
1,032 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
  • 6
  • 2
9 Comments
 
LVL 34

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 76

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
 

Author Comment

by:xoxomos
ID: 39984714
Tried it again, for some reason this time did not ask about partition name.   Still running.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 76

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
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.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now