Program to delete old archive logs from a folder [message #323451] |
Wed, 28 May 2008 08:54 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
aviana
Messages: 106 Registered: July 2007
|
Senior Member |
|
|
Hi,
I have got a main oracle server and a backup server.
I am copying all my archivelog files from the main server to backup server.
In the main server, the deletion of old archive files is managed fine.The below code(a part of it) is used
to find out the old archive files
select 'host del '||name||';'
from v$archived_log
where completion_time < sysdate-8;
Then these are actually deleted using the host del command.
Before deletion I am transferring all the archive log files available to a backup server.Upto this is fine
I want to delete the files in backup folder regularly now due to disk space issues.
I want to delete from the folder in the backup server all the files which
are sysdate-14(keep each file for 2 weeks)
Please tell me how can I achieve this/what command to give in the batch file to do this?
After i have the correct batch file,I am planning to create a task which will run everyday to do this task.
All ideas are welcome.
|
|
|
|
|
|
Re: Program to delete old archive logs from a folder [message #324023 is a reply to message #323860] |
Fri, 30 May 2008 05:33 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
aviana
Messages: 106 Registered: July 2007
|
Senior Member |
|
|
Thanks a million ebrian, you have been very helpful in showing the right direction to go..
I searched for forfiles, downloaded forfiles.exe.
based on the examples hown, I have now created the required batch file to delete files based on date and it works fine.
Thanks again.
|
|
|
|