« Installing TimesTen | Main | Simulating ASM Disks »

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

TrackBack

TrackBack URL for this entry:
http://blogs.oracle.com/mte1521/mt-tb.cgi/2256

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About This Entry

This page contains a single entry from the blog posted on May 10, 2007 10:44 AM.

The previous post in this blog was Installing TimesTen.

The next post in this blog is Simulating ASM Disks.

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

Top Tags

Powered by
Movable Type and Oracle