系統臨時表空間不足問題

xingfei80發表於2010-07-22

系統臨時表空間不足問題

轉自:http://rewqrewq.itpub.net/post/8005/502272

今天碰到個問題,系統的臨時表空間不斷報錯,說無法擴充套件。
ORA-1652: unable to extend temp segment by 128 in tablespace DMPTEMP
我們這個系統的臨時表空間應該足夠,但不知道為什麼會總是報無法擴充套件,於是查了查資料。
檢視當前佔用臨時表空間的語句:
SELECT a.username, a.sid, a.serial#, a.osuser, b.tablespace, b.blocks, c.sql_text
FROM v$session a, v$tempseg_usage b, v$sqlarea c
WHERE a.saddr = b.session_addr
AND c.address= a.sql_address
AND c.hash_value = a.sql_hash_value
ORDER BY b.tablespace, b.blocks;

下面就是AWR中在出問題的時間點執行的sql
 SELECT DISTINCT TO_CHAR(SUBSTR(b.sql_text,1,4000))
  FROM sys.WRH$_SQLTEXT b
  WHERE b.sql_id IN
  (SELECT sql_id
  FROM
  (SELECT a.sql_id
  FROM sys.WRH$_SQLSTAT a
  WHERE a.parsing_schema_name NOT IN ('SYS')
  AND a.executions_total >0
  AND a.direct_writes_total >0
  AND a.SNAP_ID IN
  (SELECT SNAP_ID
  FROM sys.WRM$_SNAPSHOT
  WHERE to_date('2008:08:20 17:20:08','yyyy:mm:dd hh24:mi:ss') BETWEEN begin_interval_time AND end_interval_time
  )
  ORDER BY a.direct_writes_total/ a.executions_total DESC
  )
  WHERE rownum<=10
  );

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/14663377/viewspace-1035483/,如需轉載,請註明出處,否則將追究法律責任。

相關文章