Deleting applied archives from standby

Hello Guys,
We have oracle 10g rel 2 on hp-ux
I feel this common question for dataguard implementation
Just want to check best way of deleting archives automatically from standby database,i have 2 methods in mind
as below
1)At os level shell script-finding last seqno from alert log at standby/or query v$views(select max(sequence#) from v$archived_log) ,passing it to script
using rman as :*delete archivelog until sequence seqno;*
or deleting at os level upto this seqno
(Making script is not issue with this functionality and scheduling it in cron)
2)by RMAN at standby
set alter system set "_log_deletion_policy"='ALL' scope=spfile;
set CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;
however i have no plans to take backup at standby,still can i use above command
is it reliable i faced some issues in past inspite of this configurations archives were not deleted at standby
Please give your views is there any other method to delete archives automatically ,and which one is more preferred
and reliable method/best method
Thanks

804719 wrote:
Hello Guys,
We have oracle 10g rel 2 on hp-ux
I feel this common question for dataguard implementation
Just want to check best way of deleting archives automatically from standby database,i have 2 methods in mind
as below
1)At os level shell script-finding last seqno from alert log at standby/or query v$views(select max(sequence#) from v$archived_log) ,passing it to script
using rman as :*delete archivelog until sequence seqno;*
or deleting at os level upto this seqno
(Making script is not issue with this functionality and scheduling it in cron)
2)by RMAN at standby
set alter system set "_log_deletion_policy"='ALL' scope=spfile;
set CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;
however i have no plans to take backup at standby,still can i use above command
is it reliable i faced some issues in past inspite of this configurations archives were not deleted at standby
Please give your views is there any other method to delete archives automatically ,and which one is more preferred
and reliable method/best method
ThanksConfigure RMAN to purge archivelogs after applied on standby [ID 728053.1]
logdeletion_policy parameter is static, so which you cant change dynamically, PRimary should bounce, If it is fine then you can go ahead.
If you do not have time, then prepare an RMAN script to delete the archives.

Similar Messages

  • Script remove archives from standby after applied

    Hello,
    I am looking for a script to remove archivelog files from the standby flash recovery area after beeing applied.
    My database is 11.2.0.3.3 on Linux Redhat 5.
    Can someone kindly proovide me an example?
    Thank you

    RMAN does that for you :
    RMAN>CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;
    Then set the date to what you need and run as often as you need.
    http://docs.oracle.com/cd/E18283_01/server.112/e17022/rman.htm#BAJHHAEB
    #!/bin/bash
    # Name: db_rman_arch_standby.sh
    # Purpose: Delete archive from standby
    # Usage : db_rman_arch_standby <DBNAME>
    if [ "$1" ]
    then DBNAME=$1
    else
    echo "basename $0 : Syntax error : use . db_rman_full <DBNAME> "
    exit 1
    fi
    . /u01/app/oracle/dba_tool/env/${DBNAME}.env
    echo ${DBNAME}
    MAILHEADER="Archive_cleanup_on_STANDBY_${DBNAME}"
    echo "Starting RMAN..."
    $ORACLE_HOME/bin/rman target / catalog rmancat/rmancat@rcatalog << EOF
    delete noprompt ARCHIVELOG UNTIL TIME 'SYSDATE-1';
    exit
    EOF
    echo `date`
    echo
    echo 'End of archive cleanup on STANDBY'
    mailx -s ${MAILHEADER} $MAILTO < /tmp/rmandbarchstandby.out
    . /u01/app/oracle/dba_tool/bin/rmemptyfolders.sh ${DBNAME}
    # End of ScriptUses an ENV file ( standby.env ) for each database. Use Linux ENV to compare to your settings
    ORACLE_BASE=/u01/app/oracle
    ULIMIT=unlimited
    ORACLE_SID=STANDBY
    ORACLE_HOME=$ORACLE_BASE/product/11.2.0.2
    ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
    LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
    LIBPATH=$LD_LIBRARY_PATH:/usr/lib
    TNS_ADMIN=$ORACLE_HOME/network/admin
    PATH=$ORACLE_HOME/bin:$ORACLE_BASE/dba_tool/bin:/bin:/usr/bin:/usr/ccs/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:/usr/lbin:/GNU/bin/make:/u01/app/oracle/dba_tool/bin:/home/oracle/utils/SCRIPTS:/usr/local/bin:.
    export TERM=vt100
    export ORACLE_BASE ORACLE_SID ORACLE_TERM ULIMIT
    export ORACLE_HOME
    export LIBPATH LD_LIBRARY_PATH ORA_NLS33
    export TNS_ADMIN
    export PATHBest Regards
    mseberg
    Edited by: mseberg on Oct 25, 2012 4:58 AM

  • How to apply archive in Standby Database?

    Hello,
    My Database are running in linux plateform. I am seeing that archives which are generating are not copying to standby server & not applying.
    Can anybody suggest me how to copy archive from primary database(ASM file system) to standby Database & apply those archives?
    Thanks

    Hi,
    I am having similar problem. The primary logs are shipping on to standby but are not getting applied.
    Here are the outputs:
    From primary
    SQL > select thread#,max(sequence#) from v$archived_log where archived='YES' group by thread#;
    THREAD# MAX(SEQUENCE#)
    1 27908
    2 28476
    3 31643
    select max(sequence#) from gv$archived_log;
    MAX(SEQUENCE#)
    31643
    From Standby
    SQL > select thread#,max(sequence#) from v$archived_log where applied ='YES' group by thread#;
    THREAD# MAX(SEQUENCE#)
    1 26862
    2 27580
    3 30874
    select max(sequence#) from v$archived_log;
    MAX(SEQUENCE#)
    31643
    Any help is appreciated.
    Thanks in advance.

  • Is there a way to apply archive logs, standby DB is opened with 'resetlogs'

    Hi All,
    I have setup a standby database (Oracle 10g SE). I applied hot backup and archive logs to the standby database till yesterday. I have opened the standby database using 'alter database open resetlogs;" and validated the application functionality using the standby database.
    Now I want to regularly apply logs from the Primary database to the standby database, but today I have opened the standby database using 'alter database open resetlogs;"
    Need assistance to know the way to apply archive logs, once the standby database is opened with 'resetlogs' option to keep it in sync with the Primary database.
    Thanks
    Kunal

    Welcome to OTN,
    I have setup a standby database (Oracle 10g SE). I applied hot backup and archive logs to the standby database till yesterday. I have opened the standby database using 'alter database open resetlogs;" and validated the application functionality using the standby database.Standby opened with *resetlogs* ? What you did? have you performed failover of standby database?
    Now I want to regularly apply logs from the Primary database to the standby database, but today I have opened the standby database using 'alter database open resetlogs;"
    Need assistance to know the way to apply archive logs, once the standby database is opened with 'resetlogs' option to keep it in sync with the Primary database.Have you enabled Flashback & created Restore point? If so you can do it.. If not rebuild standby again.
    Check this scenario How To Open Physical Standby For Read Write Testing and Flashback [ID 805438.1]

  • Regarding deletion of archives from asm

    Dear Gurus
    I want to delete archivelogs from ASM and want to schedule a script for same in crontab.Please tell me the way for same.
    Also i removed archives manually from asmcmd.But when i runned below command,i didn't observed any change in the free_space.
    select total_mb,free_mb,(total_mb-free_mb) used from v$asm_diskgroup;
    Regards

    First of all: always, always include your four digit Oracle version and platform information,
    Moreover, crontab is a paleolithic tool, which you don't need as there is a more powerful scheduler in both database control and the database itself.
    But more importantly: One doesn't remove archivelogs using OS commands, as that will make RMAN backups don't function correctly anymore.
    You need
    delete obsolete archivelog all
    in RMAN
    Doing so, the RMAN catalog in your controlfile and the OS will be consistent.
    Sybrand Bakker
    Senior Oracle DBA

  • Procedure to delete archive log from standby server

    Hi
    We are using oracle10g(10.2.0.3) and we configured dataguard .
    I want to know procedure to delete applied archive log from standby server?
    Thanks
    With Regards
    umair

    [Delete Applied Archivelogs on Standby Database |http://emrebaransel.blogspot.com/2009/03/delete-applied-archivelogs-on-standby.html]
    http://tinyurl.com/p2krga
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com
    [Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]

  • Standby database Error in applying archives

    Hi All
    Environment:
    Oracle 8i
    Platform- HP-UX
    I have production database on HPUX box and standby database on anothe HPUX box.
    I am applying archive to standby everyday manually.
    In last week, I have added ney datafile webapp03 in Production database tablespace.
    When I apply archive to standby database. It says archive apply sucessfully but give below warning:
    ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
    ORA-01195: online backup of file 25 needs more recovery to be consistent
    ORA-01110: data file 25: '/u06/oradata/vestcom/webapp03.dbf'
    Yesterday I have copied datafile from production to standby database.
    But still I am getting same warning:
    Please let me know in detail, I am totally new in this admin field.
    Please help me out for this issue:
    Thanks in Advance.
    R M

    Absolutely. First place the tablespace space in backup mode, then copy over the datafile and then end the backup mode - applying the log files should be fine now.
    HTH
    Thanks
    Chandra

  • Delete only applied archive logs

    Hi,
    I am new to RMAN. What is the command to delete all applied archive logs using RMAN in 11g Release2 ?
    Thx

    Hi,
    What is your os ?
    If it s linux/unix then try this shell script.
    #!/bin/bash
    ALERT=/oracle/app/oracle/diag/rdbms/dgbrm/dgbrm/trace/alert_dgbrm.log
    tail -30000 $ALERT | grep "Media Recovery Log" | cut -d " " -f 4 | head --lines=-2 > files.txt
    awk '{ system( "rm -rf " $_ ) }' files.txt
    source: http://emrebaransel.blogspot.in/2009/03/delete-applied-archivelogs-on-standby.html
    Thanks,
    Ranjith

  • Deletion of archives

    hi all,
    Good day...Currently am deleting the archives in standby by using
    rman  target /  LOG = $LOG <<EOF
    run {
    crosscheck archivelog all;
    delete noprompt ARCHIVELOG ALL COMPLETED BEFORE 'sysdate-1';
    EOFSince we need archives in standby for a day... i havent configured 'apply on standby'...How can i modify the above script in such a way that i deletes the archives older than sysdate-1 and which are applied archives......It should not delete the archives which are not applied...
    thanks
    baskar.l

    One way but not sure it will be helpful for you or not.I didn't test it.Create that procedure within that schema which have rights to select the asm views v$asm_alias,v$asm_file.
    SQL> declare
      2  cursor c1 is
      3  select al.name
      4    from v$asm_alias al,v$asm_file af
      5   where al.group_number=af.group_number
      6     and al.file_number =af.file_number
      7     and af.type='ARCHIVELOG'
      8     and af.creation_date<sysdate-1;
      9  v1 varchar2(500);
    10  begin
    11  for m in c1
    12  loop
    13    v1:='alter diskgroup <diskgroupname> drop file "<+diskgroupname/>||m1.name||"';
    14    execute immediate v1;
    15  end loop;
    16  end;
    17  .
    SQL> /
    PL/SQL procedure successfully completed.scheduled that above procedure within dbms_job
    DBMS_JOB.SUBMIT (
       job       OUT BINARY_INTEGER,
       what      IN  VARCHAR2,
       next_date IN  DATE DEFAULT sysdate,
       interval  IN  VARCHAR2 DEFAULT 'null',
       no_parse  IN  BOOLEAN DEFAULT FALSE,
       instance  IN  BINARY_INTEGER DEFAULT any_instance,
       force     IN  BOOLEAN DEFAULT FALSE); Check more detail using oracle doc about dbms_job.
    Note: I have not tested above procedure.
    Khurram

  • Archives from PRD to DR

    Hi All,
    Our SAP System:
    ECC 6.0
    Windows 2003
    Oracle DB 10.2.0.4
    We started our DR 1 month before and started patching it. as DR is UP and all Patches are successfully applied. We want to shift our users from PRD to DR and want to patch the PRD.
    How can I apply archives from PRD to DR as our DR has one month old Productiion data. After then we will be able to shift users to DR. And when patching is done on PRD, we will shift them back to PRD and continue the DR as it is.
    Please help how can i complete the task above.
    Regards,
    Diya.

    Hi Diya,
    As Sunny and Orkun mentioned, the archivelogs cannot be applied in DR/standby once the DB is opened. In your case you have already opened the DB in DR and hence you will not be able to apply the archivelogs now.
    FYI: No need to apply the patches (SAP support packages) seperately in DR. Instead you can apply the patches in PRD and DR will be updated with patches/changes while you recover the archive logs.
    You can follow the below mentioned steps to create a standby DR.
    1. Backup the PRD DB (offline backup)
    2. Stop the application and DB in the DR site
    3. Restore the backup in DR using BRRESTORE
    4. Create a standby controlfile in PRD and copy the same to the controlfile locations in DR
    5. Start the DB at the DR site in the standby mode
    6. Copy the archive logs (you can either do this manually or automate the same usnig oracle dataguard)
    7. Apply/recover the archive logs in the DR (ongoing process).
    (or)
    1. Copy the datafiles from PRD
    2. Create a standby controlfile in PRD and copy the same to the controlfile locations in DR
    3. Start the DB at the DR site in the standby mode
    4. Copy the archive logs (you can either do this manually or automate the same usnig oracle dataguard)
    5. Apply/recover the archive logs in the DR (ongoing process).
    Hope this helps/clarifies.
    Regards,
    Varadharajan M

  • *HOW TO DELETE THE ARCHIVE LOGS ON THE STANDBY*

    HOW TO DELETE THE ARCHIVE LOGS ON THE STANDBY
    I have set the RMAN CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY; on my physical standby server.
    My archivelog files are not deleted on standby.
    I have set the CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default on the Primary server.
    I've checked the archivelogs with the FRA and they are not beign deleted on the STANDBY. Do I have to do something for the configuation to take effect? Like run a RMAN backup?
    I've done a lot ofresearch and i'm getting mixed answers. Please help. Thanks in advanced.
    J

    Setting the Policy will not delete the Archive logs on the Standby. ( I found a thread where the Data Guard product manager says "The deletion policy on both sides will do what you want" ). However I still
    like to clean them off with RMAN.
    I would use RMAN to delete them so that it can use that Policy are you are protected in case of Gap, transport issue etc.
    There are many ways to do this. You can simply run RMAN and have it clean out the Archive.
    Example :
    #!/bin/bash
    # Name: db_rman_arch_standby.sh
    # Purpose: Database rman backup
    # Usage : db_rman_arch_standby <DBNAME>
    if [ "$1" ]
    then DBNAME=$1
    else
    echo "basename $0 : Syntax error : use . db_rman_full <DBNAME> "
    exit 1
    fi
    . /u01/app/oracle/dba_tool/env/${DBNAME}.env
    echo ${DBNAME}
    MAILHEADER="Archive_cleanup_on_STANDBY_${DBNAME}"
    echo "Starting RMAN..."
    $ORACLE_HOME/bin/rman target / catalog <user>/<password>@<catalog> << EOF
    delete noprompt ARCHIVELOG UNTIL TIME 'SYSDATE-8';
    exit
    EOF
    echo `date`
    echo
    echo 'End of archive cleanup on STANDBY'
    mailx -s ${MAILHEADER} $MAILTO < /tmp/rmandbarchstandby.out
    # End of ScriptThis uses ( calls an ENV) so the crontab has an environment.
    Example ( STANDBY.env )
    ORACLE_BASE=/u01/app/oracle
    ULIMIT=unlimited
    ORACLE_SID=STANDBY
    ORACLE_HOME=$ORACLE_BASE/product/11.2.0.2
    ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
    LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
    LIBPATH=$LD_LIBRARY_PATH:/usr/lib
    TNS_ADMIN=$ORACLE_HOME/network/admin
    PATH=$ORACLE_HOME/bin:$ORACLE_BASE/dba_tool/bin:/bin:/usr/bin:/usr/ccs/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:/usr/lbin:/GNU/bin/make:/u01/app/oracle/dba_tool/bin:/home/oracle/utils/SCRIPTS:/usr/local/bin:.
    #export TERM=linux=80x25 wrong wrong wrong wrong wrong
    export TERM=vt100
    export ORACLE_BASE ORACLE_SID ORACLE_TERM ULIMIT
    export ORACLE_HOME
    export LIBPATH LD_LIBRARY_PATH ORA_NLS33
    export TNS_ADMIN
    export PATH
    export MAILTO=?? your email hereNote use the env command in Unix to get you settings.
    There are probably ten other/better ways to do this, but this works.
    other options ( you decide )
    Configure RMAN to purge archivelogs after applied on standby [ID 728053.1]
    http://www.oracle.com/technetwork/database/features/availability/rman-dataguard-10g-wp-1-129486.pdf
    Maintenance Of Archivelogs On Standby Databases [ID 464668.1]
    Tip I don't care myself but in some of the other forums people seem to mind if you use all caps in the subject. They say it shouting. My take is if somebody is shouting at me I'm probably going to just move away.
    Best Regards
    mseberg
    Edited by: mseberg on May 8, 2012 11:53 AM
    Edited by: mseberg on May 8, 2012 11:56 AM

  • Archive sequence number from standby does not match primary

    I have two unix servers configured, one as primary and one as standby, both in 11.2.0.2. When I run the verification scripts, I noticed that my standby's archive log sequence does not match the primary.
    From standby:
    select database_role, open_mode from v$database; Result: PHYSICAL STANDBY, MOUNTED
    select max(sequence#) from v$archived_log; Result is null
    archive log list;Database log mode Archive Mode
    Automatic archival Enabled
    Archive destination /arch/standby
    Oldest online log sequence 0
    Next log sequence to archive 0
    Current log sequence 0

    Hello;
    I don't think you have Data Guard working.
    select max(sequence#) from v$archived_log; This should return a number.
    Do an alter system switch logfile; on the primary, I'm thinking the new log never makes it to your standby.
    Once you have this working consider running something like this from your Primary:
    SELECT name as STANDBY, SEQUENCE#, applied, completion_time from v$archived_log WHERE DEST_ID = 2 AND NEXT_TIME > SYSDATE -1;
    select max(sequence#) from v$archived_log where NEXT_TIME > sysdate -1;
    You can change the first query to include both the Primary and the Standby.
    Best Regards
    mseberg

  • Archives are not applying on 2nd standby

    Hi,
    i have one primary and two standby DBs in different servers.
    archives are applying to one standby only,not appling to another.
    what are the things i need to check? please guide me

    Hi,
    archives are not applying that are received from primary
    on standby DB:
    SQL>select SEQUENCE#,APPLIED from v$archived_log;
    UENCE# APP
    393 NO
    387 NO
    388 NO
    389 NO
    on standby ihaven't seen MRP process,but i have given sql comd like
    SQL> alter database recover managed standby database disconnect from session;
    on standby it's displying
    SQL> select PROCESS,STATUS from v$managed_standby;
    PROCESS STATUS
    ARCH CLOSING
    ARCH CLOSING
    RFS WRITING
    RFS RECEIVING
    RFS RECEIVING
    here there is no MRP process,plz tell me where is the mistake.

  • How to delete archivelogs once they are applied on Physical Standby

    We have 10.2.0.4 Primary and Physical Standby.
    According to Note, ID 331924.1, we have
    on Primary:
    RMAN> SHOW ARCHIVELOG DELETION POLICY;
    RMAN configuration parameters are:
    CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;
    on Standby:
    RMAN> SHOW ARCHIVELOG DELETION POLICY;
    RMAN configuration parameters are:
    CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;
    I would like to delete the archivelogs from Primary(as soon as they are applied to standby) as well as from standby and schedule a RMAN script which will run every hourly. The archivelogs are taken on flashback area.
    Please guide.

    Handle: chakra
    Status Level: Newbie
    Registered: Oct 27, 2006
    Total Posts: 107
    Total Questions:  56 (46 unresolved)
    Name Anirban
    Why so many open questions. Close the answered questions, give points and keep forum clean.
    Refer the below link
    Best Way to monitor standby, primary databases, including alert logs, etc.
    Edited by: jazz81 on 10-May-2012 16:38

  • I deleted my albums from Facebook while cleaning my iPhoto archive.. Does anyone know if i can get them back and how? thanks!

    i deleted my albums from Facebook while cleaning my iPhoto archive.. Does anyone know if i can get them back and how? thanks!

    while cleaning my iPhoto archive
    What do you mean by that?  Do you mean you deleted photos or albums from your iPhoto Library?
    You best solution is to use Time Machine to restore your library from just before you "cleaned your iPhoto archive".

Maybe you are looking for

  • Can I have 2 diferent Constructor names in a single class?

    class Test{ double x; double y; Test( double a, double b) x=a; y=b; //Can i hv another constructor name with is not test but other name? //Example exam(double c, double d) x=c; y=d; }

  • Report of PO wise MIRO and GRN

    Dear all is there any standard report to know the PO wise MIRO and GRN details. This is required to be run periodically for a range of PO. Points will be given thanks sap

  • Error while setWhereClauseParam in Controller with Date Parameter

    Hi All, I am strugling last couple days How to setWhereClauseParam in Controller with Date Parameter.. We have requirment 1, While search Page enter the Creation_date (Data Type is Date ) based on that feacthing ViewObject Query. 2, I created the Vie

  • S-video out nonfunctional

    I've tried over time to use this output, never to any avail. Now I'm editing with FCP 2 in OS 9.2 and it would be great to output the FCP signal to a TV for reference. But the TV doesn't show up as an available monitor, whether I'm running a second m

  • How many optional allowed in the query?

    Hi, Data base is getting disconnected while running the below sparql query (Query with 9 optional conditions). I tested the query with 5 optional its working fine but, its not working for more than 5 optional. How many optional allowed in the query?