과도한 리터럴SQL 이 발생하고 있는지 확인 한번 해보세요~ 동일한 쿼리에 조건절의 상수값만 변경되어 실행되는 쿼리가 있는지 확인해 보세요 메모리를 많이 사용하는 리터럴SQL을 바인드변수로 쿼리 수정해야 합니다. select * from ( select count(*) as cnt , substr(sql_text, 1, 50) as sql_text , sum(executions) as tot_exec , round(sum(sharable_mem/1024/1024), 2) as mem_MB , min(first_load_time) as start_time , max(first_load_time) as end_time , max(sql_id) as sql_id from v$sqlarea where 1=1 and executions < 5 group by substr(sql_text, 1, 50) order by cnt desc ) where rownum <= 20 ;
사용은 안해봤지만 예전에 리터럴SQL 찾는 쿼리라고 기록해놓은 게 있네요.
select *
from
(
select parsing_schema_name , sql_id, sql_text, executions
,sum(executions) over(partition by force_matching_signature ) executions_sum
, row_number() over(partition by force_matching_signature order by sql_id desc) rnum
, count( *) over (partition by force_matching_signature) cnt
, force_matching_signature
, module
from gv$sqlarea s
where force_matching_signature != 0
)
where cnt > 5
--and rnum = 1
order by module , cnt desc, sql_text