Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • How to Use DBMS_STATS to Move Statistics to a Different Database Oracle
  • Oracle GoldenGate lag monitoring shell script Linux/Unix
  • Sending email with file attachment. Linux/Unix
  • V$CONTROLFILE_RECORD_SECTION reference notes. Oracle
  • ORA-01220 Oracle
  • How to change hostname in Linux Linux/Unix
  • plan10g.sql good1 Oracle
  • tab.sql Oracle
  • Giving Grant on v$DATABASE Oracle
  • How does one SELECT a value from a table into a Unix variable? From SQL to Shell Linux/Unix
  • Multiple listeners Oracle
  • .profile Linux/Unix
  • CPU speed on Linux Linux/Unix
  • Find nth max and min. Oracle
  • Good Site for Oracle Internals 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

  • avail.sh ( find filesystem spae usage) Linux/Unix
  • Find long Running Transaction Linux/Unix
  • Generate SSH without password authentication. Linux/Unix
  • cif crons Linux/Unix
  • crontab syntax Linux/Unix
  • Small sample shell program 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 (388)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (337)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • 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
  • Reading config file from other folder inside class24-Sep-2024
  • Python class import from different folders22-Sep-2024
  • Transfer SQL Profiles from One database to other database.05-Sep-2024
  • Load testing on Oracle 19C RAC with HammerDB18-Jan-2024

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Good Link from metalink 1 Oracle
  • Proc code Oracle
  • Changing unix system clock when Oracle database is running. Oracle
  • AWR license Oracle
  • Set Role explaination. Oracle
  • newupload.html PHP/MYSQL/Wordpress
  • Search and replace pattern Linux/Unix
  • Pending Transaction Neighbors Script Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme