SELECT *
FROM ( SELECT INST_ID, SQL_ID, HASH_VALUE, PARSING_SCHEMA_NAME SCHEMA, LENGTH(SQL_FULLTEXT) SQL_LENGTH, MODULE, BUFFER_GETS, EXECUTIONS,
ROUND(BUFFER_GETS/DECODE(EXECUTIONS, 0, NULL, EXECUTIONS)) "BUFFER_GET/EXEC",
ROUND(DISK_READS/DECODE(EXECUTIONS, 0, NULL, EXECUTIONS)) "DISK_READ/EXEC",
ROUND(ROWS_PROCESSED/DECODE(EXECUTIONS, 0, NULL, EXECUTIONS)) "ROWS_PROCESSED/EXEC",
ROUND(PARSE_CALLS/DECODE(EXECUTIONS, 0, NULL, EXECUTIONS)) "PARSE_CALL/EXEC",
ROUND(CPU_TIME/DECODE(EXECUTIONS, 0, NULL, EXECUTIONS)/1000000,2) "CPU_TIME(SEC)/EXEC",
ROUND(ELAPSED_TIME/DECODE(EXECUTIONS, 0, NULL, EXECUTIONS)/1000000,5) "ELAPSED(SEC)/EXEC",
ROUND(USER_IO_WAIT_TIME/DECODE(EXECUTIONS, 0, NULL, EXECUTIONS)/1000000,2) "IOWAIT/EXEC",
ROUND(CLUSTER_WAIT_TIME/DECODE(EXECUTIONS, 0, NULL, EXECUTIONS)/1000000,2) "CLWAIT/EXEC",
ROUND(APPLICATION_WAIT_TIME/DECODE(EXECUTIONS, 0, NULL, EXECUTIONS)/1000000,2) "APWAIT/EXEC",
ROUND(CONCURRENCY_WAIT_TIME/DECODE(EXECUTIONS, 0, NULL, EXECUTIONS)/1000000,2) "CCWAIT/EXEC",
FIRST_LOAD_TIME, LAST_LOAD_TIME, SQL_FULLTEXT
FROM GV$SQLAREA
WHERE 1=1
--AND INST_ID=2
--AND PARSING_SCHEMA_NAME NOT IN ('SYS','SYSTEM','DBSNMP','SYSMAN','WMSYS','EXFSYS','OGG','SKPDBA')
--AND PARSING_SCHEMA_NAME IN ('IDMS')
--AND MODULE NOT IN ('Orange for ORACLE Standard','Orange for ORACLE DBA - Loader','SQL*Plus','TOAD 10.5.1.3','Orange for ORACLE DBA','Orange for ORACLE (Unicode) DBA ','SQL Developer','SQLGateMain.exe','Orange for ORACLE Standard ','SQLGate for Oracle Developer 6.2.0.1','SQLGate Query Session','SQLGate 6.4.1.3','OrangeMain.EXE','SQL Developer')
--AND UPPER(SQL_FULLTEXT) NOT LIKE 'EXPLAIN%'
--AND UPPER(SQL_FULLTEXT) NOT LIKE 'SELECT 1 FROM DUAL%'
--AND UPPER(SQL_FULLTEXT) NOT LIKE '%ANALYZE%'
--AND UPPER(SQL_FULLTEXT) NOT LIKE 'EXPLAIN%'
--AND UPPER(SQL_FULLTEXT) NOT LIKE '%GETRECENTORDERLIST%'
--AND UPPER(SQL_FULLTEXT) LIKE '%CART%'
AND SQL_ID IN ('7b85a52pcgbuw')
--AND (ROUND(BUFFER_GETS/DECODE(EXECUTIONS, 0, NULL, EXECUTIONS)) > 10000 OR ROUND(DISK_READS/DECODE(EXECUTIONS, 0, NULL, EXECUTIONS)) > 10000)
AND EXECUTIONS >= 1
--ORDER BY SUBSTR(SQL_FULLTEXT,1,50)
--ORDER BY EXECUTIONS DESC
--ORDER BY ROUND(ELAPSED_TIME/DECODE(EXECUTIONS, 0, NULL, EXECUTIONS)/1000000,5) DESC
--ORDER BY ROUND(BUFFER_GETS/DECODE(EXECUTIONS, 0, NULL, EXECUTIONS)) DESC
--ORDER BY ROUND(CLUSTER_WAIT_TIME/DECODE(EXECUTIONS, 0, NULL, EXECUTIONS)/1000000,2) DESC
)
WHERE ROWNUM <= 1000;
'OraclE' 카테고리의 다른 글
오라클 메모리 사용 확인(AIX) (0) | 2023.03.22 |
---|---|
SPM - 튜닝된 SQL의 실행계획을 등록하고 적용 하는 방법 (0) | 2022.06.13 |
SPM(SQL PLAN MANAGEMENT) (0) | 2022.06.13 |
OGG 동기화 테이블 추가 (0) | 2022.04.04 |
active session history (0) | 2022.01.30 |