Skip to Main Content

SQL & PL/SQL

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_metadata_diff.compare_alter doest not generate ALTER RENAME COLUMN

VIRUFeb 26 2013 — edited Feb 27 2013
Hi,

I am using ORACLE DB 11gR2. I am comparing all tables of 2 schemas with the below method :-
 select dbms_metadata_diff.compare_alter('TABLE',
                                              'GROUPS_A',
                                              'GROUPS_A',
                                              'INTTEST01',
                                              'INTTEST02')
       -- into V_ALTER
        from dual;
Which give me an output like :-
ALTER TABLE "INTTEST01"."GROUPS_A" DROP ("RECORD_STATUS_TYPE");
ALTER TABLE "INTTEST01"."GROUPS_A" ADD ("RAW_RECORD_STATUS_TYPE");
  
  -- ORA-39278: Cannot alter table with segments to segment creation deferred.
The table structure of both the tables in their schema :-
INTTEST01 :- GROUPS_A :- 
ID number
RECORD_STATUS_TYPE varchar2(40)

INTTEST01 :- GROUPS_A :- 
ID number
RAW_RECORD_STATUS_TYPE varchar2(40)
As per the expectation it should have given me an "ALTER TABLE RENAME" command to rename the column from RECORD_STATUS_TYPE to RAW_RECORD_STATUS_TYPE.

On the other side it gives me DROP COLUMN and ADD COLUMN in which i will loose my important data.

Can anyone please tell me a clear picture about the dbms_metadata_diff.compare_alter package , in which case will this return me an "ALTER TABLE RENAME COLUMN" command.

Thanks in Advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 27 2013
Added on Feb 26 2013
6 comments
381 views