ORA-01652: unable to extend temp segment by num in tablespace name
Cause: the tablespace in the temporary ORACLE segment is insufficient, because ORACLE always tries its best to allocate continuous space. This problem occurs when there is not enough allocable space or the allocation is not consecutive.
Solution: ORACLE uses the tablespace as a logical structure-unit, while the physical structure of the tablespace is a data file, which is physically created on the disk, all objects in the tablespace also exist on the disk. To add space to the tablespace, you must add data files. First, check the available space of the specified tablespace and use view SYS. DBA_FREE_SPACE. Each record in the view represents the shard size of the available space:
SQL> Select file_id, block_id, blocks, bytes from sys. dba_free_space where tablespace_name = '';
The returned information can preliminarily determine the maximum block of the available space, check whether it is smaller than the size mentioned in the error message, and then check the default tablespace parameters:
SQL> SELECT INITIAL_EXTENT, NEXT_EXTENT, MIN_EXTENTS, PCT_INCREASE FROM SYS. DBA_TABLESPACES WHERE TABLESPACE_NAME = name;
Use the following SQL command to modify the default storage value of the temporary tablespace:
SQL> ALTER TABLESPACE name DEFAULT STORAGE (INITIAL XXX NEXT YYY );
Increasing the size of the default value may solve the problem. You can also modify the size of your temporary tablespace to solve the problem:
SQL> ALTER USER username TEMPORARY TABLESPACE new_tablespace_name;
After the alter tablespace command is run, the added space can be used without exiting the database or taking the TABLESPACE offline. However, once a data file is added, you cannot delete it. To delete it, you need to delete the tablespace.
An example of an error is as follows:
ORA-1652: unable to extend temp segment by 207381 in tablespace TEMPSPACE
The corresponding English is as follows:
Cause: Failed to allocate extent for temp segment in tablespace
Action: Use the alter tablespace add datafile statement to add one or more files to the specified tablespace or create the object in another tablespace.