Estou compactando tabelas particionadas.
antes das tabelas particionadas, tentei tabelas normais com as seguintes etapas:
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;
Entretanto, para tabelas particionadas, isso não é possível.
alguém pode me dizer o procedimento para compactar tabelas particionadas no Oracle 19c ?
Corrigido.
As etapas acima serão de fato seguidas (DBMS_REDEFINITION).
No entanto, se sua tabela tiver índices particionados, você precisará eliminá-los.