below script will help you to find out if a given sql is behaving differently at different times..means if a sql is having a single sql_id but multiple hash values then the run times will be different for each time as picks each values... to avoid it we need to find pick a better hash value and then create a sql profile for this to improve the performance.
select * from
table(dbms_xplan.display_awr('banap88bftthv'));
SELECT TO_CHAR(begin_interval_time,'DD-MM-YY HH24:MI') begin_interval_time,
TO_CHAR(ss.end_interval_time,'DD-MM-YY HH24:MI') end_interval_time,
sql_id,
plan_hash_value,
optimizer_cost,
executions_delta executions,
ROUND((elapsed_time_delta)/DECODE((executions_delta*1000000),0,1,(executions_delta*1000000)),5) TIME_PER_EXEC,
module,
sorts_total,
sorts_delta,
executions_delta,
executions_total,
disk_reads_total,
disk_reads_delta,
buffer_gets_total,
elapsed_time_total,
elapsed_time_delta
FROM dba_hist_snapshot ss,
dba_hist_sqlstat st
WHERE st.snap_id =ss.snap_id
AND st.module NOT IN ('emagent_SQL_oracle_database','emagent_AQMetrics')
AND sql_id ='banap88bftthv'
ORDER BY 1 DESC;
Hope this Helps....
Monday, September 21, 2015
Checking Multiple Hash Values for a given Sql
Subscribe to:
Post Comments (Atom)
PostgreSql: Useful Commands-
1) ************************* Users *************************** -- List of users with roles assigned: SELECT usename AS role_name, CASE...
-
1) sqplus to the database and make sure the Tempfiles that you want to rename or change the location. SQL> select name from v$tempfi...
-
Recently, we have seen this error while importing application schemas from one environment to another(which are of same Platforms). the imp...
-
when you dont see asmsnmp/sys/etc users are not available in the ASM. there is an easy way to create them back. As ASM user, ASMCMD...
No comments:
Post a Comment