# LDoraddc.ctl: Collects Oracle Database Diagnostic Collector Reports # $Id: LDoraddc.ctl,v 1.4 2015/02/20 18:44:54 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/DB/LDoraddc.ctl,v 1.4 2015/02/20 18:44:54 RDA Exp $ # # Change History # 20150220 KRA Improve list management. =head1 NAME DB:LDoraddc - Collects Oracle Database Diagnostic Collector Reports =head1 DESCRIPTION =head2 oraddc - Database Diagnostic Collector This module gets reports generated by Oracle Database Diagnostic Collector (ORADDC) during the last 15 days. =cut # Initialization var @tb_mon = (\ '','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec') var %tb_dmp = ('A','Hang Analyze Dump',\ 'C','Locking Contention Report',\ 'D','Active Session History Dump',\ 'E','Event Histogram',\ 'H','Shared Pool (Heap) Dump',\ 'L','Library Cache Dump',\ 'R','Row Cache Dump',\ 'S','System State Dump',\ 'W','Session Wait Events Report') var %tb_met = ('-','None',\ 'B','Blocking Sessions',\ 'E','Wait Event Sessions',\ 'L','Listener Names',\ 'O','Oracle Process Identifiers',\ 'P','Process Identifiers',\ 'S','Session Identifiers',\ 'U','Session User') var %tb_prc = ('E','Process Error Stack',\ 'F','Process Open Files',\ 'L','Process Dynamic Libraries',\ 'O','Operating System Trace',\ 'P','Process State Dump',\ 'S','Process Stack',\ 'T','10046 Trace') # Set the abbreviation call setAbbr('DB_DDC_') # Collect recent files debug ' Inside LOAD module, gathering ORADDC reports' report oraddc prefix {write '---+ Oracle Database Diagnostic Collector (ORADDC) Results' write 'Limited to ORADDC runs done in last 15 days%BR% ' write '|*Date*|*Run%BR%Options*|*Background%BR%Process*|*Process%BR%Method*|\ *Process%BR%Arguments*|*Process%BR%Reports*|*Reports*|\ *Time%BR%Constants*|' } loop $fil (grepDir(${OUT.E},concat('^',${CUR.W_PREFIX},'t\d{10}_log\.txt$'),\ 'iptm15')) {# Decode the ORADDC options next !grepFile($fil,'ORADDC Options','f') var ($opt,@dmp,@prc) = (field('\|',2,last)) var @opt = split(':',replace($opt,':',':',true)) var ($met,$arg) = split('\/',$opt[2]) var $arg = replace($arg,',',', ',true) if !length($met) var $met = '-' loop $itm (split(',',trim($opt[3]))) {if $itm call push(@prc,nvl($tb_prc{$itm},$itm)) } loop $itm (split(',',trim($opt[4]))) {if $itm call push(@dmp,nvl($tb_dmp{$itm},$itm)) } if isFiltered() var $opt = replace($opt,':',':',true) # Decode the date var ($yea,$mon,$day,$hou,$min) = \ match($fil,'_DDC_t(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)_log\.txt$',true) incr $yea,2000 # Add the log in the report write '|[[../extern/',basename($fil,'.txt'),'.htm][_blank][',\ $day,'-',$tb_mon[$mon],'-',$yea,' ',$hou,':',$min,']]|',\ $opt,' |',replace($opt[1],',','%BR%',true),' |',\ nvl($tb_met{$met},$met),' |',$arg,' |',\ join('%BR%',@prc),' |',join('%BR%',@dmp),' |',$opt[5],' |' } if isCreated(true) toc '2:[[',getFile(),'][rda_report][Database Diagnostic Collector]]' =head1 COPYRIGHT NOTICE Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. =head1 TRADEMARK NOTICE Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. =cut