Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Compressing partitioned tables in Oracle 19c

Atif MemonJun 20 2024

I am compressing partitioned tables.

before partitioned tables, I tried normal tables with the follwoing steps:

DBMS_REDEFINITION.START_REDEF_TABLE(
    uname => 'USER',
    orig_table => 'ORIGINAL',
    int_table => 'INTERIM'
);




BEGIN
   DBMS_REDEFINITION.CAN_REDEF_TABLE('USER','ORIGINAL', DBMS_REDEFINITION.CONS_USE_ROWID);
END;
/



BEGIN
   DBMS_REDEFINITION.START_REDEF_TABLE(
      uname => 'USER',
      orig_table => 'ORIGINAL',
      int_table => 'INTERIM',
      options_flag => DBMS_REDEFINITION.CONS_USE_ROWID);
END;
/



DECLARE
   error_count pls_integer := 0;
BEGIN
   DBMS_REDEFINITION.COPY_TABLE_DEPENDENTS('USER', 'ORIGINAL', 'INTERIM', dbms_redefinition.cons_orig_params, TRUE,TRUE,TRUE,FALSE, error_count);
   DBMS_OUTPUT.PUT_LINE('errors := ' || TO_CHAR(error_count));
END;
/


DECLARE
   error_count pls_integer := 0;
BEGIN
DBMS_REDEFINITION.COPY_TABLE_DEPENDENTS(
    uname => 'USER',
    orig_table => 'ORIGINAL',
    int_table => 'INTERIM',
    copy_indexes => DBMS_REDEFINITION.CONS_ORIG_PARAMS,
    copy_triggers => TRUE,
    copy_constraints => TRUE,
    copy_privileges => TRUE,
    ignore_errors => FALSE,
    num_errors => 0
);
END;
/

ALTER TABLE ORIGINAL MOVE ROW STORE COMPRESS ADVANCED;

However, for partitioned tables, this is not possible.

can someone tell me the procedure to compress partitioned tables in Oracle 19c?

Comments
Post Details
Added on Jun 20 2024
1 comment
437 views