-
exec dbms_redefinition.can_redef_table('a','small2',dbms_redefinition.cons_use_rowid)
-
-
drop table big_part;
-
create table big_part
-
partition by range(last_ddl_time)
-
interval (numtodsinterval(1,'day')) store in (users)
-
(
-
partition part20220901 values less than(to_date('2022-09-02 00:00:00','yyyy-mm-dd hh24:mi:ss'))
-
)
-
as select * from small2 where 1=2;
-
-
exec dbms_redefinition.start_redef_table('a', 'small2', 'big_part', '', dbms_redefinition.cons_use_rowid)
-
-
declare
-
num_errors pls_integer;
-
begin
-
dbms_redefinition.copy_table_dependents('a', 'small2','big_part',
-
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('a', 'small2','big_part')
-
exec dbms_redefinition.finish_redef_table('a', 'small2','big_part')
select owner,object_name,object_type from dba_objects where owner='a' order by 2;
阅读(305) | 评论(0) | 转发(0) |