我们模拟一下这个错误:
开一Session(不要关闭)
create global temporary table tmp_test (col1 varchar2(200))
on commit preserve rows;
开一Session(不要关闭)
create global temporary table tmp_test (col1 varchar2(200))
on commit preserve rows;
insert tmp_test values('YYYY');
commit;
再另开一Session
alter table tmp_test add col2 varchar2(200);
这时就会报
ORA-14450: attempt to access a transactional temp table already in use
在做数据库升级时要确定没有人在使用这个临时表,设计时也得考虑,三层结构时可以停服务中断访问。