Oracle临时表(Temporary Table)

本文详细介绍了Oracle临时表的使用方式,包括其在会话级别和事务级别的创建方式,以及临时表在不同级别的创建时ONCOMMIT关键字的作用。同时,文章还列举了Oracle临时表的一些限制,如不能被分区、集群或索引组织等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

GLOBAL TEMPORARY代表全局临时表
临时表的元数据存储在数据字典里面

只当第一条DML命令发生的时候才为这张表的段分配空间

临时表数据的可见范围应该是会话级别或是事务级别的

会话或者事务级别又建表时的ON COMMIT关键字决定,ON COMMIT DELETE ROWS代表事务级别,ON COMMIT PERSERVE ROWS代表会话级别

DDL命令只在临时表与会话断开绑定之后才可以运行

对于会话级别,当TRUNCATE命令发生时会话与临时表间的绑定也就断开了;而对于事务级别,在ROLLBACK或者COMMIT

Oracle临时表的一些限制:
■ Temporary tables cannot be partitioned, clustered, or index organized.
■ You cannot specify any foreign key constraints on temporary tables.
■ Temporary tables cannot contain columns of nested table.
■ You cannot specify the following clauses of the LOB_storage_clause:
TABLESPACE, storage_clause, or logging_clause.
■ Parallel UPDATE, DELETE and MERGE are not supported for temporary tables.
■ You cannot specify the nested_table_col_properties or parallel_
clause.
■ The only part of the segment_attributes_clause you can specify for a
temporary table is TABLESPACE.
■ Distributed transactions are not supported for temporary tables.

转载于:https://www.cnblogs.com/jenrrychen/p/4603479.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值