Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • sesswait.sql Oracle
  • Find Multiple levels of object dependencies : depen.sql Oracle
  • When to rebuld B-tree index Oracle
  • myfile Oracle
  • scripts to take listener.log backup Linux/Unix
  • Adding or Dropping Online Redo Log Files When Physical Standby in place Oracle
  • USE_NL and INDEX hints example Oracle
  • For Search and replace unix command. Linux/Unix
  • adding new line after specific pattern using sed Linux/Unix
  • Committing distributed transaction using commit force Oracle
  • fdisk -l explaination about Primary-Logical-Extended Partitions Linux/Unix
  • lck.sql Oracle
  • handling filenname with space Linux/Unix
  • chk_space_SID.ksh Linux/Unix
  • OPENING A STANDBY DATABASE IN READ-ONLY MODE 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

  • Running some SQL on multiple databases connecting using monitoring userid and password Linux/Unix
  • tuning commmand for cpu, ip and memory stats Linux/Unix
  • ipcs -l Linux/Unix
  • Single character replacement in Unix Linux/Unix
  • Jai Shree Ram Linux/Unix
  • kill all processes from specific user in solaris. Linux/Unix

Leave a Reply Cancel reply

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

Categories

  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • Oracle (392)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (341)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • load SPM baseline from cursor cache05-Jun-2025
  • Drop all SPM baselines for SQL handle05-Jun-2025
  • Load SPM baseline from AWR05-Jun-2025
  • Drop specific SQL plan baseline – spm05-Jun-2025
  • findinfo.sql (SQL for getting CPU and Active session info)27-May-2025
  • SQL Tracker by SID sqltrackerbysid.sql22-Apr-2025
  • How to connect to Oracle Database with Wallet with Python.21-Mar-2025
  • JSON/XML Types in Oracle18-Mar-2025
  • CPU Core related projections12-Mar-2025
  • Exadata Basics10-Dec-2024

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • switchover for primary database Oracle
  • Sample WW22 listener.ora Oracle
  • Running some SQL on multiple databases connecting using monitoring userid and password Linux/Unix
  • How to hide author name in WordPress BLOG PHP/MYSQL/Wordpress
  • tar and untar a dolder with all its subfolder. Linux/Unix
  • Passing from Unix to PLSQL using bind variables Linux/Unix
  • EXTPROC Oracle
  • Configure ssh authentications for RAC Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme