1、临时表被每个session单独使用
2、临时表分为
1、事务级别临时表 on commit delete rows
2、会话级别临时表 on commit preserve rows
3、创建事务级别临时表
SQL> create global temporary table transaction_tbl
2 (id number) on commit delete rows;
事务级别临时表在事务结束(commit、rollback)后被清空
4、创建会话级别临时表
SQL> create global temporary table session_tbl
2 (id number) on commit preserve rows
3 /
表已创建。
会话级别临时表在会话结束(disconnect)后被清空
5、删除临时表
drop table table_name
6、查看临时表
SQL> select table_name,temporary,duration from user_tables;
TABLE_NAME TEMPORARY DURATION
-------------------- -------------------- --------------------
DEPT N
EMP N
BONUS N
SALGRADE N
SESSION_TBL Y SYS$SESSION
TRANSACTION_TBL Y SYS$TRANSACTION
已选择6行。
7、清空回收站
SQL> purge recyclebin;
回收站已清空。