Why does Oracle add a hidden column here? : <p>We recently migrated a customer system to Oracle 12c and to the latest version of our product. This process includes running a number of migration scripts which mostly add or change tables. We noticed that adding a column to a table while also providing a default value, creates an additional hidden column <code>SYS_NC00002$</code>.</p>

<p>You should be able to reproduce this with the following code</p>

<pre><code>create table xxx (a integer);
alter table xxx add (b integer default 1);

select table_name, column_name, data_type, data_length, column_id, default_length, data_default from user_tab_cols where table_name='XXX';

Table_Name|column_Name |data_Type|data_Length|column_Id|default_Length|data_Default|
------------------------------------------------------------------------------------
XXX       |A           |NUMBER   |         22|        1|              |            |
XXX       |SYS_NC00002$|RAW      |        126|         |              |            |
XXX       |B           |NUMBER   |         22|        2|             1|1           |
</code></pre>

<p>When I populate the table and look at the values in that hidden column, they are all the same:</p>

<pre><code>select distinct SYS_NC00002$ from xxx;

Sys_Nc00002$|
-------------
01          |
</code></pre>

<p>Amazingly, when I don't set the default value right away but in an extra statement, no additional hidden column is created.</p>

<pre><code>create table xxy (a integer);
alter table xxy add (b integer);
alter table xxy modify b default 1;

select table_name, column_name, data_type, data_length, column_id, default_length, data_default from user_tab_cols where table_name='XXY';

Table_Name|column_Name|data_Type|data_Length|column_Id|default_Length|data_Default|
-----------------------------------------------------------------------------------
XXY       |A          |NUMBER   |         22|        1|              |            |
XXY       |B          |NUMBER   |         22|        2|             1|1           |
</code></pre>

<p>Can anyone explain what this hidden column is for and why it is only created in the first example, but not in the second?</p>
