# DDCstat.ctl: Oracle Database Diagnostics Collector (Status Check) # $Id: DDCstat.ctl,v 1.4 2013/10/30 07:18:24 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/DB/DDCstat.ctl,v 1.4 2013/10/30 07:18:24 RDA Exp $ # # Change History # 20130802 MSC Improve SID determination. =head1 NAME DB:DDCstat - 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 time-stamp file. When the time since the last modification exceeds the specified tolerance (30 seconds by default), it removes the file and exits with a nonzero status. =cut echo tput('bold'),'Checking if ORADDC is still active ...',tput('off'),"\012" # Initialization var ($max,$flg) = @arg import $ORACLE_SID call setAbbr('DB_TMP_') var $max = nvl($max,30) var $sid = replace(concat('_',$ORACLE_SID),'[\_\W]+','_',true) var $fil = catFile(${OUT.E},concat(${CUR.W_PREFIX},'ddcst',$sid,'.tmp')) # Determine ORADDC stattus if !?testFile('f',$fil) {echo 'No time-stamp file found (',$fil,')' echo 'Possible that ORADDC is not running or not in a wait state' call purge('E',concat('ddcup',$sid,'\.tmp$'),-1,0) #call setSetting('RDA_EXIT', 2) } elsif isOlder($fil,0,$max) {echo 'Tolerance exceeded' echo 'Timestamp file removed' call purge('E',concat('ddc(st|up)',verbatim($sid),'\.tmp$'),-1,0) #call setSetting('RDA_EXIT', 1) } else {echo 'ORADDC active' # Ask ORADDC to report pending requests if $flg {var $tmp = $[OUT]->add_report('E',concat('ddcrq',$sid,'_',getPid()),0,'.tmp') call $tmp->create call $tmp->close sleep 6 loop $lin (grepFile($tmp->get_file(true),'\w')) echo $lin call $tmp->unlink } } =head1 SEE ALSO L, L =begin credits =over 10 =item RDA 4.11: Clive Bostock. =back =end credits =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