« May 8, 2007 | Main | May 15, 2007 »

May 10, 2007 Archives

May 10, 2007

Cleaning up logs & trace files

Old logs , trace files etc can take up huge space & fill the disks very quickly , so we need to clean them up on periodic basis ........and sometimes a need comes where we need to clean up sapce instantly , then we need to identify the logs before a particular date , we have some simple commands & script to clean up old logs & trace files :

Simple command
/usr/bin/find /u01/app/oracle/product/crs/log/test040/client/css*.log -mtime +31 -exec rm {} ;

Above will delete old CRS logs which are more that 31 days old

# Cleanup trace and dump files over 14 days old
for ORACLE_SID in `cat /etc/oratab|egrep ':N|:Y'|grep -v *|cut -f1 -d':'`
do
   ORACLE_HOME=`cat /etc/oratab|grep ^$ORACLE_SID:|cut -d":" -f2`
   DBA=`echo $ORACLE_HOME | sed -e 's:/product/.*::g'`/admin
   /usr/bin/find $DBA/$ORACLE_SID/bdump -name *.trc -mtime +14 -exec rm {} ;

Source : internet

About May 2007

This page contains all entries posted to Pankaj Chandiramani's Blog in May 2007. They are listed from oldest to newest.

May 8, 2007 is the previous archive.

May 15, 2007 is the next archive.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type and Oracle