My Oracle Support Banner

ORA-01652: Estimate Space Needed to CREATE INDEX (Doc ID 100492.1)

Last updated on DECEMBER 10, 2023

Applies to:

Oracle Database Exadata Express Cloud Service - Version N/A and later
Gen 1 Exadata Cloud at Customer (Oracle Exadata Database Cloud Machine) - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Backup Service - Version N/A and later
Oracle Database Cloud Exadata Service - Version N/A and later
Information in this document applies to any platform.



You are creating an index on a large table and you receive the following error message:

 ORA-01652: unable to extend temp segment by %s in tablespace %s 
     Cause: Failed to allocate an extent for temp segment in tablespace.
    Action: Use ALTER TABLESPACE ADD DATAFILE statement to add one or more 
            files to the tablespace indicated or create the object in other 

You check the available space in the tablespace where the index will be created and there are free space to accommodate the index.
You want to know how to calculate the space needed more accurately in order to avoid the ora-1652 in the future. 
You also want to know if there is any way to reduce the sort space Oracle needs to create the index.
With the index segment creation, temp segments are created in the destination tablespace of the index. If that segment cannot be extended, the ORA-01652 is raised.
However, the ORA-01652 can also be reported for the TEMP tablespace which may be too small for the required sorting operation. In that case, you obviously have to increase the size of the TEMP tablespace.




To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.