SELECT D.NAME,
SS.SNAP_ID,
SS.INSTANCE_NUMBER,
SS.SQL_ID,
ST.SQL_TEXT,
SH.MACHINE,
SS.MODULE,
SS.ACTION,
SS.PARSING_SCHEMA_NAME,
SS.FETCHES_TOTAL,
SS.SORTS_TOTAL,
SS.EXECUTIONS_TOTAL,
SS.LOADS_TOTAL,
SS.PARSE_CALLS_TOTAL,
SS.DISK_READS_TOTAL,
SS.BUFFER_GETS_TOTAL,
SS.ROWS_PROCESSED_TOTAL,
SS.CPU_TIME_TOTAL,
SS.IOWAIT_TOTAL,
SS.ELAPSED_TIME_TOTAL
FROM DBA_HIST_SQLSTAT SS,
DBA_HIST_SNAPSHOT SP,
DBA_HIST_SQLTEXT ST,
DBA_HIST_ACTIVE_SESS_HISTORY SH,
V$DATABASE D
WHERE SS.SNAP_ID = SP.SNAP_ID
AND SS.DBID = SP.DBID
AND SS.DBID = D.DBID
AND SS.INSTANCE_NUMBER = SP.INSTANCE_NUMBER
AND SS.DBID = ST.DBID
AND SS.SQL_ID = ST.SQL_ID
AND SS.SNAP_ID = SH.SNAP_ID
AND SS.DBID = SH.DBID
AND SS.INSTANCE_NUMBER = SH.INSTANCE_NUMBER
AND SS.SQL_ID = SH.SQL_ID
AND SH.SAMPLE_TIME BETWEEN
TO_TIMESTAMP(‘2021-04-2217:00:00’, ‘YYYY-MM-DD HH24:MI:SS’) AND
TO_TIMESTAMP(‘2021-04-2218:00:00’, ‘YYYY-MM-DD HH24:MI:SS’);
SQL语句
最新推荐文章于 2024-08-14 11:10:56 发布