-
How to delete archived log files past one week in RMAN
Hi All,
In RMAN backup script, Once it takes the backup of all Archivelogs, I want to delete archive logs from the server disk, which are older than 7 days.
I know of command 'delete input'. But, this deletes all the files.
Is there any command like 'delete input sysdate-7' or something which serves my purpose?
Thanks in Adv.
Sam
------------------------
To handle yourself, use your head. To handle others, use your heart
-
Check the september's dba tips of the month at
It show how to delete old archive log file from the os automaticalyhttp://www.quest-pipelines.com/pipel....htm#september
-
Thanks Steeve. Thats really cool article....
Agasimani
OCP(10g/9i/8i/8)
-
Hi Steve,
Thanks but I need something which can delete from within the RMAN script. Something like 'delete input SYSDATE-n'.
Thanks,
Sam
------------------------
To handle yourself, use your head. To handle others, use your heart
-
-
From the docs, this might help you
Specifying Records by Time: Example This example backs up all logs that could be used to recover to a point one week ago, and then deletes all archived redo logs that were created more than two weeks ago:
BACKUP ARCHIVELOG UNTIL TIME 'SYSDATE-7';
DELETE COPY OF ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-14';
-
Hi Sameer,
Here, what I want is to backup all the current Archive logs available on the server but delete only those which are older than 7 days.
So, is there a command similar to
BACKUP ARCHIVELOG ALL;
DELETE COPY OF ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-7';
Will it work for me?
Also, pl. tell me how you guys have inserted goody pictures below your names.
Thanks,
Sam
------------------------
To handle yourself, use your head. To handle others, use your heart
-
Originally posted by samdba
BACKUP ARCHIVELOG ALL;
DELETE COPY OF ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-7';
Why don't you give it a try and report back to us.
Jeff Hunter
-
Hi Marist,
Thanks for your advise. I get the syntax error while using above statement.
'syntax error: Found copy expecting one of: "input" at line...'
Thanks,
Sam
------------------------
To handle yourself, use your head. To handle others, use your heart
-
Hi Sam,
Here is the command which I am using to delete archive logs from the RMAN script:
allocate channel for delete type disk;
change archivelog until time 'SYSDATE-7' delete;
release channel;
Cheers!
Farrukh
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|