Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DBMS_REDEFINITION.COPY_TABLE_DEPENDENTS and Primary Keys

3297155Feb 17 2017 — edited Feb 17 2017

Oracle 12.1.0.2 on RHEL 6

I am using DBMS_REDEFINITION to shrink some tables with Primary Keys and LOBS following these steps:

1. DBMS_REDEFINITION.CAN_REDEF_TABLE

2. CREATE THE INTERIM TABLE:

        CREATE TABLE <INTERIM_TABLE_NAME> AS SELECT * FROM <TABLE_NAME> WHERE ROWNUM<1;

3. DBMS_REDEFINITION.START_REDEF_TABLE

4. DBMS_REDEFINITION.COPY_TABLE_DEPENDENTS

5. DBMS_REDEFINITION_FINISH_REDEF_TABLE

The original table has an Index_Name like "TABLE_NAME_PK" and a Constraint_Name like "TABLE_NAME_PK" and the Type of Constraint is "Primary Key."

When I finish the Redefinition, the resulting table has an Index_Name like "TABLE_NAME_PK" but the Constraint is a System generated name like "SYS_C001234" and the Type of Constraint is "Check."

Is there something else I need to do in this process to take care of Primary Keys?

Thanks!

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 17 2017
Added on Feb 17 2017
11 comments
844 views