In this Document
APPLIES TO:Oracle Database - Enterprise Edition - Version 9.2.0.1 and laterInformation in this document applies to any platform. PURPOSEThis document is intended to assist Database Administrators resolve issues encountered involving the Temporary Tablespaces. TROUBLESHOOTING STEPSConceptsA temporary tablespace contains transient data that persists only for the duration of the session. Temporary tablespaces can improve the concurrency of multiple sort operations that do not fit in memory and can improve the efficiency of space management operations during sorts. Within a temporary tablespace, all sort operations for a particular instance share a single sort segment, and sort segments exist for every instance that performs sort operations that require temporary space. A sort segment is created by the first statement after startup that uses the temporary tablespace for sorting, and is released only at shutdown. A single temporary tablespace can be shared by multiple users. You cannot explicitly create objects in a temporary tablespace (with the exception of temporary tables)
Common Issues Involving Temporary TablespacesIssues with temporary tablespaces involve monitoring temporary tablespaces, running out of temporary tablespace, having a large temporary tablespace and resizing (mainly decreasing) a temporary tablespace. The physical files that comprise a temporary tablespace are called tempfiles, as opposed to datafiles and information on these files are available in dba_temp_files or v$tempfile:
SQL> select * from dba_temp_files order by tablespace_name;
SQL> select * from v$tempfile; Also, you need to use the TEMPFILE clause, not the DATAFILE clause when working with temporary tablespaces, otherwise you will receive the following error:
ALTER TABLESPACE temp ADD datafile '/u01/app/oracle/tempfile/tempo3.dbf' size 1000M reuse;
ALTER TABLESPACE temp ADD datafile '/u01/app/oracle/tempfile/tempo3.dbf' size 1000M reuse * ERROR at line 1: ORA-03217: invalid option for alter of TEMPORARY TABLESPACE The following are valid SQL statements against temporary tablespaces:
SQL> ALTER TABLESPACE temp ADD TEMPFILE '/u01/app/oracle/tempfile/tempo3.dbf' size 1000M reuse;
SQL> ALTER DATABASE TEMPFILE '/u01/app/oracle/tempfile/temp03.dbf' DROP INCLUDING DATAFILES;
For additional information, refer to Note 160426.1 TEMPORARY Tablespaces : Tempfiles or Datafiles ? The following content will list some known issues and documents to help investigate and troubleshoot issues with temporary tablespaces.
ORA-1630 / ORA-1652 issues related to Temporary TablespaceThese documents can be used to diagnose and resolve space management errors: Note 260944.1 Overview Of ORA-01630 Max # Extents(%) reached in temp segment in tablespace %
Dropping the Temporary Tablespace issuesThe following outline issues with dropping the temporary tablespace:
Note 1500044.1 Unable To Drop Temporary Tablespace
Note 1056652.6 DROP TABLESPACE Command Slow or Hanging on a Tablespace Note 1413933.1 Dropped Temp File Is Still Visible In Database And Remains On File System Note 214371.1 Drop Temp Tablespace Command Hangs
ORA-25153 Temporary Tablespace Is Empty issuesThe following are known issues when ORA-25153 are reported:
Note 422723.1 ORA-25153 Temporary Tablespace Is Empty
Note 843899.1 DB Upgrade Throws ORA-25153: “Temporary Tablespace Is Empty” Note 1384299.1 ORA-25153 Reported when Adding a Temp File to the Temporary Tablespace
Other ORA- Errors involving the Temporary TablespaceNote 1109514.1 Ora-600 [Ktftshk-1] Error Shrinking the Temp Tablespace
Issues involving high Temporary Tablespace usageNote 1499422.1 DataPump Network Mode Import Consumes Lots Of Temporary Segments In TEMP Tablespace
HELPFUL ARTICLES ON TEMPORARY TABLESPACESThe following documents offer guidelines to follow when dropping or resizing temporary tablespaces: How to Resize / Drop the Temporary TablespaceNote 452697.1 How To Shrink A Temporary Tablespace in 11G ?
Enhancements / Restrictions on Temporary TablespacesNote 138212.1 9i: Database DEFAULT TEMPORARY TABLESPACE and Restrictions
Behaviour / Monitoring Temporary Tablespace UsageThe following describe the behaviour of temporary tablespaces and how to monitor the usage of temporary space on your database:
Note 1039341.6 Temporary Segments Are Not Being De-Allocated After a Sort
Note 61997.1 SMON - Temporary Segment Cleanup and Free Space Coalescing Note 317441.1 How Do You Find Who And What SQL Is Using Temp Segments Note 1069041.6 How to Find Creator of a SORT or TEMPORARY SEGMENT or Users Performing Sorts Note 289894.1 Queries To Monitor Temporary Tablespace Usage Note 188846.1 Optimizing performance with temporary tablespaces.
Scripts / Other How to ArticlesNote 111405.1 Script: Change the Default and Temporary Tablespace for Database Users 12c Multitenant Behavior:
FURTHER DIAGNOSTICSIf you were not able to resolve the issue with the details provided in this document, please raise a Service Request for further assistance from Oracle Support. REFERENCESNOTE:1493350.1 - Master Note: Overview of Oracle Tablespace ManagementNOTE:1522807.1 - Master Note: Troubleshooting Oracle Tablespace Management NOTE:1498442.1 - Master Note: Overview of Oracle Temporary Tablespaces |