#!/bin/ksh data=`date +%a' '%d/%m/%y` ano=`date +%y` mes=`date +%m` dia=`date +%d` cd /u01/oracle8s/trace # #--- Cabecalho --- Cabecalho() { clear echo '=================================================================' echo $data " *** Monitoramento do Banco de Dados - Salvador ***" echo '=================================================================' echo } #--- Inicio --- Cabecalho echo "Erros ORA- no Alert" echo "-----------------------------------------------------------------" if test -a alert_slvcabo.log then pg alert_slvcabo.log | grep ORA- > saida pg -35 saida echo "-----------------------------------------------------------------" echo echo 'Tecle Enter' read pausa Cabecalho echo 'Deseja movimentar o ALERT (s/n)?' '\c' read resp if [ $resp = s -o $resp = S ] then mv alert_slvcabo.log /u01/oracle8s/trace/alrt_hist/alert_slvcabo_$dia$mes$ano.log echo 'Tecle Enter' read pausa fi else echo "Alert nao gerado." echo "-----------------------------------------------------------------" fi # Cabecalho echo 'Monitorando arquivos .TRC' echo "-----------------------------------------------------------------" ls -lart | grep .trc > saida if test -s saida then pg -35 saida | grep ' ' echo "-----------------------------------------------------------------" echo 'Deseja movimentar arquivos .TRC (s/n)?' '\c' read resp if [ $resp = s -o $resp = S ] then mv *.trc /u01/oracle8s/trace/trace_hist fi else echo 'Nao existem arquivos .TRC gerados.' echo "-----------------------------------------------------------------" fi