以下都查看下
undo保留时间:
show parameter undo;
查UNDO段状态及自动调整的保留时间命令:
select BEGIN_TIME,END_TIME,MAXQUERYLEN,MAXQUERYSQLID,TUNED_UNDORETENTIONfrom V$UNDOSTAT Order By begin_time Desc;
查UNDO段EXPIRED等使用情况:
col "Tablespace_Name" for a15
col "Status" for a10
col "Size(GB)" for 99999
col "SIZE(GB)" for 99999.99
SELECT seg.tablespace_name "Tablespace_Name", round(ts.bytes/1024/1024/1024) "Size(GB)",ue.status "Status", count(*) "Used Extents",round(sum(ue.bytes)/1024/1024/1024, 2) "US_SIZE(GB)",to_char(round(sum(ue.bytes)/ts.bytes*100, 2), 99.99) "Used Rate(%)"
FROM dba_segments seg, DBA_UNDO_EXTENTS ue,(SELECT tablespace_name, sum(bytes) bytesFROM dba_data_files GROUP BY tablespace_name) ts
WHERE ue.segment_NAME=seg.segment_NAME and seg.tablespace_name=ts.tablespace_name
GROUP BY seg.tablespace_name, ts.bytes, ue.status
ORDER BY seg.tablespace_name;
执行下alter system set "_undo_autotune"=false scope=both sid='*';
根据这个maxqueryid查看下是执行的什么sql,这个占用大量的undo
把这个调小观察1天看看,ALTER SYSTEM SET undo_retention=7200 SCOPE=BOTH sid='*';
再不行,就继续扩大undo