Write a Query to find Top 5 wait events in Database
Performance optimization of databases is one of the routine tasks of DBAs. This task becomes very easy when you have Oracle Enterprise Manager tool installed. You can generate various reports from AWR and analyze the health of the database and then tune it accordingly. This is normal in every DBA’s life. But what if you don’t have the OEM installed? This is very much possible in a test environment. In this case, you need to generate the reports manually. You need to query the database to extract the data requried for analysis. For such requirements, we have the below query to find out “Top 5 wait events in the database”. The query gives Date, Event_Name and Total_Waits. Query to find Top 5 wait events in database: select Day, Event_name, Total_wait from ( select day, event_name, sum(event_time_waited) total_wait, row_number() over (partition by day order by sum(event_time_waited) desc) rn from ( SELECT to_date(to_char(begin_interval_time,’dd/mm/yyyy’),’dd/mm/yy...