DatabaseProcApplicationCreatedLinks
sybsystemprocssp_monitor  14 déc. 14Defects Propagation Dependencies

1     
2     /*
3     ** sp_monitor is the wrapper for any stored procedure that chooses to
4     ** display data from monitoring tables.
5     ** 
6     ** A new subordinate stored procedure should be created for each specific
7     ** option to sp_monitor. 
8     ** Consider the example for statement monitoring.
9     ** A new option "statement" is provided to sp_monitor and a sub-ordinate
10    ** stored procedure sp_monitor_statement gets invoked when this option
11    ** is passed in. Additional parameters could also be passed in for 
12    ** specific options as seen fit.
13    {
14    */
15    create or replace procedure sp_monitor @entity varchar(30) = NULL,
16        @dbname varchar(30) = NULL,
17        @OrderBy_OR_Procname varchar(30) = NULL,
18        @option varchar(30) = NULL
19    with EXECUTE AS OWNER
20        as
21            begin
22                declare @listall int
23                declare @u_entity varchar(30)
24                    , @l_entity varchar(30)
25                    , @entity_arg varchar(30) -- user supplied argument.
26                    , @charindex int
27                declare @u_dbname varchar(30)
28                    , @l_dbname varchar(30)
29                declare @u_option varchar(30)
30                declare @monprocname varchar(255)
31                    , @crt_procname varchar(100) -- For sp_monitor_crt_mon_config
32                declare @rtnstatus int
33                declare @spid int
34                    , @context int
35                    , @valid_entity tinyint -- @entity is valid
36                    , @valid_montype tinyint -- @dbname is a valid monitoring type
37    
38                /*
39                **  If we're in a transaction, disallow this since it might make recovery
40                **  impossible.
41                */
42                if @@trancount > 0
43                begin
44                    /* 17260, "Can't run %1! from within a transaction." */
45                    raiserror 17260, "sp_monitor"
46                    return (1)
47                end
48                else
49                begin
50                    set chained off
51                end
52    
53                set transaction isolation level 1
54    
55                -- Trim off leading/trailing spaces to make parsing simpler.
56                --
57                select @entity = ltrim(rtrim(@entity))
58    
59                -- Save off the user-input 1st arg, as we might reuse it for a substring.
60                --
61                select @entity_arg = @entity
62    
63                -- If 1st arg is 'archive', or 'report', it might have a substring naming the
64                -- archive table's prefix, starting with ' using' clause. Extract out the
65                -- basic command first.
66                --
67                select @charindex = charindex(' ', @entity)
68                if (@charindex != 0)
69                begin
70                    select @entity = substring(@entity, 1, (@charindex - 1))
71                end
72    
73                -- Convert to upper and lower case, for future re-use
74                select @u_entity = upper(@entity)
75                    , @l_entity = lower(@entity)
76                    , @u_dbname = upper(@dbname)
77                    , @l_dbname = lower(@dbname)
78                    , @u_option = upper(@option)
79    
80                    -- Assume some error in control flow till we validate all arguments.
81                    , @rtnstatus = 1
82    
83                    -- Assume invalid arguments till we know otherwise.
84                    , @valid_entity = case when @entity IS NOT NULL then 0 else 1 end
85                    , @valid_montype = case when @dbname IS NOT NULL then 0 else 1 end
86                    , @context = NULL
87    
88                -- Cache status of valid entity and monitoring type (for reuse).
89                --
90                if ((@u_entity is not NULL)
91                        and (@u_entity IN ("ENABLE"
92                                , "DISABLE"
93                                , "PROCEDURE"
94                                , "CONNECTION"
95                                , "STATEMENT"
96                                , "EVENT"
97                                , "DEADLOCK"
98                                , "PROCSTACK"
99                                , "ARCHIVE"
100                               , "REPORT"
101                               , "HELP"
102                               , "LIST"
103                               , "TRACE" -- undocumented option; internal use
104                           )
105                       )
106                   )
107               begin
108                   select @valid_entity = 1
109               end
110   
111               if ((@u_dbname is not NULL)
112                       and (@u_dbname IN ("ENABLE"
113                               , "DISABLE"
114                               , "PROCEDURE"
115                               , "CONNECTION"
116                               , "STATEMENT"
117                               , "EVENT"
118                               , "DEADLOCK"
119                               , "PROCSTACK"
120                               , "ARCHIVE"
121                               , "REPORT"
122                               , "HELP" -- 2nd arg can be 'help'.
123                               , "ALL" -- 2nd arg can be 'help', 'all'.
124                           )
125                       )
126                   )
127               begin
128                   select @valid_montype = 1
129               end
130   
131               /* 
132               ** Verify if the parameters passed in are valid. Note that it is not possible
133               ** to do all parameter passing here but effort is made to do as much of checking
134               ** as possible. In cases where decisions on parameters cannot be made, they are 
135               ** deferred to the individual stored procedure.
136               */
137   
138               if (
139                       (@valid_entity = 0)
140                       OR
141                       ((@u_entity = "HELP") AND (@valid_montype = 0))
142                       OR
143                       (@u_entity in ("CONNECTION", "STATEMENT", "ENABLE", "DISABLE",
144                               "EVENT", "HELP", "") AND
145                           ((@OrderBy_OR_Procname is NOT NULL) OR (@option is NOT NULL)))
146                       OR
147                       (@u_entity = "PROCEDURE" AND ((@u_option not in ("SUMMARY", "DETAIL"))
148                               AND (@option is NOT NULL)))
149                       OR
150                       (@u_entity in ("CONNECTION", "STATEMENT")
151                           AND (@u_dbname not in ("CPU", "DISKIO", "ELAPSED TIME", ""))
152                           AND (@u_dbname is not NULL)
153                       )
154                   )
155               begin
156                   -- Reuse variable to report help message. In the error generate the
157                   -- sp_monitor invocation to get the appropriate help, depending on the
158                   -- monitoring type requested.
159                   --
160                   -- . If a valid monitoring type was requested,  generate:
161                   --	sp_monitor 'help', ''
162                   --
163                   -- . If an invalid monitoring type was requested,  generate:
164                   --	sp_monitor 'help'
165                   --
166                   -- . If 'help' was the command, generate:
167                   --	sp_monitor 'help'
168                   --
169                   select @monprocname = "sp_monitor 'help'"
170                       + case
171                           when (@valid_entity = 1) and (@l_entity != 'help')
172                           then ", '" + @l_entity + "'"
173                           else NULL
174                       end
175                   if ((@valid_entity = 0) or (@valid_montype = 0))
176                   begin
177                       select @entity_arg = case
178                               when @valid_entity = 0
179                               then @entity
180                               when @valid_montype = 0
181                               then @dbname
182                           end
183                       raiserror 18889, @entity_arg
184                   end
185                   raiserror 19260, @monprocname
186                   return (1)
187               end
188   
189               -- Check if some of the common utility sprocs are available, and bail if
190               -- they are not. The sub-procs assume that these verification sprocs exist,
191               -- so check first and bail if they don't.
192               --
193               select @monprocname = "sybsystemprocs.dbo.sp_monitor_verify_setup"
194               if (not exists (select 1 from sybsystemprocs.dbo.sysobjects
195                           where sysstat & 7 = 4
196                               and id = object_id(@monprocname)))
197               begin
198                   raiserror 18826, @monprocname
199                   goto missing_proc
200               end
201   
202               select @monprocname = "sybsystemprocs.dbo.sp_monitor_verify_cfgval"
203               if (not exists (select 1 from sybsystemprocs.dbo.sysobjects
204                           where sysstat & 7 = 4
205                               and id = object_id(@monprocname)))
206               begin
207                   raiserror 18826, @monprocname
208                   goto missing_proc
209               end
210   
211               -- See if the monitoring-specific sub-proc is available, and setup a 
212               -- variable to call it.
213               --
214               select @monprocname = "sybsystemprocs.dbo.sp_monitor_"
215   
216               select @monprocname = @monprocname + case @u_entity
217                       when NULL then 'server'
218                       else @l_entity
219                   end
220   
221               if (not exists (select 1 from sybsystemprocs.dbo.sysobjects
222                           where sysstat & 7 = 4
223                               and id = object_id(@monprocname)))
224               begin
225                   raiserror 18826, @monprocname
226                   goto missing_proc
227               end
228   
229               if @u_entity = "HELP"
230               begin
231                   -- Note that @dbname is overloaded to provide detailed 
232                   -- help on the parameter passed along with help.
233                   -- User can say: sp_monitor help, "all" 
234                   -- to get detailed help information on all supported monitoring types.
235                   -- In that caes pass @listall as 2.
236                   --
237                   select @listall = case
238                           WHEN @u_dbname IS NULL then 1
239                           WHEN lower(@u_dbname) = "all" then 2
240                           else 0
241                       end
242                   exec @rtnstatus = @monprocname @u_dbname, @listall
243                   return @rtnstatus
244               end
245   
246               -- By default monitor the server
247               if (@u_entity is NULL)
248               begin
249                   exec @rtnstatus = @monprocname
250                   return @rtnstatus
251               end
252   
253               /*
254               ** From here on, we go into the land of monitoring individual entities via
255               ** MDA tables. This system needs a control table that might not exist from
256               ** various calling sequences. Ensure that it is created first before doing
257               ** any further work.
258               */
259               select @crt_procname = "sybsystemprocs.dbo.sp_monitor_crt_mon_config"
260               exec @rtnstatus = @crt_procname
261               if (@rtnstatus != 0)
262                   return @rtnstatus
263   
264               if (@u_entity = "ENABLE")
265               begin
266                   -- Using lower-case monitoring type names...
267                   exec @rtnstatus = @monprocname @l_dbname
268               end
269   
270               else if (@u_entity = "DISABLE")
271               begin
272                   -- Using lower-case monitoring type names...
273                   exec @rtnstatus = @monprocname @l_dbname
274               end
275   
276               else if @u_entity = "PROCEDURE"
277               begin
278                   exec @rtnstatus = @monprocname @dbname, @OrderBy_OR_Procname, @option
279               end
280   
281               else if @u_entity = "EVENT"
282               begin
283                   select @spid = case WHEN (@u_dbname is not NULL)
284                           THEN convert(int, @u_dbname)
285                           ELSE 0
286                       end
287                   exec @rtnstatus = @monprocname @spid
288               end
289   
290               else if @u_entity = "CONNECTION"
291               begin
292                   /*
293                   ** By default order the output for monitoring
294                   ** connections in the decreasing order of elapsed time
295                   */
296                   if (@u_dbname is NULL)
297                   begin
298                       select @u_dbname = "ELAPSED TIME"
299                   end
300   
301                   exec @rtnstatus = @monprocname @u_dbname, @OrderBy_OR_Procname
302               end
303   
304               else if @u_entity = "STATEMENT"
305               begin
306                   /* By default order by elapsed time. */
307                   if (@u_dbname is NULL)
308                   begin
309                       select @u_dbname = "ELAPSED TIME"
310                   end
311   
312                   exec @rtnstatus = @monprocname @u_dbname
313               end
314   
315               else if @u_entity = "DEADLOCK"
316               begin
317                   -- Call this directly from the current db, w/o prefacing the dbname,
318                   -- so that if the user issues this from 'master', we can correctly
319                   -- use master..monDeadLock w/o any further parsing fuss.
320                   --
321                   select @monprocname = "sp_monitor_deadlock"
322                   exec @rtnstatus = @monprocname
323                       @dbname
324                       , @OrderBy_OR_Procname
325                       , @option
326               end
327   
328               else if @u_entity = "PROCSTACK"
329               begin
330                   -- If no spid is provided, generate current task's procedure stack
331                   if (@dbname IS NULL)
332                       select @spid = @@spid
333   
334                   else if (patindex("%[^0-9]%", @dbname) = 0)
335                   begin
336                       select @spid = convert(int, @dbname)
337                   end
338                   else
339                   begin
340                       select @monprocname = "<spid> = '" + @dbname + "'"
341                       raiserror 19060, '"sp_monitor procstack"', @monprocname
342                       return 1
343                   end
344   
345                   -- Validate this arg, as an int, and pass it as the contet block
346                   -- to sub-proc. (These many lines of context will be generated when
347                   -- calling sp_showtext underneath here._
348                   --
349                   if (@OrderBy_OR_Procname IS NOT NULL)
350                   begin
351                       if (patindex("%[^0-9]%", @OrderBy_OR_Procname) = 0)
352                       begin
353                           select @context = convert(int, @OrderBy_OR_Procname)
354                       end
355                       else
356                       begin
357                           select @monprocname = "<contextblock> = '"
358                               + @OrderBy_OR_Procname + "'"
359                           raiserror 19060, '"sp_monitor procstack"', @monprocname
360                           return 1
361                       end
362                   end
363   
364                   -- Produce the procedural/stack trace for this spid.
365                   exec @rtnstatus = @monprocname @spid, @context, @option
366               end
367   
368               else if @u_entity = "ARCHIVE"
369               begin
370                   -- Call the archival sproc for given monitoring type and archive.
371                   select @monprocname = "dbo.sp_monitor_archive"
372                   exec @rtnstatus = @monprocname @dbname, @entity_arg
373               end
374   
375               else if @u_entity = "REPORT"
376               begin
377                   -- Call the reporting sproc for given monitoring type and report.
378                   select @monprocname = "dbo.sp_monitor_report"
379                   exec @rtnstatus = @monprocname @dbname, @entity_arg
380                       , @OrderBy_OR_Procname, @option
381               end
382   
383               else if @u_entity = "LIST"
384               begin
385                   exec @rtnstatus = @monprocname
386               end
387   
388               else if @u_entity = "TRACE"
389               begin
390                   exec @rtnstatus = @monprocname @dbname
391               end
392   
393               -- Return whatever return code we found from callee.
394               return (@rtnstatus)
395   
396   missing_proc:
397               raiserror 19122, "MDA", "installmontables", "(mon_role)"
398               return (1)
399           end -- }
400   


Grant Execute on sp_monitor to mon_role
go
DEFECTS
 MBPA 6 Not a parameter of this proc sybsystemprocs..sp_monitor_verify_cfgval: parameter # 3 278
 MBPA 6 Not a parameter of this proc sybsystemprocs..sp_monitor_verify_setup: parameter # 3 278
 MBPA 6 Not a parameter of this proc sybsystemprocs..sp_monitor_verify_cfgval: parameter # 3 325
 MBPA 6 Not a parameter of this proc sybsystemprocs..sp_monitor_verify_setup: parameter # 3 325
 MBPA 6 Not a parameter of this proc sybsystemprocs..sp_monitor_verify_cfgval: parameter # 3 365
 MBPA 6 Not a parameter of this proc sybsystemprocs..sp_monitor_verify_setup: parameter # 3 365
 MBPA 6 Not a parameter of this proc sybsystemprocs..sp_monitor_archive: parameter # 4 380
 MBPA 6 Not a parameter of this proc sybsystemprocs..sp_monitor_deadlock: parameter # 4 380
 MBPA 6 Not a parameter of this proc sybsystemprocs..sp_monitor_verify_cfgval: parameter # 3 380
 MBPA 6 Not a parameter of this proc sybsystemprocs..sp_monitor_verify_cfgval: parameter # 4 380
 MBPA 6 Not a parameter of this proc sybsystemprocs..sp_monitor_verify_setup: parameter # 3 380
 MBPA 6 Not a parameter of this proc sybsystemprocs..sp_monitor_verify_setup: parameter # 4 380
 MEST 4 Empty String will be replaced by Single Space 144
 MEST 4 Empty String will be replaced by Single Space 151
 MTYP 4 Assignment type mismatch @montype: varchar(10) = varchar(30) 242
 MTYP 4 Assignment type mismatch @montype: varchar(10) = varchar(30) 267
 MTYP 4 Assignment type mismatch @montype: varchar(10) = varchar(30) 273
 MTYP 4 Assignment type mismatch @montype: varchar(10) = varchar(30) 278
 MTYP 4 Assignment type mismatch null = varchar(30) 278
 MTYP 4 Assignment type mismatch @montype: varchar(10) = int 287
 MTYP 4 Assignment type mismatch @montype: varchar(30) = int 287
 MTYP 4 Assignment type mismatch @montype: varchar(10) = varchar(30) 301
 MTYP 4 Assignment type mismatch @montype: varchar(10) = varchar(30) 312
 MTYP 4 Assignment type mismatch @montype: varchar(10) = varchar(30) 323
 MTYP 4 Assignment type mismatch null = varchar(30) 325
 MTYP 4 Assignment type mismatch @arg1: varchar(30) = int 365
 MTYP 4 Assignment type mismatch @arg2: varchar(30) = int 365
 MTYP 4 Assignment type mismatch @montype: varchar(10) = int 365
 MTYP 4 Assignment type mismatch @montype: varchar(30) = int 365
 MTYP 4 Assignment type mismatch null = varchar(30) 365
 MTYP 4 Assignment type mismatch @montype: varchar(10) = varchar(30) 372
 MTYP 4 Assignment type mismatch @montype: varchar(10) = varchar(30) 379
 MTYP 4 Assignment type mismatch null = varchar(30) 380
 MTYP 4 Assignment type mismatch @montype: varchar(10) = varchar(30) 390
 MAW1 3 Warning message on %name% sybsystemprocs..sysobjects.id: Warning message on sysobjects 196
 MAW1 3 Warning message on %name% sybsystemprocs..sysobjects.id: Warning message on sysobjects 205
 MAW1 3 Warning message on %name% sybsystemprocs..sysobjects.id: Warning message on sysobjects 223
 MGTP 3 Grant to public sybsystemprocs..sysobjects  
 MUCO 3 Useless Code Useless Begin-End Pair 21
 MUCO 3 Useless Code Useless Brackets 46
 MUCO 3 Useless Code Useless Brackets 68
 MUCO 3 Useless Code Useless Brackets 90
 MUCO 3 Useless Code Useless Brackets 111
 MUCO 3 Useless Code Useless Brackets 138
 MUCO 3 Useless Code Useless Brackets 175
 MUCO 3 Useless Code Useless Brackets 186
 MUCO 3 Useless Code Useless Brackets 194
 MUCO 3 Useless Code Useless Brackets 203
 MUCO 3 Useless Code Useless Brackets 221
 MUCO 3 Useless Code Useless Brackets 247
 MUCO 3 Useless Code Useless Brackets 261
 MUCO 3 Useless Code Useless Brackets 264
 MUCO 3 Useless Code Useless Brackets 270
 MUCO 3 Useless Code Useless Brackets 283
 MUCO 3 Useless Code Useless Brackets 296
 MUCO 3 Useless Code Useless Brackets 307
 MUCO 3 Useless Code Useless Brackets 331
 MUCO 3 Useless Code Useless Brackets 334
 MUCO 3 Useless Code Useless Brackets 349
 MUCO 3 Useless Code Useless Brackets 351
 MUCO 3 Useless Code Useless Brackets 394
 MUCO 3 Useless Code Useless Brackets 398
 MZMB 3 Zombie: use of non-existent object sybsystemprocs.dbo.sp_monitor_ 0
 MZMB 3 Zombie: use of non-existent object sybsystemprocs.dbo.sp_monitor_archive 0
 MZMB 3 Zombie: use of non-existent object sybsystemprocs.dbo.sp_monitor_crt_mon_config 0
 MZMB 3 Zombie: use of non-existent object sybsystemprocs.dbo.sp_monitor_report 0
 MZMB 3 Zombie: use of non-existent object sybsystemprocs.dbo.sp_monitor_verify_cfgval 0
 MZMB 3 Zombie: use of non-existent object sybsystemprocs.dbo.sp_monitor_verify_setup 0
 QISO 3 Set isolation level 53
 MDYE 2 Dynamic Exec Marker exec @rtnstatus 242
 MDYE 2 Dynamic Exec Marker exec @rtnstatus 249
 MDYE 2 Dynamic Exec Marker exec @rtnstatus 260
 MDYE 2 Dynamic Exec Marker exec @rtnstatus 267
 MDYE 2 Dynamic Exec Marker exec @rtnstatus 273
 MDYE 2 Dynamic Exec Marker exec @rtnstatus 278
 MDYE 2 Dynamic Exec Marker exec @rtnstatus 287
 MDYE 2 Dynamic Exec Marker exec @rtnstatus 301
 MDYE 2 Dynamic Exec Marker exec @rtnstatus 312
 MDYE 2 Dynamic Exec Marker exec @rtnstatus 322
 MDYE 2 Dynamic Exec Marker exec @rtnstatus 365
 MDYE 2 Dynamic Exec Marker exec @rtnstatus 372
 MDYE 2 Dynamic Exec Marker exec @rtnstatus 379
 MDYE 2 Dynamic Exec Marker exec @rtnstatus 385
 MDYE 2 Dynamic Exec Marker exec @rtnstatus 390
 MSUB 2 Subquery Marker 194
 MSUB 2 Subquery Marker 203
 MSUB 2 Subquery Marker 221
 MTR1 2 Metrics: Comments Ratio Comments: 35% 15
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 44 = 49dec - 7exi + 2 15
 MTR3 2 Metrics: Query Complexity Complexity: 165 15

DATA PROPAGATION detailed
ColumnWritten To
@OrderBy_OR_Procnamesp_exec_SQL_rset_001.sqlbNoName57
@dbnamesp_exec_SQL_rset_001.sqlbNoName57
@entitysp_exec_SQL_rset_001.sqlbNoName57

DEPENDENCIES
PROCS AND TABLES USED
calls proc sybsystemprocs..sp_monitor_deadlock  
   calls proc sybsystemprocs..sp_monitor_parse_archive_cmd  
      calls proc sybsystemprocs..sp_split_string  
      calls proc sybsystemprocs..sp_spaceusage_processusing  
         calls proc sybsystemprocs..sp_split_string  
   calls proc sybsystemprocs..sp_monitor_verify_cfgval  
      calls proc sybsystemprocs..sp_monitor_getcfgval  
         reads table master..syscurconfigs (1)  
         reads table master..sysconfigures (1)  
   calls proc sybsystemprocs..sp_exec_SQL  
      writes table sybsystemprocs..sp_exec_SQL_rset_001 
   calls proc sybsystemprocs..sp_monitor_archive  
      calls proc sybsystemprocs..sp_monitor_verify_cfgval  
      reads table master..sysdatabases (1)  
      calls proc sybsystemprocs..sp_monitor_parse_archive_cmd  
      calls proc sybsystemprocs..sp_monitor_trace_level  
      calls proc sybsystemprocs..sp_monitor_verify_setup  
         reads table master..sysobjects (1)  
         calls proc sybsystemprocs..sp_monitor_getcfgnum  
            reads table master..sysconfigures (1)  
         calls proc sybsystemprocs..sp_monitor_getcfgval  
      calls proc sybsystemprocs..sp_getmessage  
         reads table master..syslanguages (1)  
         calls proc sybsystemprocs..sp_validlang  
            reads table master..syslanguages (1)  
         reads table master..sysmessages (1)  
         reads table sybsystemprocs..sysusermessages  
   calls proc sybsystemprocs..sp_monitor_verify_setup  
   calls proc sybsystemprocs..sp_mon_archive_genSQL  
      calls proc sybsystemprocs..sp_mon_gen_columnlist  
         reads table master..syscolumns (1)  
         reads table master..sysobjects (1)  
      calls proc sybsystemprocs..sp_versioncrack  
         calls proc sybsystemprocs..sp_split_string  
   calls proc sybsystemprocs..sp_monitor_deadlock_getopts  
      writes table sybsystemprocs..sp_monitor_deadlock_getopts_rset_001 
      calls proc sybsystemprocs..sp_getopts  
   calls proc sybsystemprocs..sp_monitor_deadlock_driver  
      calls proc sybsystemprocs..sp_monitor_deadlock_verbose  
      reads table tempdb..#mon__deadlock_info (1) 
   calls proc sybsystemprocs..sp_monitor_trace_level  
   calls proc sybsystemprocs..sp_monitor_deadlock_count_by  
      calls proc sybsystemprocs..sp_exec_SQL  
      calls proc sybsystemprocs..sp_autoformat  
         writes table sybsystemprocs..sp_autoformat_rset_003 
         read_writes table tempdb..#colinfo_af (1) 
         reads table tempdb..syscolumns (1)  
         writes table sybsystemprocs..sp_autoformat_rset_001 
         reads table tempdb..systypes (1)  
         writes table sybsystemprocs..sp_autoformat_rset_005 
         reads table master..systypes (1)  
         calls proc sybsystemprocs..sp_namecrack  
         writes table sybsystemprocs..sp_autoformat_rset_004 
         calls proc sybsystemprocs..sp_autoformat  
         reads table master..syscolumns (1)  
         writes table sybsystemprocs..sp_autoformat_rset_002 
      writes table tempdb..#freq_by_applname (1) 
      writes table tempdb..#freq_by_date_name (1) 
      writes table tempdb..#freq_by_resolvedate (1) 
      writes table tempdb..#freq_by_name (1) 
      calls proc sybsystemprocs..sp_getmessage  
      reads table master..sysobjects (1)  
   calls proc sybsystemprocs..sp_monitor_deadlock_usage  
      calls proc sybsystemprocs..sp_getmessage  
   writes table tempdb..#mon__deadlock_info (1) 
   reads table master..monDeadLock (1)  
reads table sybsystemprocs..sysobjects