Go Oracle DB Temp Table

Source: Internet
Author: User

    • Temp table
? Will the stored data be purged automatically at the end of the session or transaction processing? Provide a dedicated data store for each session? Available for all sessions, without affecting the private data for each session if you need to store private data to perform a task, and after the task is executed, the transaction or session endsclears the data, you can take advantage of the temporary table. Temporary tables provide this functionality so that you do not have to hide the number in other sessionsIt is not necessary to delete the generated data at the end. For a session, the only visible temporary table data is thethe data that the session has inserted. Temporary tables can be dedicated to transactions, or they can be dedicated to sessions. For temporary tables that are dedicated to transactional processing, the data is storedis during transaction processing; For temporary tables that are dedicated to the session, the data exists during the session. In both of these cases, the data inserted by the session is dedicated to the session. Each session can only view and modify its own data. Therefore, the temporary table data never gets a DML lock . the following clauses control the lifetime of a row:? On COMMIT DELETE rows: Specifies that the lifetime of the insert Row is only the duration of the transaction processing? On COMMIT PRESERVE rows: Specifies the lifetime of the inserted row as the duration of the session
    • Temporary tables: Considerations
? Creating a temporary table using the global temporary clause: Create global temporary table Employees_tempon COMMIT PRESERVE rowsas SELECT * FROM Employees; ? Use the TRUNCATE TABLE command to delete the table contents. The following items can be created in a staging table: – Index – View – Triggers use the Create GLOBAL temporary table statement to create temporary tables. In a temporary table, you can create a cableThe Export and import (exported and imported) or Data Pump (the numberExport and import the definition of a temporary table. However, the data is not exported even if the rows option is used. In addition to the events mentioned above that result in the deletion of data, you can also use the truncate TABLE command to effectivelyforce the deletion of data. Use this command to delete all the data that has been inserted. Using this command is more than using the deletecommand is more efficient.  You can create indexes, views, and triggers in temporary tables. Click "Temporary (temporary)" On the "Create Table:table Organization (created table: Table organization)" Pageoption, you can create a temporary table using Enterprise Manager. Click Continue (Continue), on the next pageYou can specify whether a temporary table is dedicated to a session or is dedicated to a transaction. The Tablespace (table space) field is in thedisables the state because temporary tables are always created in the user's temporary table space, and other tablespaces cannot be specified. Note: The GLOBAL keyword is based on the terminology specified by the International Organization for Standardization (ISO) in the SQL standard.

Source: http://blog.csdn.net/rlhua/article/details/13015519

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.