时间:2021-07-01 10:21:17 帮助过:20人阅读
--预备检查
BEGIN
DBMS_REDEFINITION.CAN_REDEF_TABLE(‘GMSTEST‘,‘BGP_HSE_ENTITYHISTORY_NEW‘,DBMS_REDEFINITION.CONS_USE_PK);
END;
BEGIN
DBMS_REDEFINITION.START_REDEF_TABLE(‘GMSTEST‘, ‘BGP_HSE_ENTITYHISTORY_NEW‘, ‘BGP_HSE_ENTITYHISTORY_NEW_TEST‘);
END;
BEGIN
dbms_redefinition.sync_interim_table(‘GMSTEST‘, ‘BGP_HSE_ENTITYHISTORY_NEW‘, ‘BGP_HSE_ENTITYHISTORY_NEW_TEST‘);
END;
-- 完成关闭
BEGIN
DBMS_REDEFINITION.FINISH_REDEF_TABLE(‘GMSTEST‘, ‘BGP_HSE_ENTITYHISTORY_NEW‘, ‘BGP_HSE_ENTITYHISTORY_NEW_TEST‘);
END;
--报错还原
BEGIN
DBMS_REDEFINITION.ABORT_REDEF_TABLE(uname => ‘GMSTEST‘,
orig_table => ‘BGP_HSE_ENTITYHISTORY_NEW‘,
int_table => ‘BGP_HSE_ENTITYHISTORY_NEW_TEST‘);
END;
oracle 在线重定义
标签:red history syn table ble rac tor init star