Home » RDBMS Server » Server Administration » Program to delete old archive logs from a folder (windows,2000 professional,oracle 9i)
Program to delete old archive logs from a folder [message #323451] Wed, 28 May 2008 08:54 Go to next message
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 #323561 is a reply to message #323451] Wed, 28 May 2008 18:46 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Why do this thru SQL*Plus?

You can perform all of this thru RMAN directly.

[Updated on: Thu, 29 May 2008 18:52]

Report message to a moderator

Re: Program to delete old archive logs from a folder [message #323802 is a reply to message #323561] Thu, 29 May 2008 09:23 Go to previous messageGo to next message
aviana
Messages: 106
Registered: July 2007
Senior Member
Can somebody pls specify the batch file program to perform this task?
We dont use RMAN here
Re: Program to delete old archive logs from a folder [message #323860 is a reply to message #323802] Thu, 29 May 2008 18:53 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
You need to understand that you don't have to utilize RMAN for B&R to use RMAN to manage your archive logs.

Nevertheless, do a search on Google for a Window's Resource Kit command line tool called forfiles to delete old archive logs.

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 messageGo to next message
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.
Re: Program to delete old archive logs from a folder [message #324063 is a reply to message #324023] Fri, 30 May 2008 08:57 Go to previous message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Great, glad it helped. Thanks for posting back your results.
Previous Topic: AS
Next Topic: Oracle 9i Database Installation
Goto Forum:
  


Current Time: Mon Dec 02 00:55:22 CST 2024