When a request was submitted today, the ORA-01652 was prompted that the TEMP segment could not be extended through 128 (in tablespace temp. Finally, use alter database tempfile '/*/db/apps_st/data/tempx01.dbf' to RESIZE 7168 M; to expand the temporary tablespace. I found some information on the Internet and re-learned the knowledge points of the temporary tablespace. The record should not be forgotten later.
Role of temporary tablespace:
Temporary tablespace is mainly used for sorting operations in the database [such as creating indexes, order by and group by, distinct, union/intersect/minus/, sort-merge, join, and analyze commands], provides temporary computing space for managing indexes, such as creating indexes, importing data to IMP, and accessing views, after the computation is completed, the system automatically cleans it up.
When the temporary tablespace is insufficient, the operation speed is abnormally slow, and the temporary tablespace rapidly increases to the maximum space (the limit of expansion), and is generally not automatically cleared.
If the temporary tablespace is not set to auto-scale, when the temporary tablespace is not enough, the current affairs execution will report an error where the ora-01652 cannot extend the temporary segment, and the solution is also simple: 1. Set automatic expansion of temporary data files, or 2. Increase the temporary tablespace.
Temporary tablespace operations:
Query the default temporary tablespace:
SQL> select * from database_properties where property_name = 'default _ TEMP_TABLESPACE ';
PROPERTY_NAME
------------------------------
PROPERTY_VALUE
--------------------------------------------------------------------------------
DESCRIPTION
--------------------------------------------------------------------------------
DEFAULT_TEMP_TABLESPACE
TEMP
Name of default temporary tablespace
Query the temporary tablespace status:
SQL> select tablespace_name, file_name, bytes/1024/1024 file_size, autoextensible from dba_temp_files;
TABLESPACE_NAME
----------
FILE_NAME
---------------------------
FILE_SIZE AUT
-----
TEMP
/U01/app/Oracle/oradata/orcl/temp01.dbf
100 YES
Extended temporary tablespace:
Method 1: Increase the temporary file size:
SQL> alter database tempfile '/u01/app/oracle/oradata/orcl/temp01.dbf' resize100m;
Database altered.
Method 2: Set the temporary data file to automatic extension:
SQL> alter database tempfile '/u01/app/oracle/oradata/orcl/temp01.dbf' autoextend on next 5 m maxsize unlimited;