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

Comments:

HI Pankaj I have deleted the trace files which were updating every archie generation in primay. For more info In my environment we have a physical standby database using dataguard. I hve enabled log_archie_trace =127. this was updating in archiver .trc and became 3.9Gig. so I deleted it will there be any problem? I have switched logfile nd checke the alert logfile also I didn't find anything. I am planning to change the trace level to 15 which only keeps the record of archive files. regards Nag

Posted by nagaraj on January 05, 2010 at 11:22 PM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

This blog is authored by Pankaj Chandiramani , Product Manager for Enterprise Manager at Oracle . Main Focus of the blog will be on Enterprise Manager 12c with deep coverage of Database Center Automation including DbaaS , Database Provisioning , Database Patching , Config , Compliance etc .

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today