Wednesday, August 5, 2009

Delete oracle logs older by x days or minutes

Note: Assuming logs,trace,aduit & etc files are at the default location.

Delete oracle logs older by x days.
$ find /$ORACLE_BASE/admin/$ORACLE_SID/bdump/*. -mtime +1 -exec rm -f {} \;

Delete oracle logs older by x minutes.
$ find /$ORACLE_BASE/admin/$ORACLE_SID/bdump/*. -mmin +120 -exec rm -f {} \;

Switch "-mtime n" Files data was last modified n*24 hours ago.
Switch "-mmin n" Files data was last modified n minutes ago.

No comments:

Post a Comment