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.
This Task is
the Housekeeping work performed by a DBA.
Ø 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
find more
about forfiles.exe here(http://technet2.microsoft.com/WindowsServer/en/Library/9660fea1-65c7-48cf-b466-204ba159381e1033.mspx)
for example:
D:\FORFILES.EXE /P D:\archive_dump_files -s /M *.* /D -5 /C "cmd /c del @FILE echo @FILE"
D:\FORFILES.EXE
/P D:\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.
No comments:
Post a Comment