DBA Data[Home] [Help]

PACKAGE: SYS.DBMS_TRACE

Source


1 package     dbms_trace authid definer is
2   ------------
3   --  OVERVIEW
4   --
5   --  This package provides routines to start and stop PL/SQL tracing
6   --
7 
8   -------------
9   --  CONSTANTS
10   --
11 
12   -- Define constants to control which PL/SQL features are traced. For each
13   -- feature, there are two constants:
14   --    one to trace all occurences of the feature
15   --    one to trace only those occurences in modules compiled debug
16   -- To trace multiple features, simply add the constants.
17   --
18   trace_all_calls          constant integer := 1;  -- Trace calls/returns
19   trace_enabled_calls      constant integer := 2;
20 
21   trace_all_exceptions     constant integer := 4;  -- trace exceptions
22   trace_enabled_exceptions constant integer := 8;  -- (and handlers)
23 
24   trace_all_sql            constant integer := 32; -- trace SQL statements
25   trace_enabled_sql        constant integer := 64; -- at PL/SQL level (does
26                                                    -- not invoke SQL trace)
27 
28   trace_all_lines          constant integer := 128; -- trace each line
29   trace_enabled_lines      constant integer := 256;
30 
31   -- There are also some constants to allow control of the trace package
32   --
33   trace_stop               constant integer := 16384;
34 
35   -- Pause/resume allow tracing to be paused and later resumed.
36   --
37   trace_pause              constant integer := 4096;
38   trace_resume             constant integer := 8192;
39 
40   -- Save only the last few records. This allows tracing up to a problem
41   -- area, without filling the database up with masses of irrelevant crud.
42   -- If event 10940 is set, the limit is 1023*(the value of event 10940).
43   -- This can be overridden by the routine limit_plsql_trace
44   --
45   trace_limit              constant integer := 16;
46 
47   -- [5066528] Don't trace such 'administrative' events as 'PL/SQL Trace Tool
48   -- started', 'Trace flags changed', 'PL/SQL Virtual Machine started' and
49   -- 'PL/SQL Virtual Machine stopped'.
50   --
51   no_trace_administrative  constant integer := 32768;
52 
53   -- [5066528] Don't trace handled exceptions, only unhandled ones.
54   no_trace_handled_exceptions constant integer := 65536;
55 
56   --
57   -- version history:
58   --   1.0 - creation
59   --
60   trace_major_version constant binary_integer := 1;
61   trace_minor_version constant binary_integer := 0;
62 
63   -- CONSTANTS
64   --
65   -- The following constants are used in the "event_kind" column, to identify
66   -- the various records in the database. All references to them should use
67   -- the symbolic names
68   --
69   plsql_trace_start        constant integer := 38; -- Start tracing
70   plsql_trace_stop         constant integer := 39; -- Finish tracing
71   plsql_trace_set_flags    constant integer := 40; -- Change trace options
72   plsql_trace_pause        constant integer := 41; -- Tracing paused
73   plsql_trace_resume       constant integer := 42; -- Tracing resumed
74   plsql_trace_enter_vm     constant integer := 43; -- New PL/SQL VM entered                                           /* Entering the VM */
75   plsql_trace_exit_vm      constant integer := 44; -- PL/SQL VM  exited*
76   plsql_trace_begin_call   constant integer := 45; -- Calling normal routine
77   plsql_trace_elab_spec    constant integer := 46; -- Calling package spec                                     /* Calling package spec*/
78   plsql_trace_elab_body    constant integer := 47; -- Calling package body
79   plsql_trace_icd          constant integer := 48; -- Call to internal PL/SQL routine
80   plsql_trace_rpc          constant integer := 49; -- Remote procedure call
81   plsql_trace_end_call     constant integer := 50; -- Returning from a call
82   plsql_trace_new_line     constant integer := 51; -- Line number changed
83   plsql_trace_excp_raised  constant integer := 52; -- Exception raised
84   plsql_trace_excp_handled constant integer := 53; -- Exception handler
85   plsql_trace_sql          constant integer := 54; -- SQL statement
86   plsql_trace_bind         constant integer := 55; -- Bind parameters
87   plsql_trace_user         constant integer := 56; -- User requested record
88   plsql_trace_nodebug      constant integer := 57; -- Some events skipped
89                                                    -- because module compiled
90                                                    -- NODEBUG
91   plsql_trace_excp_unhandled constant integer := 58; -- Exception unhandled at
92                                                    -- top level
93 
94   ----------------------------
95   --  PROCEDURES AND FUNCTIONS
96   --
97 
98   -- start trace data dumping in session
99   -- the parameter is the sum of the above constants representing which
100   -- events to trace
101   procedure set_plsql_trace(trace_level in binary_integer);
102 
103   -- get the current trace level (again, a sum of the above constants).
104   function get_plsql_trace_level return binary_integer;
105 
106   -- Return the run-number
107   function get_plsql_trace_runnumber return binary_integer;
108 
109   -- stop trace data dumping in session
110   procedure clear_plsql_trace;
111 
112   -- pause trace data dumping in session
113   procedure pause_plsql_trace;
114 
115   -- pause trace data dumping in session
116   procedure resume_plsql_trace;
117 
118   -- limit amount of trace data dumped
119   -- the parameter is the approximate number of records to keep.
120   -- (the most recent records are retained)
121   procedure limit_plsql_trace(limit in binary_integer := 8192);
122 
123   -- Add user comment to trace table
124   procedure comment_plsql_trace(comment in varchar2);
125 
126   -- This function verifies that this version of the dbms_trace package
127   -- can work with the implementation in the database.
128   --
129   function internal_version_check return binary_integer;
130 
131   -- get version number of trace package
132   procedure plsql_trace_version(major out binary_integer,
133                                 minor out binary_integer);
134 
135 end dbms_trace;