cleanuptrace

anishtv
anishtv used Ask the Experts™
on
/u01/app/oracle/product/12.1.0.2/dbhome_1/rdbms/log

how can we delete the trace files created before 10 days in this location.
Is there any command.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2013
Top Expert 2013

Commented:
Assuming that those trace files all end in ".trc":

find /u01/app/oracle/product/12.1.0.2/dbhome_1/rdbms/log -name "*.trc" -mtime +10 | xargs rm

Note "+10" means "10 days old or older". I think that's what you wanted to say.

Author

Commented:
Some errors

find /u01/app/oracle/product/12.1.0.2/dbhome_1/rdbms/log -name "*.trc" -mtime +10 | xargs rm
rm: missing operand
Try `rm --help' for more information.
Most Valuable Expert 2013
Top Expert 2013

Commented:
This should only happen when no results are found. In this case use the "-r" flag to make "xargs" silently exit without calling "rm".

Which is your OS (-Release), which is your shell?

You could also try this:

find /u01/app/oracle/product/12.1.0.2/dbhome_1/rdbms/log -name "*.trc" -mtime +10 -exec rm {} \;

Please note the backslash in front of the semicolon, it's important!
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
Why these files are still there


-rwxr-xr-x 1 oracle dba      1070 Feb  4 08:46 43397_ora_80664.trc
Most Valuable Expert 2013
Top Expert 2013
Commented:
Because this file is not yet 10 days old.

Author

Commented:
good

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial