Link to home
Start Free TrialLog in
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.
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

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.
Avatar of anishtv
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.
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!
Avatar of 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
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of anishtv

ASKER

good