Delete old archivelogs automatically
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 8 of 8

Thread: Delete old archivelogs automatically

  1. #1
    Join Date
    Feb 2009
    Posts
    17

    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.

  2. #2
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,478

    Talking 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

  3. #3
    Join Date
    Feb 2009
    Posts
    17
    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

  4. #4
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,013
    Of course there is, it's unix you can code almost anything...

    Code:
    find $ARCHIVE -mtime +6 | xargs rm -rf
    this space intentionally left blank

  5. #5
    Join Date
    Feb 2009
    Posts
    17
    Quote Originally Posted by gandolf989 View Post
    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.

  6. #6
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,478

    Cool Oracle has no archive log memory

    Quote Originally Posted by Zenryou View Post
    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

  7. #7
    Join Date
    Apr 2001
    Location
    Czechia
    Posts
    712
    Quote Originally Posted by Zenryou View Post
    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

  8. #8
    Join Date
    Oct 2008
    Location
    Chandigarh, India
    Posts
    322
    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
  •  



Click Here to Expand Forum to Full Width