数据迁移:migrate_update_t_origin.sql
迁移回滚:migrate_undo_t_origin.sql
-- 数据迁移失败, 进行回滚; 数据迁移失败时回滚只需要将数据迁移过程中创建的表删除即可
declare
i_count integer default 0;
begin
select count(1) into i_count from user_tables where table_name = upper('tmp_t_origin');
if i_count = 1 then
execute immediate 'drop table tmp_t_origin';
end if;
select count(1) into i_count from user_tables where table_name = upper('t_origin_01');
if i_count = 1 then
execute immediate 'drop table t_origin_01';
end if;
exception
when others then
null;
end;
迁移回滚:migrate_undo_t_origin.sql
-- 数据迁移失败, 进行回滚; 数据迁移失败时回滚只需要将数据迁移过程中创建的表删除即可
declare
i_count integer default 0;
begin
select count(1) into i_count from user_tables where table_name = upper('tmp_t_origin');
if i_count = 1 then
execute immediate 'drop table tmp_t_origin';
end if;
select count(1) into i_count from user_tables where table_name = upper('t_origin_01');
if i_count = 1 then
execute immediate 'drop table t_origin_01';
end if;
exception
when others then
null;
end;
/
本文详细介绍了数据迁移过程中的关键步骤,并阐述了在数据迁移失败时如何进行有效的回滚操作,仅保留数据迁移过程中创建的表,确保数据安全与系统稳定性。
1164

被折叠的 条评论
为什么被折叠?



