728x90
Literal SQL 찾기
SELECT A.*,
(SELECT SQL_ID || ', ' || MODULE || ',' || SQL_TEXT
FROM V$SQL B
WHERE B.SQL_TEXT LIKE A.SQL_TEXT || '%'
AND ROWNUM = 1
) SQL_ID
FROM (
SELECT SUBSTR(SQL_TEXT, 1, 80) SQL_TEXT
, COUNT(*) CNT
FROM V$SQL
WHERE 1 = 1
-- AND ROWNUM < 10
AND EXECUTIONS < 2
GROUP BY SUBSTR(SQL_TEXT, 1, 80)
HAVING COUNT(*) > 100
) A
ORDER BY CNT DESC
literal 쿼리 fulltext를 확인하여 where절의 상수값을 변수로 고친다
SELECT sqlfull_text
FROM V$SQL
where sql_id = 'fk0vs6j5z004r'
728x90