当我在Oracle 11g(11.2.0.1.0)中创建GLOBAL TEMPORARY TABLE
,然后向其添加新列时,Oracle不会更新LAST_DDL_TIME
column of the system catalog views(例如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
但是,当我在Oracle 12c(12.1.0.2.0)中执行相同的SQL语句序列时,LAST_DDL_TIME
会反映新添加的列。
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
此行为似乎非常特定于将列添加到GLOBAL TEMPORARY TABLES
和Oracle 11g;重命名或删除列会按预期影响LAST_DDL_TIME
。
这是一个已知的Oracle 11g错误吗?!如果是这样,是否有正式的Oracle补丁更新?