Oracle Script to display slow jobs details
column e_dttm format a15
column usr format a10
column hp format 9999999999
select
TO_CHAR(m. end_time, ' DD-MON-YYYY HH24:MI: SS' ) e_dttm, -- Interval End Time
m.intsize_csec/100 ints, -- Interval size in sec
s.username usr,
m.session_id sid,
m.session_serial_num ssn,
ROUND( m. cpu) cpu100, -- CPU usage 100th sec
m.physical_reads prds, -- Number of physical reads
m.logical_reads lrds, -- Number of logical reads
m.pga_memory pga, -- PGA size at end of interval
m.hard_parses hp,
m.soft_parses sp,
m.physical_read_pct prp,
m.logical_read_pct lrp,
s.sql_id
from v$sessmetric m, v$session s
where (m. physical_reads > 100
or m. cpu > 100
or m. logical_reads > 100)
and m. session_id = s. sid
and m. session_serial_num = s. serial#
order by m. physical_reads DESC, m. cpu DESC, m. logical_reads DESC;
Repository of Database Related Information, Assets and Knowledge Base covering Oracle, SQLs, Scripts, Performance Tuning etc
Subscribe to:
Post Comments (Atom)
Labels
oracle SQL
oracle database
oracle 10g
SQL
Optimizer
user
v$session
parameter
sid
sqlplus;database name
userid
username
SET
SPOOL
SQL Faq
SQL Tutorial
column
imp
import
initialization
optimization
oracle DBA
oracle hints
process
rename
rename table
sizing
sql hints
statistics
status
system tables
table
table locks
tablespace
temp tablespace
user name
v$lock
v$parameter
v$process
v$sessmetric
v$sql
No comments:
Post a Comment