Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Oracle 10g Wait Model Oracle
  • True Session Wait Activity in Oracle 10g Verygood Oracle
  • create a folder in multiple places Linux/Unix
  • To find explain plan for a statement that occurred in past. Oracle
  • Example of How To Resize the Online Redo Logfiles Note:1035935.6 Oracle
  • OEM-Commnds Oracle
  • RAC with RHEL4 and 11g Oracle
  • Recovering lost SYS password Oracle
  • find_du.ksh to find # of files, their sizes in current folder and its subdolder Linux/Unix
  • restarting network in linux Linux/Unix
  • Implementing Listener Security Oracle
  • telnet listening Linux/Unix
  • secure crt settings Linux/Unix
  • 272332.1 CRS 10g Diagnostic Collection Guide Oracle
  • rm_backup_arch_file.ksh Linux/Unix

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

  • More info about /proc folder and its relation with processes. Linux/Unix
  • Passing from Unix to PLSQL using bind variables Linux/Unix
  • Some useful Unix Commands Linux/Unix
  • Linux CPU info. Linux/Unix
  • How to sort list of files on basis of their sizes. Linux/Unix
  • Follwoing korn shell is used to move files from source folder to destination folder and gzip it in destination folder. mv_iotto.ksh 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
  • Oracle 10g Wait Model Oracle
  • create a folder in multiple places Linux/Unix
  • fuser to check who is using diretory Linux/Unix
  • SYSOPER Mystery Oracle
  • 272332.1 CRS 10g Diagnostic Collection Guide Oracle
  • findx.sql /* Find Indexes on specified USER.TABLE_NAME */ Oracle
  • fdisk -l explaination about Primary-Logical-Extended Partitions Linux/Unix
  • Index Range Scan Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme