Column Value Corrupted After DDL Operations (Doc ID 1924931.1)

Last updated on DECEMBER 06, 2016

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.4 and later
Information in this document applies to any platform.

Symptoms

Adding new column after dropping column with default value leads to values corruption.

Steps to reproduce:

SQL> drop table xx;
create table xx (x number);
insert into xx (x) values (1);
commit;

alter table xx add (
  c varchar2 (100),
  cx varchar2 (100),
  f char (1) default 'n' not null,
  fx char (1) default 'n' not null);

alter table xx drop (
  cx,
  fx);

alter table xx add (
  na number (10),
  nb number (4));

select nb from xx;
select dump (nb) from xx;

Table dropped.

SQL>
Table created.

SQL>
1 row created.

SQL>
Commit complete.

SQL> SQL> 2 3 4 5
Table altered.

SQL> SQL> 2 3
Table altered.

SQL> SQL> 2 3
Table altered.

SQL> SQL>
  NB
----------


SQL>
DUMP(NB)
----------------------------------------
Typ=2 Len=1: 110

SQL>

Now "na" and "nb" are expected to be null, but they have the values from removed columns, filled previously by default values.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms