Creating a Compressed Database with LOB Datatypes

All tables in a database inherit the compression level you specify for LOB columns.

  1. Select a compression level to determine the database's compression strategy:
    Option Description
    Compression level Strategy
    1 - 9, where 9 provides the best compression ratio but heaviest CPU usage Higher compression ratio (ZLib algorithm)
    100 or 101 Lower CPU usage and execution time (FastLZ algorithm)
  2. Create a database with LOB datatypes using:
    create database database_name
    […]
     with dml_logging = { minimal | full }
    , durability =
    { no_recovery | at_shutdown | full }
    , lob_compression = off | compression_level
    

The lob_compression = parameter indicates that all tables in the database inherit the specified level of compression for LOB columns.

This creates the email_lob_db, which is configured for a LOB compression level of 101:
create database email_lob_db
on email_lob_dev = '50M'
with lob_compression = 101