2017年10月8日 星期日

3 轉至 Partation Table



轉至 Partation Table

4.2 Start Redefinition Process

-- MAKE SURE NO ERROR REPORTED
SET SERVEROUTPUT ON;
EXECUTE DBMS_REDEFINITION.CAN_REDEF_TABLE( 'mike1','table6');

-- 所需時間229       
BEGIN
   DBMS_REDEFINITION.start_redef_table(
   uname=>'mike1' ,
   orig_table=>'table6',
   int_table=>'table7');
END;
/


如果失敗了,OR不可知問題,需要停掉才能繼續喔!!


Error starting at line : 2 in command -
BEGIN DBMS_REDEFINITION.CAN_REDEF_TABLE('mike1','table6',DBMS_REDEFINITION.CONS_USE_rowid); END;
Error report -
ORA-23539: table "MIKE1"."TABLE6" currently being redefined
ORA-06512: at "SYS.DBMS_REDEFINITION", line 143
ORA-06512: at "SYS.DBMS_REDEFINITION", line 1635
ORA-06512: at line 1
23539. 00000 -  "table \"%s\".\"%s\" currently being redefined"
*Cause:    An attempt was made to redefine a table which is currently involved
           in an ongoing redefinition.
*Action:   Do not perform this redefinition operation on this table or wait

           till the ongoing redefinition of the table is completed.


EXECUTE DBMS_REDEFINITION.abort_REDEF_TABLE('mike1','table6','table7');



Sync new table with interim data

BEGIN
   DBMS_REDEFINITION.sync_interim_table(
   uname=>'mike1' ,
   orig_table=>'table6',
   int_table=>'table7');
END;

/


Finish The Redefinition Porcess


BEGIN
   DBMS_REDEFINITION.FINISH_REDEF_TABLE(
   uname=>'mike1' ,
   orig_table=>'table6',
   int_table=>'table7');
END;

/

沒有留言:

RHEL install EPEL

  https://www.linuxtechi.com/install-epel-repo-on-rhel-system/ EPEL dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest...