现象:12c 的库临时表空间爆了,ORA-01652:无法通过128(在表空间TEMP中)扩展temp段,本身临时表空间已经很大
查询临时表空间位置
select * from v$tempfile
新增临时表空间文件
alter tablespace temp add tempfile ‘XXX’ size 20G;
将临时表空间文件设为自增
alter database tempfile ‘XXX’ autoextend on next 100m maxsize 30G;
Oracle临时表空间不足,ORA-01652:无法通过128(在表空间TEMP中)扩展temp段
最终查到是备份引起,11g和12c NBU在备份时差异(BUG)
select machine,status,count(*)from v$session group by machine,status order by status;
select *
from (select t.sample_time,
s.PARSING_SCHEMA_NAME,
t.sql_id,
t.sql_child_number as sql_child,
round(t.temp_space_allocated / 1024 / 1024 / 1024, 2) || ’ G’ as temp_used,
round(t.temp_space_allocated /
(select sum(decode(d.autoextensible, ‘YES’, d.maxbytes, d.bytes))
from dba_temp_files d),
2) * 100 || ’ %’ as temp_pct,
t.program,
t.module,
s.SQL_TEXT
from v
a
c
t
i
v
e
s
e
s
s
i
o
n
h
i
s
t
o
r
y
t
,
v
active_session_history t, v
activesessionhistoryt,vsql s
where t.sample_time > to_date(‘2022-10-10 01:00:00’, ‘yyyy-mm-dd hh24:mi:ss’)
and t.sample_time < to_date(‘2022-10-10 11:20:00’, ‘yyyy-mm-dd hh24:mi:ss’)
and t.temp_space_allocated is not null
and t.sql_id = s.SQL_ID
order by t.temp_space_allocated desc)
where rownum < 500
order by temp_used desc;
https://cdn.modb.pro/db/484698