# DDCrun.def: Oracle Database Diagnostics Collector (Status Check) # $Id: DDCstat.def,v 1.4 2008/02/25 13:05:53 mschenke Exp $ # ARCS: $Header: /home/cvs/repository/RDA_4/src/scripting/lib/modules/DDCstat.def,v 1.4 2008/02/25 13:05:53 mschenke Exp $ # # Change History # 20080225 MSC Change the documentation. =head1 NAME DDCrun - Oracle Database Diagnostics Collector (Status Check) =head1 DESCRIPTION This module checks whether Oracle Database Diagnostics Collector (ORADDC) is waiting still for a wake-up by checking the last modification of its timestamp file. When the time since the last modification exceeds the specified tolerance (30 seconds by default), it removes the file and exits with a non zero status. =cut echo tput('bold'),'Checking if ORADDC is still active ...',tput('off'),"\012" # Initialisation var ($max,$flg) = @arg import $ORACLE_SID,$RPT_DIRECTORY,$RPT_GROUP var $max = nvl($max,30) var $sid = field(':',-1,$ORACLE_SID) var $fil = catFile($RPT_DIRECTORY,\ concat($RPT_GROUP,'_TMP_ddcst_',$sid,'.tmp')) # Determine ORADDC stattus if !testFile('f',$fil) {echo 'No timestamp file found (',$fil,')' echo 'Possible that ORADDC is not running or not in a wait state' call purge('O',concat('TMP_ddcup_',quote($sid),'\.tmp$'),-1,0) call setSetting('RDA_EXIT', 2) } elsif isOlder($fil,0,$max) {echo 'Tolerance exceeded' echo 'Timestamp file removed' call purge('O',concat('TMP_ddc(st|up)_',quote($sid),'\.tmp$'),-1,0) call setSetting('RDA_EXIT', 1) } else {echo 'ORADDC active' # Ask ORADDC to report pending requests if $flg {var $nam = concat('ddcrq_',$sid) var $tmp = createTemp($nam,'.tmp') call closeTemp($nam) sleep 6 loop $lin (grepFile($tmp,'\w')) echo $lin call unlinkTemp($nam) } } =head1 SEE ALSO See also L, L. =over 10 =begin credits =item RDA 4.11: Clive Bostock. =back =end credits =head1 COPYRIGHT NOTICE Copyright (c) 2002-2008, Oracle. All rights reserved. =head1 TRADEMARK NOTICE Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. =cut