Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • AWR settings- MMON is not taking snapshot. Oracle
  • move_arch_files.ksh /* Good One */ Linux/Unix
  • To see only files and/or folders using LS command Linux/Unix
  • On solaris 10, “S” link is not part of $ORACLE_HOME/bin/oracle as default. ( For 9.2.0.8) Oracle
  • segment_wise_space.sql segspace.sql Segment wise space usage (allocated and used) Oracle
  • Guide to Linux System Command Mastery Linux/Unix
  • remove archfiles only when it is applied to DR rm_archfiles.sh Linux/Unix
  • How To Transfer Passwords Between Databases (ref note: 199582.1) Oracle
  • get_vmstat.ksh Linux/Unix
  • Good Doc 28-JUN-2006 Oracle
  • column level grant syntax Oracle
  • ENQ: KO – FAST OBJECT CHECKPOINT tips Oracle
  • pvm_rbs1.sql (to collect rbs info from db) Oracle
  • sess1.sql Oracle
  • Directory wise folder wise space usage 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

  • How does one SELECT a value from a table into a Unix variable? From SQL to Shell Linux/Unix
  • on IBM-AIX for display Linux/Unix
  • catall.sh Linux/Unix
  • remove archfiles only when it is applied to DR rm_archfiles.sh Linux/Unix
  • ipcs -l Linux/Unix
  • How to collect CPU usage on Linux using Shell script 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
  • Generate SSH without password authentication. Linux/Unix
  • sesswait.sql Oracle
  • pvm_rbs1.sql (to collect rbs info from db) Oracle
  • Oracle Material from OTN Oracle
  • sid_wise_cursor.sql find open cursor basis on username or SID Oracle
  • Find nth max and min. Oracle
  • create user with unlimited quota Oracle
  • checking connectivity between two servers Linux/Unix

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme