Reports expensive SQL from V$SQLAREA, V$SQLTEXT view
Joins to V$SQLTEXT using ADDRESS column
select sql_text
, lpad(username,9) parsing_user
, executions
, loads
, DISK_READS
, BUFFER_GETS
, ROWS_PROCESSED
from v$sqlarea a
, dba_users b
where upper(sql_text) not like upper('%dbms%')
and a.PARSING_USER_ID = b.user_id
--and DISK_READS > &number_of_expensive_DISK_READS
--and b.username = upper('&parsing_username')
order by DISK_READS desc
, ROWS_PROCESSED desc
, BUFFER_GETS desc
, username
/
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
"CORE 11.2.0.4.0 Production"
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
Немає коментарів:
Дописати коментар