Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Postgres DB user and OS user. POSTGRESQL
  • Oracle Support Metalink ID 161818.1 Oracle
  • Drop specific SQL plan baseline – spm Oracle
  • Reading config file from other folder inside class Python/PySpark
  • Hello Uncategorized
  • 556976.1 Oracle Clusterware: Components installed Oracle
  • All Hints for Oracle Databases Oracle
  • How does one overcome the Unix 2 Gig file limit? Linux/Unix
  • Checking SQL Server Version SQL Server
  • temp_use.sql diplays usage of temp ts Oracle
  • online_bkup.sql Oracle
  • Space padding in korn shell Linux/Unix
  • fkwoindex.sql /* Find FK without Index */ Oracle
  • fuser to check who is using diretory Linux/Unix
  • Identical Dblink Issue… Oracle

age_alert.ksh aging out alert.log

Posted on 28-Feb-2006 By Admin No Comments on age_alert.ksh aging out alert.log

!/bin/ksh

. /export/home/oracle/envs/oracle_env_PNETP

save_date=`date +%Y%m%d%H%M`

# Set ORATAB variable

if [ -f /etc/oratab ] ; then

ORATAB=/etc/oratab

else

if [ -f /var/opt/oracle/oratab ] ; then

ORATAB=/var/opt/oracle/oratab

else

echo “”

echo “`date` Cannot find oratab!”

echo “”

exit 2

fi

fi

export ORATAB

# search the alert log for errors for all databases

#

for ORACLE_SID in `grep -v “^#” $ORATAB | grep -v “^$” | grep -v “*” | grep -v “BLINK” | grep -v “BLOOM” | grep -v “BLINKTEST” | grep -v “B80

6″ | cut -d: -f1`

do

ALERTLOG=${ORA_BDUMP}/alert_${ORACLE_SID}.log

TEMPLOG=/export/home/oracle/scripts/log/alert_tmp_${ORACLE_SID}.log

# Age the alert log

#

mv ${ALERTLOG} $ORA_BDUMP/alert_$ORACLE_SID.log_$save_date

#

touch ${ALERTLOG}

rm ${TEMPLOG}

touch ${TEMPLOG}

# purge all alert logs older than 2 weeks

#

find $ORA_BDUMP/alert* -mtime +14 -exec rm {} ;

#

done

Linux/Unix, shell

Post navigation

Previous Post: cur_sql.sql
Next Post: Flowers Resize datafiles

Related Posts

  • fdisk -l explaination about Primary-Logical-Extended Partitions Linux/Unix
  • remove archfiles only when it is applied to DR rm_archfiles.sh Linux/Unix
  • Zip and unzip with tar Linux/Unix
  • rm_backup_arch_file.ksh Linux/Unix
  • Sending email with file attachment. Linux/Unix
  • For Search and replace unix command. Linux/Unix

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Django (0)
  • GIT (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (397)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (150)
  • SQL scripts (345)
  • SQL Server (6)
  • Uncategorized (3)
  • Videos (0)

Recent Posts

  • Hello08-Apr-2026
  • Hello07-Apr-2026
  • Test107-Apr-2026
  • track_autoupgrade_copy_progress.sql01-Apr-2026
  • refre.sql for multitenant01-Apr-2026
  • prepfiles.sh for step by step generating pending statistics files10-Mar-2026
  • tracksqltime.sql05-Mar-2026
  • Complete Git Tutorial for Beginners25-Dec-2025
  • Postgres DB user and OS user.25-Dec-2025
  • Trace a SQL session from another session using ORADEBUG30-Sep-2025

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • get_vmstat.ksh for Solaris Oracle
  • Composite Index creation tip from Vivek Oracle
  • Zip and unzip with tar Linux/Unix
  • Remove DOS CR/LFs (^M) Linux/Unix
  • Looping for remote servers and find its database from oratab file. Linux/Unix
  • exp syntax in oracle 10g Oracle
  • Pending Transaction Neighbors Script Oracle
  • Goldengate document from Porus Oracle

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme