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