Avatar of anishtv
anishtv
 asked on

cleanuptrace

/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.
Linux

Avatar of undefined
Last Comment
anishtv

8/22/2022 - Mon
woolmilkporc

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.
anishtv

ASKER
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.
woolmilkporc

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!
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
anishtv

ASKER
Why these files are still there


-rwxr-xr-x 1 oracle dba      1070 Feb  4 08:46 43397_ora_80664.trc
ASKER CERTIFIED SOLUTION
woolmilkporc

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
anishtv

ASKER
good