首页 > Linux操作系统 > Linux操作系统 > 使用在线重定义建分区表
The purpose of this document is to provide step by step instructions on how to convert unpartitioned table to partitioned one using dbms_redefinition package.
1) Create unpartitioned table with the name unpar_table
2) Apply some constraints to the table:
3) Gather statistics on the table:
4) Create a Partitioned Interim Table:
5) Start the Redefinition Process:
a) Check the redefinition is possible using the following command:
b)If no errors are reported, start the redefintion using the following command:
Note: This operation can take quite some time to complete.
c) Optionally synchronize new table with interim name before index creation:
d) Create Constraints and Indexes:
e) Gather statistics on the new table:
f) Complete the Redefintion Process:
At this point the interim table has become the "real" table and their names have been switched in the name dictionary.
g) Remove original table which now has the name of the interim table:
h)Rename all the constraints and indexes to match the original names.
i) Check whether partitioning is successful or not:
Please not that the 9i redefinition procedures has some restrictions:
* There must be enough space to hold two copies of the table.
* Primary key columns cannot be modified.
* Tables must have primary keys.
* Redefinition must be done within the same schema.
* New columns added cannot be made NOT NULL until after the redefinition operation.
* Tables cannot contain LONGs, BFILEs or User Defined Types.
* Clustered tables cannot be redefined.
* Tables in the SYS or SYSTEM schema cannot be redefined.
* Tables with materialized view logs or materialized views defined on them cannot be redefined.
* Horizontal sub setting of data cannot be performed during the redefinition.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/22531473/viewspace-747009/ ,如需转载,请注明出处,否则将追究法律责任。