|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Oracle9i online table redefinitionPrior to Oracle9i table redefinition was only normally performed with export/import, and this meant that the table was offline during the process. Even online changes (“alter table add new_col number(3)”) cause exclusive locks, preventing all DML (inserts, updates) until the DDL has completed. To solve this problem Oracle9i has introduced Online Table Redefinitions using the DBMS_REDEFINITION package. The dbms_redefinition package allows you to copy a table (using CTAS), create a snapshot on the table, enqueue changes during the redefinition, and then re-synchronize the restructured table with the changes that have accumulated during reorganization. This is a very important feature for 24x7 Oracle databases because the DBA now has the ability to restructures tables while they remain available for update. If your reorganization fails, you must take special steps to make it re-start. Because the redefinition requires creating a snapshot, you must call dbms_redefinition.abort_redef_table to release the snapshot to re-start you procedure. The ‘dbms_redifinition.abort_redef_table’ procedure which accepts 3 parameters (schema, original table name, holding table name), and which “pops the stack” and allows you to start over. dbms_redefinition.abort_redef_table(‘PUBS’,’TITLES’,’TITLES2’); The 9i
redefinition procedures has some restrictions:
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Copyright © 1996 - 2009 by
Burleson Enterprises, Inc. All rights reserved.
Oracle® is the registered trademark
of Oracle Corporation. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||