1 Conceptual understanding
The temporal table of an Oracle system is often used to hold intermediate data for system operations, and because no redo is generated for any temporary operation (but redo is generated by modifying undo), the data operations of the temporal table are generally more efficient. There are two main types of temporary tables, one is a temporary table based on the transaction, the other is a session-based temporal table, and a transaction-based temporal table is only when the transaction is committed or rolled back, the data of the temporary table is emptied; The session-based temporal table is the only time that the temporary table data is emptied when the session ends. Both types of temporary table data are visible to the current session.
2 transaction-based temporal tables
Create a transaction-based staging table:
Here we create a temporary table based on the transaction, and we have inserted the data when we created it, why is there no data when we query it? This is because a transaction-based temporal table empties the data as soon as the transaction is rolled back or committed, and the DDL statement operation implicitly commits a commit action, which triggers the purge of the data table.
Let's insert one more time:
3 Session-based temporal tables
To create a session-based temporal table TEMP2:
4 Indexes of temporary tables
5 Some limitations of temporary tables
[Online lesson excerpt]6.1oracle temporary table