Home / Oracle Errors / ORA-01652

ORA-01652

Unable to extend temp segment in tablespace

What it means

A sort, hash join or index build ran out of space in the TEMP tablespace.

Common causes

How to fix it

  1. See who uses temp: SELECT s.sid,s.username,u.blocks*8/1024 mb FROM v$tempseg_usage u JOIN v$session s ON s.saddr=u.session_addr ORDER BY 3 DESC;
  2. Add space: ALTER TABLESPACE temp ADD TEMPFILE SIZE 8G AUTOEXTEND ON;
  3. Tune the SQL causing the big sort

How to prevent it

Monitor TEMP and fix queries with missing joins.

Still stuck? Ask the community in Q&A.

Get the weekly Vismo digestNew Oracle articles and Q&A in your inbox. No spam.

One email a week. Unsubscribe any time.