Ye olde "delete archivelogs in standby" question

11.2.0.2.0
According to note
Configure RMAN to purge archivelogs after applied on standby [ID 728053.1]
oracle should remove archive logs if we have deletion policy set to "delete applied on standby" which I have set on primary and standby. Monitoring the alert log we see
"Deleted Oracle managed file /path/to/an/archive/log"
so we think cool, its removing them automatically. Question is, when does it delete them? Right now my standby is in sync, yet my alert log is only sporadically showing my logs being deleted which were applied hours ago which I can visibly verify.

Hemant K Chitale wrote:
Oracle automatically deletes archivelogs only when it needs to clear space in the FRA (db_recovery_file_dest).
Hemant K ChitaleI had thought this so tested.
SQL> SELECT
  2  substr(name, 1, 30) name,
  3  space_limit/(1073741824) AS Quota_GB,
  4  space_used/(1073741824) AS Used_GB,
  5  space_reclaimable/(1073741824) AS Reclaimable_GB,
  6  number_of_files AS files
  7  FROM
  8  v$recovery_file_dest ;
NAME                             QUOTA_GB    USED_GB RECLAIMABLE_GB      FILES
/u00/oracle/flash_recovery_are        310 19.7361012     18.1420259         46
-- bring the db_recovery_dest_size to 20gb to so we know we're over 90%.  according to that first note I posted, the FRA deems anything over 85% as space pressure
SQL>  alter system set db_recovery_file_dest_size=20g scope=both;
System altered.
SQL> SELECT
  2   substr(name, 1, 30) name,
  3   space_limit/(1073741824) AS Quota_GB,
  4   space_used/(1073741824) AS Used_GB,
  5   space_reclaimable/(1073741824) AS Reclaimable_GB,
  6   number_of_files AS files
  7   FROM
  8   v$recovery_file_dest ;
NAME                             QUOTA_GB    USED_GB RECLAIMABLE_GB      FILES
/u00/oracle/flash_recovery_are         20 19.7437358     18.1420259         47
SQL> So i waited a good ten minutes but still no extra logs cleared out.
So I switched the logs a couple of times in production as well to see would that help and we did get some deleted then to bring the space used down to 17.5.gb which is just below the 85% mark.
SQL> SELECT
  2   substr(name, 1, 30) name,
  3   space_limit/(1073741824) AS Quota_GB,
  4   space_used/(1073741824) AS Used_GB,
  5   space_reclaimable/(1073741824) AS Reclaimable_GB,
  6   number_of_files AS files
  7   FROM
  8   v$recovery_file_dest ;
NAME                             QUOTA_GB    USED_GB RECLAIMABLE_GB      FILES
/u00/oracle/flash_recovery_are         20 17.5075302     15.6462598         47
SQL> quick experiment, dropped to 15gb which is below the 17gb currently used. And yes immediately, I can see the files being deleted.
so what I take from this is that if there is any space available in the 15% free then Oracle waits to be woken up by the receipt of a log from primary, sees that theres less than 15% free and deletes logs to below that limit. however, if the space free is less than the space used then oracle wakes up itself and deletes the logs. Cool.
Thanks hemant.
Edited to fix coding

