Oracle表的在线重定义(一)

好处:
     When a table is redefined online, it is accessible to both queries and DML during much of the redefinition process. 
     在表进行在线重定义的时候,在整个在线重定义的过程中,该表都可以被查询和进行DML操作。
内部机制:
Typically, the table is locked in the exclusive mode only during a very small window that is independent of the size of the table and complexity of the redefinition, and that is completely transparent to users.
However, if there are many concurrent DML operations during redefinition, then a longer wait might be necessary before the table can be locked. Due to the wait, more changes are committed to the original table, which increases the refresh time and the amount of time that the table is locked.
     一般来说,在整个过程中,目标表会有一个短暂的时间窗口,在该窗口内该表会上一个exclusive锁,具体时长取决于表的数据量以及重定义的复杂程度,同时该过程对用户完全透明。
使用前提:
Online table redefinition requires an amount of free space that is approximately equivalent to the space used by the table being redefined. More space may be required if new columns are added.
     表的在线重定义要求与表数据量同样大小的空闲空间。如果要添加新列,还需要更多的空间。
具体方法:
You can perform online table redefinition with the Enterprise Manager Reorganize Objects wizard or with the DBMS_REDEFINITION package.
     主要有两种方法进行在线重定义,一是借助oem,二是采用DBMS_REDEFINITION包。
请使用浏览器的分享功能分享到微信等