Database Reference
In-Depth Information
The structure of the trace file shown on the right in Figure 3-3 may be generated with the following PL/SQL block,
provided you have previously enabled SQL trace:
DECLARE
l_dummy VARCHAR2(10);
BEGIN
dbms_session.set_identifier(client_id => 'helicon.antognini.ch');
dbms_application_info.set_module(module_name => 'Module 1',
action_name => 'Action 11');
-- code module 1, action 11
SELECT 'Action 11' INTO l_dummy FROM dual;
dbms_application_info.set_module(module_name => 'Module 1',
action_name => 'Action 12');
-- code module 1, action 12
SELECT 'Action 12' INTO l_dummy FROM dual;
dbms_application_info.set_module(module_name => 'Module 1',
action_name => 'Action 13');
-- code module 1, action 13
SELECT 'Action 13' INTO l_dummy FROM dual;
dbms_application_info.set_module(module_name => 'Module 2',
action_name => 'Action 21');
-- code module 2, action 21
SELECT 'Action 21' INTO l_dummy FROM dual;
dbms_application_info.set_module(module_name => 'Module 2',
action_name => 'Action 22');
-- code module 2, action 22
SELECT 'Action 22' INTO l_dummy FROM dual;
END;
The tags beginning with the three stars (***), used in Figure 3-3 to mark a section, are the ones used in the trace
files. The difference with the trace files is that not only does the database engine repeat some of them for each section,
but in addition, a timestamp is added. The following trace file snippet shows an example of content generated by the
previous PL/SQL block:
*** CLIENT ID:(helicon.antognini.ch) 2012-11-30 10:05:05.531
*** MODULE NAME:(Module 1) 2012-11-30 10:05:05.531
*** ACTION NAME:(Action 11) 2012-11-30 10:05:05.531
...
...
*** MODULE NAME:(Module 1) 2012-11-30 10:05:05.532
*** ACTION NAME:(Action 12) 2012-11-30 10:05:05.532
...
...
*** MODULE NAME:(Module 1) 2012-11-30 10:05:05.533
*** ACTION NAME:(Action 13) 2012-11-30 10:05:05.533
...
...
*** MODULE NAME:(Module 2) 2012-11-30 10:05:05.533
*** ACTION NAME:(Action 21) 2012-11-30 10:05:05.533
...
...
Search WWH ::




Custom Search