The AskTOM team is taking a break over the holiday season, so we're not taking questions or responding to comments. Please have a happy and safe festive season and as always, thanks for being a member of the AskTOM community.
Thanks for the question.
Asked: February 23, 2017 - 8:12 pm UTC
Last updated: February 24, 2017 - 7:57 am UTC
Version: 11g
Viewed 1000+ times
tmpfile=/tmp/myjob.$$ print " connect / as sysdba set pages 0 set lines 200 set feedback off set trimspool on set serverout on select '@COUNT '||count(*) x from all_tables exit" | sqlplus -s /nolog 1>$tmpfile 2>&1 errs=`egrep '(SP2|ORA-)' $tmpfile` if [ "$errs" ] ; then cat $tmpfile | mailx -s "ERROR: SOMETHING FAILED $bkptime" ops@business.com exit fi obj_count=`egrep '^@COUNT' $tmpfile | awk '{print $2}'`
Share and learn SQL and PL/SQL; free access to the latest version of Oracle Database!
Classes, workouts and quizzes on Oracle Database technologies. Expertise through exercise!