Commands to Delete Old Aged Oracle Trace Files(.trc, .trm) and Audit(.aud) Files

advertisements

_____________________________________________________________________________________________________________________

The Eucharistic Miracles of the World
In this post I am going to explain the command to delete old trace, Audit files. You have to periodically clean up these trace, audit file locations to avoid the file system get filled with files.

In this below command you have change the trace directory depending on your database background_ dump_ destination location. Also you need to change the -mtime parameter(modified time) value. In below commands I have used 3 days. 
advertisements

Unix Commands 

find /opt/oracle/diag/rdbms/dbname/instance_name/trace -name "*.trc" -mtime +3 -exec rm {} \;
find /opt/oracle/diag/rdbms/dbname/instance_name/trace -name "*.trm" -mtime +3 -exec rm {} \;
find /opt/oracle/diag/rdbms/dbname/instance_name/trace -name "*.gz" -mtime +3 -exec rm {} \;
find /opt/oracle/diag/tnslsnr/hostname/listener_dbname/alert -name "log*xml" -mtime +3 -exec rm {} \;
(or)
 find . -name "*.aud" -mtime +7 -exec rm -f {} \;

Below error “arg list too long” can be sorted out by find command.

oracle..> rm -rf  *.aud
ksh: /usr/bin/rm: arg list too long

Solution

find . -name '*.aud' -exec rm {} +

_____________________________________________________________________________________________________________________

Website Stats

0 comments:

Post a Comment

Labels

Oracle (629) Script (86) General (77) Unix (47) Blog (23) Technology (19) gadget (6) games (6) Business (3) OCI (3) SQL* Loader (3) Datapump (2)
 

acehints.com Copyright 2011-23 All Rights Reserved | Site Map | Contact | Disclaimer