-
Delete old archivelogs automatically
Hi,
Is there a way to delete old archive logs automatically, lets say older than one week? I dont want to backup or use older than one week archives and I want them to be deleted automatically.
I am using oracle 10g and Sun solaris 10.
Thanks
Last edited by Zenryou; 04-24-2009 at 07:19 AM.
-
Rman
When you backup the archive logs with RMAN, specify the "DELETE INPUT" option.
"The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb
-
I guess there is a misunderstanding, I dont want any backup, I just wanted them to be deleted automatically.
I know how to delete at RMAN, but I needed this to be done automatic in specified time period.
Thanks
-
Of course there is, it's unix you can code almost anything...
Code:
find $ARCHIVE -mtime +6 | xargs rm -rf
-
Originally Posted by gandolf989
Of course there is, it's unix you can code almost anything...
Code:
find $ARCHIVE -mtime +6 | xargs rm -rf
If I do this, Oracle will not know those files were deleted and when the DB_RECOVERY_FILE_DEST_SIZE reaches, database will not open. This was happened on one of our servers and my boss wanted that archive logs must be deleted AUTOMATICALLY.
-
Oracle has no archive log memory
Originally Posted by Zenryou
If I do this, Oracle will not know those files were deleted and when the DB_RECOVERY_FILE_DEST_SIZE reaches, database will not open. This was happened on one of our servers and my boss wanted that archive logs must be deleted AUTOMATICALLY.
If you are using ASM, you need to use RMAN to remove the archive logs.
In any case, once the archive logs are written, Oracle does not care if you remove them or not (unless you need to recover the db).
Add gandolf989's suggested command to crontab.
"The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb
-
Originally Posted by Zenryou
I dont want any backup, I just wanted them to be deleted automatically.
If you do not want backup, why do you bother with archivelogs? Switch archiving off.
Ales The whole difference between a little boy and an adult man is the price of toys
-
it works in windows server as follows:: dont know abt solaris scheduling...
schedule a task using scheduled tasks in windows server dat runs a batch file everyday..The batch file contains command to create rman session that executes this block...
RMAN> run{
2> allocate channel abc device type disk;
3> resync catalog;
4> crosscheck archivelog all;
5> delete noprompt archivelog all completed before 'sysdate-6';
6> release channel abc;
7> }
lucky
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
|