QuestionQ36

VerifiedMonitoring and Tuning Database Performance

You must investigate the execution plan and statistics for a complex UPDATE that takes longer to run than expected.

The UPDATE is run by the PAYROLL module through the APPS service. Review this list of statements:

  1. EXECUTE DBMS_MONITOR.SERV_MOD_ACT_STAT_ENABLE (service_name => 'APPS', module_name => 'PAYROLL');
  2. EXECUTE DBMS_MONITOR.SERV_MOD_ACT_TRACE_ENABLE(service_name => 'APPS', module_name => 'PAYROLL');
  3. EXECUTE DBMS_MONITOR.SERV_MOD_ACT_STAT_DISABLE(service_name => 'APPS', module_name => 'PAYROLL');
  4. EXECUTE DBMS_MONITOR SERV_MOD_ACT_TRACE_DISABLE(service_name => 'APPS', module_name => 'PAYROLL');
  5. EXECUTE DBMS_SESSION.SESSION_TRACE_ENABLE
  6. EXECUTE DBMS_SESSION.SESSION_TRACE_DISABLE
  7. trcsess output=agg_apps_payroll.trc service='APPS' module='PAYROLL'
  8. tkprof agg_apps_payroll.trc formatted_output.txt sort=fchela
  9. tkprof agg_apps_payroll.trc formatted_output.txt sort=exeela

Which set of commands should be executed?

Explanation

DBMS_MONITOR.SERV_MOD_ACT_TRACE_ENABLE enables SQL tracing for the specified service and module, and the matching trace-disable procedure ends that tracing. Such tracing can produce multiple trace files, which trcsess combines using the service and module filters. For an UPDATE, the relevant elapsed-time metric is execute elapsed time, so TKPROF should sort by EXEELA; FCHELA is fetch elapsed time.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!