Calculate top 10 database wait events per wait class
select * from (
select c.wait_class as wait_class,e.event as event
from V$system_event e ,V$SYSTEM_WAIT_CLASS c
where e.wait_class_id=c.wait_class_id
order by e.total_waits desc
) tab
where rownum <=10