Oracle Temp Table

Source: Internet
Author: User
Tags create index terminates
Temp table:

In addition to the permanent table, Oracle can also create a temporary table to hold the session private data, which exists only for the duration of a transaction or session.


The Create GLOBAL temporary table statement establishes a temporary table that can be either a transaction level or a session level. For a transaction-level temporal table, data exists for the duration of the transaction. For temporary session level, data exists for the duration of the session. The data in the temporary table is private to the respective session. Each session can only be seen and can only change its own data.

DML lock is not required for data on a temporary table.

The lock statement has no effect on the temporary table, since each session has his own private data.


For the temporal table at the session level, the TRUNCATE command will truncate the data belonging to that session. The truncate command does not truncate the data for other sessions that use the same table name.

DML statements on a temporary table do not generate redo.

However, the undo logs for the data and redo logs for the undo logs is generated. When the session terminates (user logs off or the session terminates abnormally). The data in the temporary table will be dropped on its own initiative.

The ability to index using the CREATE INDEX statement on a temporary table.

The index built on the temporary table is also temporary. The data in the index has the same session or transaction scope as the data in the temporary table.



To create a temporary table and permanently access the table view. It is possible to create a trigger in a temporary table.



Oracle Useful Tools (NOTE: Exp wait a bit) the ability to export and import temporary table definitions, but. Even if you use the Rows section. Temporary table data rows are also not exported. Classified as similar. You can copy the definition of a temporary table, but you cannot copy the table data.



Oracle Temp Table

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.