In addition to permanent tables, Oracle can create temporary tables  to hold
session-private data that exists only for  the duration of a transaction or session.
The  CREATE   GLOBAL   TEMPORARY TABLE statement creates a temporary table that can
be transaction-specific or session-specific. For transaction-specific temporary tables,
data exists for the duration of the transaction. For session-specific temporary tables,
data exists for the duration of the session.  Data in a temporary table is private to the
session. Each session can only see and modify its own data. DML locks are not
acquired on the data of the temporary tables. The LOCK statement has no effect on a

temporary table, because each se ssion has its own private data.

此外对于永久表,ORACLE可以创建临时表去保存私有会话的数据,它仅存在于事务或者会话期间。

CRATE GLOBAL TEMPORARY TABLE语句创建一个临时表,它可以被指定为事务或者是会话级别。

对于批定的事务级别的临时表,数据仅存在事务期间。对于指定的会话级别的临时表,数据仅存在会话

期间。数据在临时表中对于会话来说它是私有的。任何会话仅能看到和修改自己的数据。DML锁是不要求

在临时表的数据上的。LOCK语句在临时表上是没有作用的,因为每一个会话都有它自己的私有数据。

A TRUNCATE  statement issued on a session-specific temporary table truncates data in


its own session. It does not truncate the data of other sessions that are using the same


table.


DML statements on temporary tables do not  generate redo logs for the data changes.


However, undo logs for the data and redo logs for the undo logs are generated. Data


from the temporary table is automatically dr opped in the case of session termination,


either when the user logs off or when the session terminates abnormally such as


during a session or instance failure.

TRUNCATE语句在会话级别的临时表,它TRUNCATE自己会话的数据。它不TRUNCATE对于

使用同一个表的其它会话的数据。

DML语句在临时表上并不创建REDO日志对于数据的改变。但是UNDO日志 以及针对UNDO的REDO

日志会产生。在临时表上的数据会被自动的删除当会话中断时,或者当用户离开或者当用户异常中断

比如在一个会话或实例失败时。

You can create indexes for temporary tables using the  CREATE   INDEX statement.


Indexes created on temporary tables are also  temporary, and the data in the index has


the same session or transaction scope  as the data in the temporary table.


You can create views that access both temporary and permanent tables. You can also


create triggers on temporary tables.


Oracle utilities can export and import the definition of a temporary table. However, no


data rows are exported even if you use the ROWS clause. Similarly, you can replicate


the definition of a temporary table, but you cannot replicate its data.

你可以使用CREATE INDEX语句去创建临时表的索引。索引创建在临时表上它也是临时的,并且

在索引中的数据也拥有同样的会话或事务的类别在数据在临时表时。你可以创建视图去访问临时表

永久表。你也可以创建触发器在临时表上。

ORACLE的工具可以导出或者导入临时表的定义,但是却没有行数据导出尽管你用了行语句。

你也可以复制临时表的定义,但你不能复制它的数据。