Similar Messages

  • How to automatically delete archivelogs on standby using RMAN?

    Hello team. I just setup a physical standby on windows environment. The primary database is been backed up via RMAN and everything works fine except that the archivelogs moved to standby site are not been deleted.
    I couldn't find some rman option to add to the scripts to take care of this issue.
    Environment:
    Windows 2003 server 32bits
    Oracle Database 9.2.0.8
    Thanks in advance!

    If you were using 10g or later you could use a deletion policy as per Oracle support note ID 728053.1.
    In 9i you need to schedule an RMAN job or shell script to delete these archives, e.g.:
    RMAN> delete archvielog all completed before 'sysdate-1';
    I have not tried it, but you can schedule also a PL/SQL script to take care of this, e.g.:
    http://www.dbasupport.com/forums/archive/index.php/t-18680.html
    http://gnjatovic.blogspot.com/2011/03/delete-applied-arhivelogs-on-standby.html

  • How to delete archivelog with RMAN in the Primary and Standby database?

    Hello,
    I am working on Oracle 10gR2.
    My question is :
    How could I implement a automatized and secure way of:
    1) Delete archivelogs on my PRIMARY server only when these logs are successfully TRANSFERED to all my standby databases?
    2) Delete archivelogs on my STANDBY server only when these logs are sucessfully APPLIED to the database?
    Thanks a lot for your help!

    on 10G
    CONFIGURE ARCHIVELOG DELETION POLICY TO [CLEAR | NONE | APPLIED ON STANDBY];
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/rman.htm#CHDBEICE
    Coskan Gundogar
    http://coskan.wordpress.com

  • Delete archivelogs on a manual standby with RMAN

    Hi,
    Using Oracle 10.2.0.3 Standard Edition, I created a manual physical standby database with a standby controlfile. FRA is configured on both servers.
    I want to use RMAN (recovery catalog in the controlfile) to delete archivelogs on the standby server using the following command:
    rman target /
    delete archivelog until time 'sysdate-5';
    The synchronisation is monitored on a daily basis so there's no risk to delete an archivelog that is not applied.
    My question: Is there a risk of corruption of the RMAN catalog (in the controlfile) in the event of a failover? I mean, will I be able to perform my RMAN backup as it becomes the primary?
    Thanks
    Christophe

    I don't see a problem with this statement. In 10g - even when a controlfile is missing backup information for whatever reason - backups can be recataloged.
    Werner

  • Due to NAS issues, when I started a new time machine backup it did not have the old backups available. My question is do I need to delete them or will time machine automatically reclaim the space?  Only one Sparse Bundle, same name.

    Due to NAS issues, when I started a new time machine backup it did not have the old backups available. My question is do I need to delete them or will time machine automatically reclaim the space?  There is only one sparse bundle but when I enter time machine I don't see my historic backups.  I use a synology DS212 for my time machine.  Started a new backup which is 218gb but it says 618 gb is occupied  therefore it looks like 2 or 3 backups are still on the disk. Before my NAS issues the last backup was in 2014.  As you can see there is a second sparse bundle from 2012.  Not sure what that is.

    This is an old message now, but what happened to me similarly was:
    I had a major computer crash and through complicated pathways ended up reinstalling (Mavericks) as a new user (long story).
    At least I had good Time Machine backups on an NAS drive (Synology DS212j), or so I thought - when I started Time Machine up again, the old backup file was gone, replaced by a new one using my "new computer" name. The old file was gone both by directly mounting the NAS drive and by clicking "Enter Time Machine".
    It's like I had {OldShareName}.sparsebundle and then it was replaced by {NewShareName}.sparsebundle, all of the old info vanished.
    (I have spent a week finding old files elsewhere and have completed a satisfactory self-restore. It pays to "archive" [my own variation of] as well as "back-up".)
    My belief is that if this were a wired-netword-drive, e.g. plugged right into my iMac with a USB cable, then the old file would have remained.
    But this is an NAS drive, connected directly to my Airport wireless router, and I don't know the significance of the fact that it stores its Time Machine backups as "sparsebundle" files rather than simply as plain(er) files.
    As usual when things get complicated with computers (not just Apple computers) there was never a warning message. Something like "YOU'RE ABOUT TO DELETE A TIME MACHINE BACK-UP FILE!!!" would have made my life a lot simpler.
    BTW, I did try a "restore from Time Machine" option the first thing I had my "new computer" (old hardware, 2009 iMac) up and running, using Migration Assistant, and it ran for many hours and then failed in the wee hours - what that has to do with anything I'm not sure.
    I'm not sure that I have a question about this other than "why do these things happen to me?", but it's a warning. Apart from that I've been very happy with the stability and reliability (but not the cost or set-up complexity) of NAS vs. directly-cabled external drives.
    Charles

  • RMAN in 10g database deletes archivelog files before standby receives them

    Hi all,
    We currently have problem with our Oracle 10gR1 database on Windows 2000 server in that the RMAN backups on the primary database delete archivelogs before the standby database can receive current and new archivelogs from primary database. What happens is that RMAN backs up the archivelogs and deletes them from disk before the archivelogs are sent to the standby. The standby then looks for these archivelogs on the primary but is unable to locate them. Whenever this happens, the production database (primary) hangs and we have to restart the instance on the primary. We have our Data Guard setup in maximum performance mode so this should not happen.
    As a short term fix, we have changed the backups to have RMAN backup and delete the archive logs 15 minutes older than current time so that the standby can receive the logs and not have problems. Besides this fix is there a long term solution to the problem or is it a bug in Oracle 10g? The issue came up after we upgraded from 9i to 10g and never saw it before in 9i with RMAN and Data Guard physical standby databases.
    Thanks
    Ben Prusinski, Oracle DBA

    thanks for answer...
    did you managed to make it 'work'?
    according to doc. if set on standby it should:
    <>
    Then, these files are eligible for deletion:
    Archived redo log files in the flash recovery area that
    were applied on the standby database.
    <>
    and this is to my understanding irespective to retention policy...unfortunately report obsolete does not report applied archived logs as eligable for deletion.
    How this works in your case?
    regards.
    goran

  • How to delete archivelogs in the STANDBY??

    Hello,
    I have a 10gR2 dataguard environment in which archivelogs are applied on the standby with a delay of 24 hours.
    Once the archivelogs are applied on the standby, I want to delete them.
    I don't have FRA (Flash Recovery Area).
    Could you tell me the best way to delete archivelogs on the standby, once they are applied on the standby database?
    Thanks

    Please see the follwoing link for a simmilar discussion:
    Applied archive log on standby

  • How to delete archivelog file at standby database

    Hi All,
    I'm running Physical Standby Database on ASM. At standby database, I can see all logs using asmcmd:
    ASMCMD> ls
    thread_1_seq_14.330.625772527
    thread_1_seq_15.346.625772527
    thread_1_seq_16.329.625772527
    thread_1_seq_17.327.625772559
    thread_1_seq_18.324.625772599
    thread_1_seq_19.341.625772367
    thread_1_seq_2.325.625772329
    But when I run RMAN to delete all these archivelogs, its give me error:
    oradr:/u01/app/oracle$rman rcvcat rman/rman@rman target /
    Recovery Manager: Release 10.2.0.3.0 - Production on Thu Jun 28 13:50:41 2007
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    connected to target database: AIXDB (DBID=2438430915, not open)
    connected to recovery catalog database
    RMAN> delete archivelog all;
    Starting implicit crosscheck backup at 28-JUN-07:01:50:56
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of delete command at 06/28/2007 13:50:56
    RMAN-12010: automatic channel allocation initialization failed
    RMAN-06004: ORACLE error from recovery catalog database: RMAN-20001: target database not found in recovery catalog
    RMAN> register database;
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of register command at 06/28/2007 13:51:06
    RMAN-08040: full resync skipped, control file is not current or backup
    Even it is not registering it. So how to delete archivelog file at standby database.
    Thanks in Advance
    Rakesh

    This appears related to Bug 3298797 that was supposed to be fixed in 10.2.0.1. The workaround is to switch over to the standby, register the standby and then switch back.

  • Deleting Archivelogs

    Hey, I am running a 11.2.0.3 RAC in archivelog mode.
    I plan to modify my backup strategy.
    Instead of a rman backup I just want to run a datapump export for three users of the database.
    My plan:
    One LEVEL 0 backup on disk, on ftp server and on local disk.
    In a case of a failure I would use the fullbackup to restore the skeleton of the database. On top I would import the users from the datapump export.
    I need the archivelogs, due to the fact that I have standby database in place.
    Question:
    If I DO NOT backup the archivelogs, will the archivelogs get deleted automatically or will the FRA run out of diskspace ?
    Until now I just this command:
    delete force noprompt archivelog all backed up 1 times to device type disk completed before 'sysdate -2';
    I can´t use this any further right ?
    Can I do this instead ?
    delete archivelog until time ‘SYSDATE-2′;    ????
    Chris

    Hey, I see the prob. With an old level 0 backup I cant´t restore until the end with the remaining archivelogs.
    So, I changed my backup idea:
    The plan is to backup the database once a week and keep the archivelogs for 8 days.
    Instead of a daily incremental level 1 backup I would just export the users with datapump and also back up archivelogs.
    All backups are transfered to a backup server.
    Here my schedule:
    Sun:
    run {BACKUP incremental level 1 for recover of copy with tag 'Fullbackup' database plus archivelog;
    recover copy of database with tag 'Fullbackup';}
    Mon-Sat:
    backup archivelog all not backed up 1 times;
    delete force noprompt archivelog all backed up 1 times to device type disk completed before 'sysdate -8';
    Does this make sense ?
    Chris

  • Deleting Archivelog files.

    I'm trying to do some cleanup of my archivelog files that are over 30 days old that have been backed up using the command:
    delete archivelog until time 'sysdate -30';
    I get an ORA-15028 saying that a file is currently being accessed.
    My question is how can I find out what is trying to access a file that is close to 40 days old?

    Note the difference betweeen 'UNTIL TIME' and 'COMPLETED BEFORE'
    http://download.oracle.com/docs/cd/B19306_01/backup.102/b14194/rcmsynta008.htm#sthref121
    Is your "latest" Level 0 backup more than 30 days old ? Or do you have Retention Policy exceeding 30 days ?

  • I'm trying to update my apps but itunes is defaulting to an old deleted email address, how can I change it?

    I'm trying to update my apps on my ipad, but when I go to updates itunes has suddenly defaulted to an old deleted email address, how can I fix this? When I go into settings on my ipad the email address is correct, it's just itunes thats causing a problem. Can someone please help, I cant access the deleted email address and when I try to answer the security questions Apple is telling me that I have entered the incorrect date of birth.....I haven't forgotten my date of birth.... this is so frustrating. What can I do?????

    Is it a different account e.g. did you update your account with a new email address or did you create a new account ? If you updated your existing account then try logging out of the account by tapping on the id at the bottom of the Featured tab in the App Store app and then log back in and see if the updated id then shows in the Purchased tab.
    If you created a new account then all apps (and any other content) downloaded by the old account will remain tied to the old account, and only that old account can download updates to its apps (and/or redownload its purchases). If you can't remember its password, and can't get the security questions reset (you don't have a rescue email address on the account ?), then you have need to contact Support in your country to get the questions and password reset.
    Contacting Apple about account security : http://support.apple.com/kb/HT5699

  • Pb of doubled archivelog at standby

    Hi all,
    I've got doubled archivelog at standby and this stops the normal applying process :
    SQL> select thread#,first_time, applied, registrar from v$archived_log where sequence#=3868;
    THREAD# FIRST_TIME APP REGISTR
    2 10/07/25 20:20:10 YES RFS
    *1 10/07/26 19:49:51 NO RFS*
    1 10/07/26 19:49:51 YES RFS
    How to delete the line marked 'NO' beacause the number 3868 has already be applied ?
    TIA
    Yang

    TIA.
    Standby database :
    SQL> show parameter log_archive_dest
    NAME TYPE VALUE
    log_archive_dest string
    log_archive_dest_1 string LOCATION=XXXXXXXX VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=XXXXXX
    log_archive_dest_10 string
    log_archive_dest_2 string SERVICE=XXXXXX VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=XXXXXX
    log_archive_dest_3 string
    log_archive_dest_4 string
    log_archive_dest_5 string
    log_archive_dest_6 string
    log_archive_dest_7 string
    log_archive_dest_8 string
    log_archive_dest_9 string
    log_archive_dest_state_1 string enable
    log_archive_dest_state_10 string enable
    log_archive_dest_state_2 string enable
    log_archive_dest_state_3 string enable
    log_archive_dest_state_4 string enable
    log_archive_dest_state_5 string enable
    log_archive_dest_state_6 string enable
    log_archive_dest_state_7 string enable
    log_archive_dest_state_8 string enable
    log_archive_dest_state_9 string enable

  • Delete archivelogs using RMAN

    Hi,
    I usually delete archivelogs with RMAN with command as "DELETE ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE -1' if i have to clear the archivelogs to freeup space from the FRA.
    My question is if i delete the archivelogs-does this deletes the records from the catalog also(I think so) if backed up to tape.In that case the catalog doesn't have info for these archives even if they are on tapes,correct?
    So in case of recovery how can i restore them?
    Thanks
    Edited by: 822424 on May 15, 2011 7:28 PM

    The RESYNC CATALOG that may be part of your backup script or implicitly executed by a Backup would synchronise from the control file to the catalog schema (repository).
    I don't think that you can selectively decide what to not resync.
    You can query RC_ARCHIVEDLOG (the STATUS column) in the repository and in V$ARCHIVED_LOG (which is against the controlfile)
    i) before the DELETE executed by RMAN and
    ii) again after the next BACKUP which does a RESYNC to see if changes are reflected.
    Hemant K Chitale

  • Rman-08137 can't delete archivelog because the capture process need it

    When I use the rman utility to delete the old archivelog on the server ,It shows :Rman-08137 can't delete archivelog because the capture process need it .how to resolve the problem?

    It is likely that the "extract" process still requires those archive logs, as it is monitoring transactions that have not yet been "captured" and written out to a GoldenGate trail.
    Consider the case of doing the following: ggsci> add extract foo, tranlog, begin now
    After pressing "return" on that "add extract" command, any new transactions will be monitored by GoldenGate. Even if you never start extract foo, the GoldenGate + rman integration will keep those logs around. Note that this GG+rman integration is a relatively new feature, as of GG 11.1.1.1 => if "add extract foo" prints out "extract is registered", then you have this functionality.
    Another common "problem" is deleting "extract foo", but forgetting to "unregister" it. For example, to properly "delete" a registered "extract", one has to run "dblogin" first:
    ggsci> dblogin userid <userid> password <password>
    ggsci> delete extract foo
    However, if you just do the following, the extract is deleted, but not unregistered. Only a warning is printed.
    ggsci> delete extract foo
    <warning: to unregister, run the command "unregister...">
    So then one just has to follow the instructions in the warning:
    ggsci> dblogin ...
    ggsci> unregister extract foo logretention
    But what if you didn't know the name of the old extracts, or were not even aware if there were any existing registered extracts? You can run the following to find out if any exist:
    sqlplus> select count(*) from dba_capture;
    The actual extract name is not exactly available, but it can be inferred:
    sqlplus> select capture_name, capture_user from dba_capture;
    <blockquote>
    CAPTURE_NAME CAPTURE_USER
    ================ ==================
    OGG$_EORADF4026B1 GGS
    </blockquote>
    In the above case, my actual "capture" process was called "eora". All OGG processes will be prefixed by OGG in the "capture_name" field.
    Btw, you can disable this "logretention" feature by adding in a tranlog option in the param file,
    TRANLOGOPTIONS LOGRETENTION DISABLED
    Or just manually "unregister" the extract. (Not doing a "dblogin" before "add extract" should also work in theory... but it doesn't. The extract is still registered after startup. Not sure if that's a bug or a feature.)
    Cheers,
    -Michael

  • Delete archivelogs with rman

    I have this setting on one database: 10.2.0.3 on linux x86
    CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
    When a backup occurs, i issue the following at the end:
    delete noprompt obsolete device type disk;
    Which delete an old backup and old archivelogs on the server.
    Situation: It happen rarely, but still, sometimes, I have to manualy delete archivelogs to make space.
    Here is what i do: Ensure that the archivelogs which I am about to delete are backed up.
    Then I issue the following Rman command:
    crosscheck archivelog all;
    delete noprompt expired archivelog all;
    which tells Rman that the archivelogs are not on the os anymore.
    Is there a way to delete archivelogs with rman or oracle, not manually on the os?
    note: i do not want to delete a backupset will doing so.
    This is temporary solution. More disk space is comming and new backup scenario will be in place for this database.

    Exists many ways to make this, as:
    DELETE NOPROMPT FORCE COPY OF ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-1';
    or
    BACKUP ARCHIVELOG all DELETE ALL INPUT;
    or
    BACKUP ARCHIVELOG all NOT BACKED UP 2 TIMES DELETE ALL INPUT;
    ...

Maybe you are looking for