Professional Documents
Culture Documents
(h ps://www.oracle.com)
You are viewing an older release. View Latest Close this no
See Also:
Oracle Database Administrator’s Guide (h ps://docs.oracle.com/pls/topic/lookup?ctx=en/database/oracle/oracle-
database/12.2/vldbg&id=ADMIN11675) for information about rede ning partitions of a table
You can use online rede nition to copy nonpartitioned Collection Tables to partitioned Collection Tables and Oracle Database inserts rows into
the appropriate partitions in the Collection Table. Example 4-35 (evolve-nopartition-table.html#GUID-5C0F8D12-DDDF-42AB-B644-
1880156832BC__CHDHIDJJ) illustrates how this is done for nested tables inside an Objects column; a similar example works for Ordered
Collection Type Tables inside an XMLType table or column. During the copy_table_dependents operation, you specify 0 or false for
copying the indexes and constraints, because you want to keep the indexes and constraints of the newly de ned collection table. However, the
Collection Tables and its partitions have the same names as that of the interim table (print_media2 in Example 4-35 (evolve-nopartition-
table.html#GUID-5C0F8D12-DDDF-42AB-B644-1880156832BC__CHDHIDJJ)). You must take explicit steps to preserve the Collection Table
names.
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/vldbg/evolve-nopartition-table.html#GUID-5FDB7D59-DD05-40E4-8AB4-AF82EA0D… 1/4
5/12/2021 Changing a Nonpartitioned Table into a Partitioned Table
CONNECT eqnt/eqnt
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/vldbg/evolve-nopartition-table.html#GUID-5FDB7D59-DD05-40E4-8AB4-AF82EA0D… 2/4
5/12/2021 Changing a Nonpartitioned Table into a Partitioned Table
; Copy
PRODUCT_ID AD_TEXTDOCS_NTAB(DOCUMENT_TYP)
---------- ------------------------------
1 TEXTDOC_TAB(TEXTDOC_TYP('xx'), TEXTDOC_TYP('yy'))
11 TEXTDOC_TAB(TEXTDOC_TYP('aa'), TEXTDOC_TYP('bb'), TEXTDOC_TYP('cc'))
DECLARE
error_count pls_integer := 0;
BEGIN
dbms_redefinition.copy_table_dependents('eqnt', 'print_media', 'print_media2',
0, true, false, true, false,
error_count);
PRODUCT_ID AD_TEXTDOCS_NTAB(DOCUMENT_TYP)
---------- ------------------------------
1 TEXTDOC_TAB(TEXTDOC_TYP('xx'), TEXTDOC_TYP('yy'))
PRODUCT_ID AD_TEXTDOCS_NTAB(DOCUMENT_TYP)
---------- ------------------------------
11 TEXTDOC_TAB(TEXTDOC_TYP('aa'), TEXTDOC_TYP('bb'), TEXTDOC_TYP('cc'))
In addition, the keyword ONLINE can be speci ed, enabling concurrent DML operations while the conversion is ongoing.
The following is an example of the ALTER TABLE statement using the ONLINE keyword for an online conversion to a partitioned table.
Example 4-36 Using the MODIFY clause of ALTER TABLE to convert online to a partitioned table
This clause can be used to change the partitioning state of indexes and storage properties of the indexes being converted.
The speci cation of the UPDATE INDEXES clause is optional.
Indexes are maintained both for the online and o ine conversion to a partitioned table.
This clause cannot change the columns on which the original list of indexes are de ned.
This clause cannot change the uniqueness property of the index or any other index property.
If you do not specify the tablespace for any of the indexes, then the following tablespace defaults apply.
Local indexes after the conversion collocate with the table partition.
Global indexes after the conversion reside in the same tablespace of the original global index on the non-partitioned table.
If you do not specify the INDEXES clause or the INDEXES clause does not specify all the indexes on the original non-partitioned table,
then the following default behavior applies for all unspeci ed indexes.
Global partitioned indexes remain the same and retain the original partitioning shape.
Non-pre xed indexes become global nonpartitioned indexes.
Pre xed indexes are converted to local partitioned indexes.
Pre xed means that the partition key columns are included in the index de nition, but the index de nition is not limited to including
the partitioning keys only.
Bitmap indexes become local partitioned indexes, regardless whether they are pre xed or not.
Bitmap indexes must always be local partitioned indexes.
The conversion operation cannot be performed if there are domain indexes.
© Oracle About Oracle Contact Us Products A-Z Terms of Use & Privacy Cookie
(/pls/topic/lookup? (h ps://www.oracle.com/corporate/index.html) (h ps://www.oracle.com/corporate/contact/) (/en/browseall.html) (h ps://www.oracle.com/legal/privacy/) Preferences
ctx=en/legal&id=cpyr)
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/vldbg/evolve-nopartition-table.html#GUID-5FDB7D59-DD05-40E4-8AB4-AF82EA0D… 4/4