When I create a GLOBAL TEMPORARY TABLE
in Oracle 11g (11.2.0.1.0), and then add a new column to it, Oracle does not update the LAST_DDL_TIME
column of the system catalog views (e.g. DBA_OBJECTS
):
create global temporary table test# (foo varchar2(3));
select last_ddl_time from dba_objects where object_name='TEST#';
-- Shows created time
-- Wait a minute
alter table test# add (bar varchar(3));
select last_ddl_time from dba_objects where object_name='TEST#';
-- Shows NO UPDATE
-- Wait a minute
alter table test# drop (bar);
select last_ddl_time from dba_objects where object_name='TEST#';
-- Shows time when column was dropped
However, when I execute the same sequence of SQL statements in Oracle 12c (12.1.0.2.0), then LAST_DDL_TIME
does reflect newly-added columns.
create global temporary table test# (foo varchar2(3));
select last_ddl_time from dba_objects where object_name='TEST#';
-- Shows created time
-- Wait a minute
alter table test# add (bar varchar(3));
select last_ddl_time from dba_objects where object_name='TEST#';
-- Shows time when column was added
-- Wait a minute
alter table test# drop (bar);
select last_ddl_time from dba_objects where object_name='TEST#';
-- Shows time when column was dropped
This behavior appears to be very specific to adding columns to GLOBAL TEMPORARY TABLES
, and to Oracle 11g; renaming or dropping columns does affect LAST_DDL_TIME
as expected.
Is this a known Oracle 11g bug?! If so, is there an official Oracle patch update for it?