Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Need script to copy and then truncate/tail alert log

RE: Need script to copy and then truncate/tail alert log

From: Marina Leonardo, Jose Luis <JLMarina_at_Uni2.es>
Date: Wed, 26 Jul 2000 17:14:11 +0200
Message-Id: <10570.113018@fatcity.com>


Hi Cherie:

This is what we do once a week (oracle´s crontab):

#!/bin/ksh
############################################################################
####

# Renombra el alert de oracle
# 2000-04-17 JLM
# Lanzar con usuario con acceso a "internal"
############################################################################
####
BD=$1; export BD
if [ -z "${BD}" ]
then

   echo "ren_alert.sh Oracle_SID "
   exit 1
fi

############################################################################
####
export NLS_LANG=american_spain.WE8ISO8859P1 export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/ucblib

export ORACLE_HOME=/opt/oracle/product/8.1.6 export ORACLE_SID=$BD
PATH=/usr/bin:/usr/sbin:/usr/ucb:/etc:/opt/bin:.:$ORACLE_HOME/bin; export PATH

sqlplus -s internal/ << FIN
set echo off
set pagesize 0
set head off
set verify off
set feedback off
set serveroutput off
spool /u00/app/oracle/admin/${BD}/scripts/renALERT.sh PROMPT #!/bin/ksh
PROMPT

#######################################################################
PROMPT # Renombra el alert de oracle
PROMPT # Script generado automaticamente PROMPT
#######################################################################
select 'cd /u00/app/oracle/admin/${BD}/bdump' from dual;
select 'mv alert_' || substr(global_name,1,4) || '.log ' || ' ' || 'alert_' || substr(global_name,1,4) || to_char(sysdate, 'yyyymmdd') || '.log'
from global_name
/
spool off
-- Lanzamiento del renombrado
Host . /u00/app/oracle/admin/${BD}/scripts/renALERT.sh
--
Alter system switch logfile
/
FIN
exit 0


> -----Mensaje original-----
> De:	Cherie_Machler_at_gelco.com [SMTP:Cherie_Machler_at_gelco.com]
> Enviado el:	miércoles 26 de julio de 2000 17:41
> Para:	Multiple recipients of list ORACLE-L
> Asunto:	Need script to copy and then truncate/tail alert log
> 
> Does anyone have a script that will copy over and then truncate or tail (I
> can't
> remember if it's tail)
> the alert log?  Or something appropriate to keep our alert log to a day's
> worth
> of log information while
> keeping the file in the same directory (hopefully with a datestamp in the
> old
> log file name).  Then we
> want to clean out the old log files on a weekly or daily basis.
> 
> Thanks in advance for any help.
> 
> Cherie
> 
> 
> -- 
> Author: 
>   INET: Cherie_Machler_at_gelco.com
> 
> Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
> San Diego, California        -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from).  You may
Received on Wed Jul 26 2000 - 10:14:11 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US