A new application module is deployed on middle tier and is connecting to your database. You want
to monitor the performance of the SQL statements generated from the application.
To accomplish this, identify the required steps in the correct order from the steps given below:
1. Use DBNMS_APPLICATION_INFO to set the name of the module
2. Use DBMS_MONITOR.SERV_MOD_ACT_STAT_ENABLE to enable statistics gathering for the
module.
3. Use DBMS_MONITOR.SERV_MOD_ACT_TRACE_ENABLE to enable tracing for the service
4. Use the trcsess utility to consolidate the trace files generated.
5. Use the tkprof utility to convert the trace files into formatted output.
A.
1, 2, 3, 4, 5
B.
2, 3, 1, 4, 5
C.
3, 1, 2, 4, 5
D.
1, 2, 4, 5
E.
1, 3, 4, 5
F.
2, 1, 4, 5
Explanation:
Note:
* Before tracing can be enabled, the environment must first be configured to enable gathering of
statistics.
* (gather statistics): DBMS_MONITOR.SERV_MOD_ACT_STAT_ENABLE
Enables statistic gathering for a given combination of Service Name, MODULE and ACTION
* DBMS_MONITOR.SERV_MOD_ACT_TRACE_ENABLE
Enables SQL tracing for a given combination of Service Name, MODULE and ACTION globally
unless an instance_name is specified.
dbms_monitor.serv_mod_act_trace_enable(
service_name IN VARCHAR2,
module_name IN VARCHAR2 DEFAULT ANY_MODULE,
action_name IN VARCHAR2 DEFAULT ANY_ACTION,
waits IN BOOLEAN DEFAULT TRUE,
binds IN BOOLEAN DEFAULT FALSE,
instance_name IN VARCHAR2 DEFAULT NULL,
plan_stat IN VARCHAR2 DEFAULT NULL);
SELECT instance_name
FROM gv$instance;
exec dbms_monitor.serv_mod_act_trace_enable(‘TESTSERV’, dbms_monitor.all_modules,
dbms_monitor.all_actions, TRUE, TRUE, ‘orabase’);
exec dbms_monitor.serv_mod_act_trace_disable(‘TESTSERV’, dbms_monitor.all_modules,
dbms_monitor.all_actions, ‘orabase’);
* When solving tuning problems, session traces are very useful and offer vital information. Traces
are simple and straightforward for dedicated server sessions, but for shared server sessions,
many processes are involved. The trace pertaining to the user session is scattered across different
trace files belonging to different processes. This makes it difficult to get a complete picture of the
life cycle of a session.
Now there is a new tool, a command line utility called trcsess to help read the trace files. The
trcsess command-line utility consolidates trace information from selected trace files, based on
specified criteria. The criteria include session id, client id, service name, action name and module
name.* Once the trace files have been consolidated (with trcsess), tkprof can be run against the
consolidated trace file for reporting purposes.
I am not sure there is need to pick step 2 (DBMS_MONITOR.SERV_MOD_ACT_STAT_ENABLE), because statistics gathered by this step can be viewed by V$ views.
TRCSESS and TKPROF have both nothing to do with those statistics.
So, I would omit the step 2, and go for answer E.
I think A is correct