12. Managing Tables and Views : Synonyms, Temporary Tables, and Comments : Temporary Tables
 
Share this page                  
Temporary Tables
Temporary tables are useful in applications that need to manipulate intermediate results and minimize the processing overhead associated with creating tables.
Temporary tables reduce overhead in the following ways:
No logging or locking is performed on temporary tables.
No page locking is performed on temporary tables.
Disk space requirements are minimized. If possible, the temporary table is created in memory and never written to disk.
No system catalog entries are made for temporary tables.
Because no logging is performed, temporary tables can be created, deleted, and modified during an online checkpoint.
Temporary tables are:
Visible only to the session that creates them
Deleted automatically when the session ends
Declarable by any user, whether or not the user has the create_table permission
The DECLARE GLOBAL TEMPORARY TABLE statement is used to create temporary (session-scope) tables. In VDBA, use the Create Table dialog.
All temporary tables are automatically deleted at the end of the session. To delete a temporary table before the session ends, issue a DROP TABLE statement.