Temporary tables in oracle

Source: Internet
Author: User
Temporary tables: In addition to permanent tables, oracle can also create temporary tables to store session private data. These data only exists during the continuous existence of a transaction or session. The CREATEGLOBALTEMPORARYTABLE statement creates a temporary table at the transaction or session level. For transactions

Temporary tables: In addition to permanent tables, oracle can also create temporary tables to store session private data. These data only exists during the continuous existence of a transaction or session. The create global temporary table statement creates a temporary table at the transaction or session level. For transactions

Temporary table:

In addition to permanent tables, oracle can also create temporary tables to store session private data, which only exists during the period of a transaction or session.


The create global temporary table statement creates a temporary table at the transaction or session level. For temporary tables at the transaction level, data exists during the duration of the transaction. For session-level temporary, data exists during the session duration. The data in the temporary table is private to the respective sessions. Each session can only see and modify its own data. Dml lock is not required for data on temporary tables. The lock statement has no effect on the temporary table because each session has its own private data.


If the truncate command is issued for a temporary table at the session level, the data of the session will be truncate. The truncate command does not truncate data of other sessions with the same table name.

The dml Statement on the temporary table does not generate redo. However, undo logs for the data and redo logs for the undo logs is generated. When the session is terminated (user logs off or session ends abnormally), data in the temporary table is automatically dropped.

You can use the create index statement to create an index on a temporary table. The index created on the temporary table is temporary. The data in the index has the same session or transaction range as the data in the temporary table.

You can create a view to access the temporary and permanent tables. You can also create a trigger on a temporary table.

Oracle utility (Note: exp, etc.) can export and import definitions of temporary tables. However, even if you use the rows clause, data rows in temporary tables will not be exported. Similarly, you can copy the definition of a temporary table, but not the data in the table.

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.