Beruflich Dokumente
Kultur Dokumente
TUNING SCRIPTS
Posted by Gavin Soorma
On November 16, 2012 1 Comments
ASH, awr, Performance Tuning, scripts
select * from (
select active_session_history.event,
sum(active_session_history.wait_time +
active_session_history.time_waited) ttl_wait_time
from v$active_session_history active_session_hist
ory
where active_session_history.event is not null
group by active_session_history.event
order by 2 desc)
where rownum < 6
/
converted by Web2PDFConvert.com
group by (wait_class)))
order by 3;
converted by Web2PDFConvert.com
SQL_ID,
sum(CPU_TIME_DELTA),
sum(DISK_READS_DELTA),
count(*)
from
DBA_HIST_SQLSTAT a, dba_hist_snapshot s
where
s.snap_id = a.snap_id
and s.begin_interval_time > sysdate -1
and EXTRACT(HOUR FROM S.END_INTERVAL_T
IME) between 9 and 11
group by
SQL_ID
order by
sum(CPU_TIME_DELTA) desc)
where rownum
select * from
(
select dba_objects.object_name,
dba_objects.object_type,
active_session_history.event,
sum(active_session_history.wait_time +
active_session_history.time_waited) ttl_wait_time
from v$active_session_history active_session_hist
ory,
dba_objects
where
active_session_history.sample_time between sysda
te - 1/24 and sysdate
and active_session_history.current_obj# = dba_obj
ects.object_id
group by dba_objects.object_name, dba_objects.o
bject_type, active_session_history.event
order by 4 desc)
where rownum < 6;
converted by Web2PDFConvert.com
Find what the top SQL
was at a particular
reported time of day
First determine the snapshot id values for the
period in question.
In thos example we need to find the SNAP_ID for
the period 10 PM to 11 PM on the 14th of
November, 2012.
select snap_id,begin_interval_time,end_interval_tim
e
from dba_hist_snapshot
where to_char(begin_interval_time,'DD-MON-YYYY
')='14-NOV-2012'
and EXTRACT(HOUR FROM begin_interval_time)
between 22 and 23;
select * from
(
select
sql.sql_id c1,
sql.buffer_gets_delta c2,
sql.disk_reads_delta c3,
sql.iowait_delta c4
from
dba_hist_sqlstat sql,
dba_hist_snapshot s
where
s.snap_id = sql.snap_id
and
s.snap_id= &snapid
order by
c3 desc)
where rownum < 6
/
converted by Web2PDFConvert.com
Do we have multiple
plan hash values for the
same SQL ID in that
case may be changed
plan is causing bad
performance
select
SQL_ID
, PLAN_HASH_VALUE
, sum(EXECUTIONS_DELTA) EXECUTIONS
, sum(ROWS_PROCESSED_DELTA) CROWS
, trunc(sum(CPU_TIME_DELTA)/1000000/60) CPU_
MINS
, trunc(sum(ELAPSED_TIME_DELTA)/1000000/60)
ELA_MINS
from DBA_HIST_SQLSTAT
where SQL_ID in (
'&sqlid')
group by SQL_ID , PLAN_HASH_VALUE
order by SQL_ID, CPU_MINS;
converted by Web2PDFConvert.com
1 COMMENTS
Sudipta Bhaskar
Apr 4 2017
Very much helpful.
LEAVE REPLY
P O S T C O M M E N T
R E C E N T P O S T S
converted by Web2PDFConvert.com
June 11, 2017
C O N T A C T M E
Perth, Australia
+ (61) 417713124
prosolutions@gavinsoorma.com
R E C E N T C O M M E N T S A N D F E E D B A C K
Victor Kisovi
on
Oracle 11g Grid Control Agent Deployment
Thanks Garvin. This is helpful.
shravan
on
DBA Monitoring Menu
Hi Gavin, One single script..will reduce much work
of DBA's. Thanks for the script. really appreciated.
skmanoharan10097859600
on
Using GoldenGate 12c with an Oracle 12c
Multitenant database
Hi Gavin Thanks a lot for your nice article. As
Oracle 12C is more focused on Database
consolidation I am
Chandra
on
DBA Monitoring Menu
Excellent Work...can be easily deployed to make it
work in our environment.
Gavin Soorma
on
converted by Web2PDFConvert.com
Oracle 12c Release 2 (12.2.0.1.0) Grid Infrastructure
Upgrade
Hi - it is mentioned in the MOS note "Patches to
apply before upgrading Oracle GI and DB to
12.2.0.1
brian choy
on
RMAN 11g new feature Backup Fast Recovery
Area (FRA) to Disk
Excellent feature that make our data more robust,
I have yet to test it out
Kuntal
on
Performing a database clone using a Data Guard
Snapshot Database
Hi Gavin, Thanks for the document, I was working
on the same kind of cloning process (test db from
snapshot
RIchard Guo
on
Oracle Goldengate 12c on DBFS for RAC and
Exadata
Hi, I am interested in "Oracle Goldengate 12c on
DBFS for RAC and Exadata" article. Before I pay
membership I'd
Jon Adams
on
Oracle 12c Release 2 (12.2.0.1.0) Grid Infrastructure
Upgrade
I had a base 12.1.0.2 RAC install in a virtual
environment and went through the upgrade docs
which recommended running
converted by Web2PDFConvert.com