Skip to Main Content
  • Questions
  • Compressing new partitions of existing very large tables

Breadcrumb

Dev Live Dev Intro

We are celebrating Developers at AskTOM. We welcome Developers of all levels of experience to join us at our FREE Developer Live events coming in August and September. Just click on the left to register today! If you are brand new to Database Technology, then we also have got you covered. Just click on the right for your comprehensive FREE training program to kick start your Oracle Database Development journey!

Question and Answer

Connor McDonald

Thanks for the question, Berton.

Asked: August 10, 2020 - 2:01 pm UTC

Answered by: Connor McDonald - Last updated: August 13, 2020 - 3:09 am UTC

Category: Database Administration - Version: 12.1

Viewed 1000+ times

You Asked

We have quite a few very large tables that are interval partitioned ( 1 partition per day ). At any given point we store 120 days worth of data, i.e. we do daily partition maintenance and move the > 120 days data over to either Archival systems or purge them.

My question is, is it possible to compress new partitions as they are added to the source table or do we need to create a new table and move data ?

Here is an example of what the source table looks like

create table my_very_large_table
(
  id                        number(20) not null,
  processedxml              clob,
  updatedon                 date default trunc( current_date )
)
lob ( processedxml ) store as securefile 
( 
   tablespace my_tablespace
   enable storage in row chunk 8192
)
partition by range( updatedon )
interval( numtodsinterval( 1, 'day' ))
(
   partition p_default values less than ( to_date( '01/01/2020', 'mm/dd/yyyy' ))
)
tablespace my_tablespace;


We have 120 days worth of data in this table and several hundred thousand rows are added everyday. Can I alter the partition attributes so that new partitions are created as compressed ?


Thanks

BC, MT MI

and we said...

You can alter the *default* settings for a table (for new partitions), eg

alter table my_partitioned_table modify default attributes compress for all operations 



and you rated our response

  (1 rating)

Reviews

compress on lobs.

August 13, 2020 - 5:21 am UTC

Reviewer: Rajeshwaran, Jeyabal

But given this very skinny table of three columns, we suspect the bunch of data will be in lob segments.

so it is worth to benchmark by compressing the lob segments and measure the benefits.

since you are using secure files, de-duplication is also possible. please do check that too.

More to Explore

Administration

Need more information on Administration? Check out the Administrators guide for the Oracle Database