I want to build a scheduled job in Enterprise Manager to trigger every hour the following query:
SELECT output FROM TABLE(dbms_workload_repository.ash_global_report_text(584958394, Null, SYSDATE-1/24, SYSDATE, l_wait_class=>'Scheduler'));
I want to capture Events and the percentage only if I get one with Scheduler resmgr:cpu quantum And then I want to parse this output only out. I get now the big varchar(320) column output when I hit the query, but I want also to build a PL/SQL package where I can add variables inside and also to parse out only the important percentage of the resmgr: cpu quantum event. Other events are not important to me.
Any help would be appreciated.
Kind regards.
1 Answer 1
The DB time can be queried from dba_hist_sys_time_model
.
resmgr: cpu quantum
can be queried from dba_hist_system_event
.
snap_id
can be matched to time periods through dba_hist_snapshot
.
Instead of generating a report then parsing it, use the above views to query what you need.
-
Hi. Seems like a good approach. So this would mean that I need to combine dba_hist_system_event and dba_hist_snapshot to get the results. How can I have this i one query that I trigger, that shows me the past hour of results ? Do you have an example maybe ?ultimo_frogman– ultimo_frogman2020年08月30日 08:17:32 +00:00Commented Aug 30, 2020 at 8:17
DBA_HIST_ACTIVE_SESS_HISTORY
orV$ACTIVE_SESSION_HISTORY
directly? What is the original problem that you tried to solve with this?