Online Table Reorg

Check to See if a Table can be Reorganised Using DBMS_REDEFINITION

--
-- Check to see if a table can be reorganised. 
--
 
BEGIN
sys.dbms_redefinition.can_redef_table
uname=>'MySchema',
tname=>'MyTable'
);
END;
/

Perform an Online Table Reorg

--
-- Perform an Online Table Reorg
--
 
BEGIN
sys.dbms_redefinition.redef_table(
uname=>'MySchema',
tname=>'MyTable',
table_part_tablespace=>'MyTableSpace'
);
END;

Abort an Online Table Reorg

--
-- Abort an Online Table Reorg After a Failure or if Cancelled
--
 
sys.dbms_redefinition.abort_redef_table (
uname=>'MySchema',
orig_table=>'MyTable',
int_table=>'MyInitTable'
);
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License