Does anyone have the code to remove trace files that are older than a certain date ?
Printable View
Does anyone have the code to remove trace files that are older than a certain date ?
without knowing some particulars, a variation on
find . -new 'keeper file name' -print | rm
would work. (Substitute a real file name where obvious).
other variations would use -mtime, -ctime or -atime parameters of find.
find . -name *trc -atime +7 -exec rm {} \;
if on NT get there are some nt ports available of the common unix commands
There are lots of variations on find. man find will give you the details...
If your installation follows OFA, the following command will trim logs that have not been accessed withing the past 7 days...
*** replace ? with your database name (i.e ORCL) ***
find $ORACLE_HOME/admin/?/bdump -name "*.trc" -atime +7 -exec rm {} \;
Thankyou rfmm1 amd alapps,
that was exactly what I was looking for.