作用:高效删除,不同会话独立
--
CREATE GLOBAL TEMPORARY TABLE t_tmp_session on commit preserve rows
as
select * from dba_objects where 2 =1 ;
CREATE GLOBAL TEMPORARY TABLE t_tmp_transction on commit delete rows
as
select * from dba_objects where 2 =1 ;
--
insert into t_tmp_session t
select * from dba_objects where rownum <=500;
insert into t_tmp_session t
select * from dba_objects where rownum <=1200;
select count(*) from t_tmp_session;
--
insert into t_tmp_transction t
select * from dba_objects where rownum <=600;
select count(*) from t_tmp_transction t;
------不指定 相当于 全局临时事务表
CREATE GLOBAL TEMPORARY TABLE t_tmp_norm
as
select * from dba_objects where 2 =1 ;
insert into t_tmp_norm t
select * from dba_objects where rownum <=500;
commit;
select count(*) from t_tmp_norm t;