In Oracle database there are some files which reguarly create day by day such as trace files, log files, archivelog files & Exported dump files.
In this article i will show how to remove above files as batch job.
Linux platform
We can use find command for this purpose.
for example:
find $TRACEFILE/*.trc -mtime +7 -exec rm {} \;
above script remove all .trc files which older than 7 days.
Schedule: Through crontab utility schedule above script.
Windows platform
We can use FORFILES.exe for this purpose
for example:
K:\FORFILES.EXE /P K:\archive_dump_files -s /M *.* /D -5 /C "cmd /c del @FILE echo @FILE"
In above example files deleted older than 5 days from "archive_dump_files" location.
Schedule: We can use WINDOWS SCHEDULER TASK for this purpose.
"Teach Oracle Learn Oracle" -- Taj Contact me for support at askdbataj@gmail.com This blog is dedicated to all ORACLE Professionals and Learning Students.
Search This Blog
Wednesday, June 18, 2008
Delete LOGFILE older date
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment