exec dbms_redefinition.can_redef_table('scott','t1',dbms_redefinition.CONS_USE_ROWID);
exec dbms_redefinition.can_redef_table('scott','t1',dbms_redefinition.CONS_USE_PK);
CREATE TABLE scott.t1_pa
(a number,
b varchar2(48 char)
)
PARTITION BY RANGE(a)
(PARTITION emp10000 VALUES LESS THAN (10000),
PARTITION emp20000 VALUES LESS THAN (20000),
PARTITION emp110000 VALUES LESS THAN (110000));
exec DBMS_REDEFINITION.START_REDEF_TABLE('scott', 't1','t1_pa','a a, b b',dbms_redefinition.cons_use_rowid);
declare
num_errors PLS_INTEGER;
begin
DBMS_REDEFINITION.COPY_TABLE_DEPENDENTS('scott', 't1','t1_pa',DBMS_REDEFINITION.CONS_ORIG_PARAMS, TRUE, TRUE, TRUE, TRUE, num_errors);
end;
/
select object_name, base_table_name, ddl_txt from DBA_REDEFINITION_ERRORS;
exec DBMS_REDEFINITION.SYNC_INTERIM_TABLE('scott', 't1', 't1_pa');
exec dbms_redefinition.finish_redef_table('scott', 't1', 't1_pa');
drop table t1_pa purge;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23382569/viewspace-761074/
,如需转载,请注明出处,否则将追究法律责任。