Question

I'm working with Oracle 11g and a requirement came down the pipeline to "[C]ompress our data [sic]." And I'm wondering how compression will affect future data.

The actual PL/SQL isn't an issue (something along these lines: ALTER TABLE SOME_TABLE MOVE COMPRESS;), but I'm told by the DBA that MOVE COMPRESS will only compress the existing data, and that any further transactions will require explicit compression. After running that line, looking at the table's storage properties, Table Compression is properly set and everything, but that leads me to believe that this will go on in the background.

I guess my question is this: Do I need to run MOVE COMPRESS (or something similar) after new transactions, or will Oracle compress the data going forward? If not, is there something I can amend to my ALTER TABLE statements that will enforce this?

Was it helpful?

Solution

Your DBA was kind of correct, for the typical scenario.

MOVE COMPRESS compresses existing data with Basic compression. Any new data inserted with regular insert will be uncompressed. New data inserted with direct-path insert will be compressed.

If you want all new data to be compressed, then you can use OLTP compression. Then syntax for that is COMPRESS FOR OLTP. OLTP compression requires extra license as it is part of the Advanced Compression option.

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top