Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • create trigger syntax Oracle
  • Reading config file from other folder inside class Python/PySpark
  • Drop specific SQL plan baseline – spm Oracle
  • Find Plan Hash value fphv.sql Oracle
  • Guide to Linux System Command Mastery Linux/Unix
  • Goldengate Tutorial Oracle
  • 276434.1 Modifying the VIP or VIP Hostname of a 10g or 11g Oracle Clusterware Node Oracle
  • shr1.sql for MTS or Shared server configuration Oracle
  • Is It Recommended To Apply Patch Bundles When PSU Is Available? -ID 743554.1 Oracle
  • crtgr.sql /* For creating trigger from data dictionary */ Oracle
  • create a folder in multiple places Linux/Unix
  • Distributed Transaction Troubleshooting. Oracle
  • send email from unix mailx with attachment. Linux/Unix
  • secure crt settings Linux/Unix
  • Jai Shree Ram 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

  • adding new line after specific pattern using sed Linux/Unix
  • process id based files and processes Linux/Unix
  • move_arch_files.ksh Linux/Unix
  • Search and Replace vi editor command. Linux/Unix
  • scp with ssh2 Linux/Unix
  • purge_trc.sh 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
  • Good Doc 28-JUN-2006 Oracle
  • dbinv.sql Oracle
  • Flowers Resize datafiles Oracle
  • pvmehta.com SQL scripts
    Find which sessions is accessing object that prevent your session to have exclusive locks in Oracle Oracle
  • Nice notes on wait events Oracle
  • Vivek Tuning for Row Locks. Oracle
  • The most important Tuning Notes Oracle
  • Disbaling DBA_SCHEDULER_JOBS Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme