Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2002
    Location
    Toronto, Canada
    Posts
    76

    Unanswered: Automatic Archive log deletion

    The archivelog directory in my Flash Recovery Area is taking up too much space(currently has 30 days of logs). What's the best way to only keep 5 days worth of archivelogs?

    I know I can write a cron script to removed the archivelogs, but could RMAN or something else be configured to do all the work for me?
    System: Oracle 10g on Fedora Core 1

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Talking

    With RMAN:
    Code:
    BACKUP ... DATABASE;
    BACKUP FORMAT "${backupdir}/${sid}_arc_s%s_p%p_t%t"
        ARCHIVELOG ALL
        DELETE INPUT;
    With KSH:
    Code:
    rm ${ARCDIR} -mtime +5 -exec rm {} \;
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  3. #3
    Join Date
    Sep 2002
    Location
    Toronto, Canada
    Posts
    76
    Thanks LKBrwn_DBA,

    I'll just run the following command:
    Code:
    find ${ARCDIR} -mtime +5 -exec rm {} \;
    System: Oracle 10g on Fedora Core 1

  4. #4
    Join Date
    Dec 2003
    Posts
    1,074
    If you delete from the command line, you'll want to run CROSSCHECK in RMAN so that your controlfile/recovery catalog is in sync with the files on your filesystem.

    If you have a RECOVERY POLICY in place in RMAN, you can also run DELETE OBSOLETE to get rid of all files that don't fit into the time range specified.

    -Chuck

  5. #5
    Join Date
    Jul 2003
    Posts
    2,296
    RMAN has a comand:
    DELETE OBSOLETE

    this will delete the archivelogs that have been backed up or archivelogs
    that are no longer needed because you initiated a FULL backup.

    no need to do anything else. RMAN takes care of it.
    - The_Duck
    you can lead someone to something but they will never learn anything ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •