2017-12-04 5 views
0

우리는 일괄 적으로 데이터를 처리하고있는 사용자가 있기 때문에 일부 사용자가 불만을 토로합니다. 우리가 관찰 한 AWR 리포트에서 작업이 실행되는 동안 어플리케이션이 느립니다. 임시 테이블 스페이스는 자동 테이블 확장이있는 32GB입니다. on, JOB 실행시 임시 테이블 공간 사용량을 확인하는 방법이 있습니다. 우리는 테이블 공간의 히스토리 사용을 확인할 수 있습니다. 미리 감사드립니다.임시 테이블 스페이스 사용량

답변

0
--#1: Find the maximum temporary tablespace used during a snapshot. 
select begin_time, end_time, instance_number, round(maxval/1024/1024) temp_mb 
from dba_hist_sysmetric_summary 
where metric_name = 'Temp Space Used' 
order by 1,2,3; 

--#2: Find SQL statements running around the same time. 
--Look for the event it was waiting on. Was it waiting on something like 
--"resumable session", implying that no temporary tablespace was available? Or was it 
--waiting on reading and writing temporary tablespace because of large data or a bad plan? 
select sql_id, event, round(temp_space_allocated)/1024/1024 temp_mb, sql_plan_line_id, 
    dba_hist_active_sess_history.* 
from dba_hist_active_sess_history 
where sample_time between timestamp '2017-12-03 12:00:00' and timestamp '2017-12-03 13:00:00' 
order by sample_time desc; 

--#3: Find the slow operation in the SQL Monitor Report. (If you're using AWR you probably 
--have also licensed the diagnostics pack, and can use this tool.) Find the operation that 
--used too much temporary tablespace and try to figure out why. Are the objects simply 
--too large for the temporary tablespace? Is there a cross join creating a huge 
--intermediate result set? Is the execution plan bad and Oracle is sorting/hashing 
--result sets poorly? 
select dbms_sqltune.report_sql_monitor(sql_id => '[enter SQL_ID from above]') from dual;