Листинг 1: Сжатие всех секций
CREATE TABLE SALES_PART_COMP (
PART_ID VARCHAR2(50) NOT NULL,
STORE_ID VARCHAR2(50) NOT NULL,
SALE_DATE DATE NOT NULL,
QUANTITY NUMBER(10,2) NOT NULL
)
COMPRESS
PARTITION BY RANGE (SALE_DATE) (
PARTITION SALES_Q1_03
VALUES LESS THAN (TO_DATE('01-APR-2003','DD-MON-YYYY')),
PARTITION SALES_Q2_03
VALUES LESS THAN (TO_DATE('01-JUN-2003','DD-MON-YYYY')),
PARTITION SALES_Q3_03
VALUES LESS THAN (TO_DATE('01-OCT-2003','DD-MON-YYYY')),
PARTITION SALES_Q4_03
VALUES LESS THAN (TO_DATE('01-JAN-2004','DD-MON-YYYY'))
)
;