RMAN script- delete archives.

Is this a solid rman backup script? I am getting varied times for a daily backup- some days it's a normal 1 hour, next day it's 6 hours. I can't find a reason- no errors are being generated, I am told to find out why this server does this and not our other servers- they were all built the same (same hardware/os/database build).
I am new to RMAN, but here is my "at job" running nightly.
rman target/
run {
backup database plus archivelog;
delete noprompt obsolete;
delete expired archivelog all;
sql 'alter system archive log current';
exit
Any reason why RMAN would run longer on certain days? Where do I look to figure this out?

rman target/
run {
backup database plus archivelog;
delete noprompt obsolete;
delete expired archivelog all;
sql 'alter system archive log current';
exitWhen you use "plus archivelog" then you dont need to issue "'alter system archive log current';" command bcz after taking DB backup it switches the logfile.
For slowness, I will say check the system state when it misbehave. Check for any locks/wait-events in the DB. Do you run any other process at that time when backup runs?? Check for any other scheduled tasks on that box on that time. Also check alert log for that time period for more information.
they were all built the same (same hardware/os/database build).Can you tell us what hardware/os/database you are on??
Daljit Singh

Similar Messages

  • RMAN never deletes archive log backups

    Hi all,
    I have same problem as some of you have already faced.
    I have some instances 10.2.0.4 running un archive log mode.
    I take full hot backup daily.
    I setup a rman script to backup and delete obsolete backups according to the following policy:
    CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 2 DAYS;
    CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
    and then:
    run {
    ALLOCATE CHANNEL RMAN_BACK_CH01 TYPE DISK;
    BACKUP AS COMPRESSED BACKUPSET DATABASE FORMAT '/mnt/rman_202/pnetpres/db_pres_%U';
    CROSSCHECK ARCHIVELOG ALL;
    BACKUP AS COMPRESSED BACKUPSET ARCHIVELOG ALL FORMAT '/mnt/rman_202/pnetpres/al_pres_%U';
    CROSSCHECK BACKUP;
    DELETE NOPROMPT OBSOLETE;
    DELETE NOPROMPT EXPIRED BACKUP;
    RELEASE CHANNEL RMAN_BACK_CH01;
    crosscheck archivelog all;
    delete noprompt archivelog all completed before 'sysdate -2';
    DB full backups are being deleted, however archive logs backups are not deleted.
    There are no tablespaces in backup or offline mode.
    How can I know the reason why some archive log backups are kept ?
    Even I clear the policy and perform a crosscheck and delete, those are not marked as obsolete neither deleted from disk.
    Thanks in advance.

    Hi Fernando,
    This are the ouputpus of the commands:
    RMAN> REPORT OBSOLETE;
    RMAN retention policy will be applied to the command
    RMAN retention policy is set to redundancy 1
    no obsolete backups found
    RMAN> LIST BACKUP OF ARCHIVELOG ALL;
    List of Backup Sets
    ===================
    BS Key Size Device Type Elapsed Time Completion Time
    1090 69.65M DISK 00:00:16 23-FEB-11
    BP Key: 1093 Status: AVAILABLE Compressed: YES Tag: TAG20110223T061511
    Piece Name: /mnt/rman_202/pnetproy/al_pres_0jm5c6bf_1_1
    List of Archived Logs in backup set 1090
    Thrd Seq Low SCN Low Time Next SCN Next Time
    1 13 2173025156 21-FEB-11 2173028010 21-FEB-11
    1 14 2173028010 21-FEB-11 2173041730 21-FEB-11
    1 15 2173041730 21-FEB-11 2173041813 21-FEB-11
    1 16 2173041813 21-FEB-11 2173106066 22-FEB-11
    1 17 2173106066 22-FEB-11 2173108831 22-FEB-11
    1 18 2173108831 22-FEB-11 2173116745 22-FEB-11
    1 19 2173116745 22-FEB-11 2173117735 22-FEB-11
    1 20 2173117735 22-FEB-11 2173117739 22-FEB-11
    1 21 2173117739 22-FEB-11 2173117753 22-FEB-11
    1 22 2173117753 22-FEB-11 2173165783 23-FEB-11
    1 23 2173165783 23-FEB-11 2173168857 23-FEB-11
    BS Key Size Device Type Elapsed Time Completion Time
    1411 125.43M DISK 00:00:28 24-FEB-11
    BP Key: 1414 Status: AVAILABLE Compressed: YES Tag: TAG20110224T061643
    Piece Name: /mnt/rman_202/pnetproy/al_pres_0mm5eqqb_1_1
    List of Archived Logs in backup set 1411
    Thrd Seq Low SCN Low Time Next SCN Next Time
    1 18 2173108831 22-FEB-11 2173116745 22-FEB-11
    1 19 2173116745 22-FEB-11 2173117735 22-FEB-11
    1 20 2173117735 22-FEB-11 2173117739 22-FEB-11
    1 21 2173117739 22-FEB-11 2173117753 22-FEB-11
    1 22 2173117753 22-FEB-11 2173165783 23-FEB-11
    1 23 2173165783 23-FEB-11 2173168857 23-FEB-11
    1 24 2173168857 23-FEB-11 2173221907 23-FEB-11
    1 25 2173221907 23-FEB-11 2173246002 24-FEB-11
    1 26 2173246002 24-FEB-11 2173249177 24-FEB-11
    BS Key Size Device Type Elapsed Time Completion Time
    1600 164.40M DISK 00:00:37 25-FEB-11
    BP Key: 1603 Status: AVAILABLE Compressed: YES Tag: TAG20110225T061643
    Piece Name: /mnt/rman_202/pnetproy/al_pres_0pm5hf6b_1_1
    List of Archived Logs in backup set 1600
    Thrd Seq Low SCN Low Time Next SCN Next Time
    1 22 2173117753 22-FEB-11 2173165783 23-FEB-11
    1 23 2173165783 23-FEB-11 2173168857 23-FEB-11
    1 24 2173168857 23-FEB-11 2173221907 23-FEB-11
    1 25 2173221907 23-FEB-11 2173246002 24-FEB-11
    1 26 2173246002 24-FEB-11 2173249177 24-FEB-11
    1 27 2173249177 24-FEB-11 2173313111 25-FEB-11
    1 28 2173313111 25-FEB-11 2173316259 25-FEB-11
    BS Key Size Device Type Elapsed Time Completion Time
    1829 132.24M DISK 00:00:30 26-FEB-11
    BP Key: 1832 Status: AVAILABLE Compressed: YES Tag: TAG20110226T061627
    Piece Name: /mnt/rman_202/pnetproy/al_pres_0sm5k3hr_1_1
    List of Archived Logs in backup set 1829
    Thrd Seq Low SCN Low Time Next SCN Next Time
    1 25 2173221907 23-FEB-11 2173246002 24-FEB-11
    1 26 2173246002 24-FEB-11 2173249177 24-FEB-11
    1 27 2173249177 24-FEB-11 2173313111 25-FEB-11
    1 28 2173313111 25-FEB-11 2173316259 25-FEB-11
    1 29 2173316259 25-FEB-11 2173380316 26-FEB-11
    1 30 2173380316 26-FEB-11 2173388686 26-FEB-11
    BS Key Size Device Type Elapsed Time Completion Time
    2058 218.03M DISK 00:00:48 27-FEB-11
    BP Key: 2061 Status: AVAILABLE Compressed: YES Tag: TAG20110227T061628
    Piece Name: /mnt/rman_202/pnetproy/al_pres_0vm5mnts_1_1
    List of Archived Logs in backup set 2058
    Thrd Seq Low SCN Low Time Next SCN Next Time
    1 28 2173313111 25-FEB-11 2173316259 25-FEB-11
    1 29 2173316259 25-FEB-11 2173380316 26-FEB-11
    1 30 2173380316 26-FEB-11 2173388686 26-FEB-11
    1 31 2173388686 26-FEB-11 2173465280 27-FEB-11
    1 32 2173465280 27-FEB-11 2173499757 27-FEB-11
    1 33 2173499757 27-FEB-11 2173527280 27-FEB-11
    1 34 2173527280 27-FEB-11 2173530545 27-FEB-11
    BS Key Size Device Type Elapsed Time Completion Time
    2298 205.39M DISK 00:00:45 28-FEB-11
    BP Key: 2301 Status: AVAILABLE Compressed: YES Tag: TAG20110228T061620
    Piece Name: /mnt/rman_202/pnetproy/al_pres_12m5pc9l_1_1
    List of Archived Logs in backup set 2298
    Thrd Seq Low SCN Low Time Next SCN Next Time
    1 30 2173380316 26-FEB-11 2173388686 26-FEB-11
    1 31 2173388686 26-FEB-11 2173465280 27-FEB-11
    1 32 2173465280 27-FEB-11 2173499757 27-FEB-11
    1 33 2173499757 27-FEB-11 2173527280 27-FEB-11
    1 34 2173527280 27-FEB-11 2173530545 27-FEB-11
    1 35 2173530545 27-FEB-11 2173589000 28-FEB-11
    1 36 2173589000 28-FEB-11 2173592018 28-FEB-11
    BS Key Size Device Type Elapsed Time Completion Time
    2546 180.29M DISK 00:00:39 01-MAR-11
    BP Key: 2549 Status: AVAILABLE Compressed: YES Tag: TAG20110301T061533
    Piece Name: /mnt/rman_202/pnetproy/al_pres_15m63to5_1_1
    List of Archived Logs in backup set 2546
    Thrd Seq Low SCN Low Time Next SCN Next Time
    1 32 2173465280 27-FEB-11 2173499757 27-FEB-11
    1 33 2173499757 27-FEB-11 2173527280 27-FEB-11
    1 34 2173527280 27-FEB-11 2173530545 27-FEB-11
    1 35 2173530545 27-FEB-11 2173589000 28-FEB-11
    1 36 2173589000 28-FEB-11 2173592018 28-FEB-11
    1 37 2173592018 28-FEB-11 2173671730 01-MAR-11
    1 38 2173671730 01-MAR-11 2173674751 01-MAR-11
    BS Key Size Device Type Elapsed Time Completion Time
    2801 85.40M DISK 00:00:19 02-MAR-11
    BP Key: 2804 Status: AVAILABLE Compressed: YES Tag: TAG20110302T061613
    Piece Name: /mnt/rman_202/pnetproy/al_pres_18m66i5d_1_1
    List of Archived Logs in backup set 2801
    Thrd Seq Low SCN Low Time Next SCN Next Time
    1 36 2173589000 28-FEB-11 2173592018 28-FEB-11
    1 37 2173592018 28-FEB-11 2173671730 01-MAR-11
    1 38 2173671730 01-MAR-11 2173674751 01-MAR-11
    1 39 2173674751 01-MAR-11 2173736248 02-MAR-11
    1 40 2173736248 02-MAR-11 2173739307 02-MAR-11
    BS Key Size Device Type Elapsed Time Completion Time
    3058 137.93M DISK 00:00:30 03-MAR-11
    BP Key: 3061 Status: AVAILABLE Compressed: YES Tag: TAG20110303T061548
    Piece Name: /mnt/rman_202/pnetproy/al_pres_1bm696gk_1_1
    List of Archived Logs in backup set 3058
    Thrd Seq Low SCN Low Time Next SCN Next Time
    1 38 2173671730 01-MAR-11 2173674751 01-MAR-11
    1 39 2173674751 01-MAR-11 2173736248 02-MAR-11
    1 40 2173736248 02-MAR-11 2173739307 02-MAR-11
    1 41 2173739307 02-MAR-11 2173784198 02-MAR-11
    1 42 2173784198 02-MAR-11 2173816111 03-MAR-11
    1 43 2173816111 03-MAR-11 2173819171 03-MAR-11
    BS Key Size Device Type Elapsed Time Completion Time
    3324 138.96M DISK 00:00:31 04-MAR-11
    BP Key: 3327 Status: AVAILABLE Compressed: YES Tag: TAG20110304T061559
    Piece Name: /mnt/rman_202/pnetproy/al_pres_1em6bqsv_1_1
    List of Archived Logs in backup set 3324
    Thrd Seq Low SCN Low Time Next SCN Next Time
    1 40 2173736248 02-MAR-11 2173739307 02-MAR-11
    1 41 2173739307 02-MAR-11 2173784198 02-MAR-11
    1 42 2173784198 02-MAR-11 2173816111 03-MAR-11
    1 43 2173816111 03-MAR-11 2173819171 03-MAR-11
    1 44 2173819171 03-MAR-11 2173882472 04-MAR-11
    1 45 2173882472 04-MAR-11 2173885557 04-MAR-11
    BS Key Size Device Type Elapsed Time Completion Time
    3597 178.07M DISK 00:00:39 05-MAR-11
    BP Key: 3600 Status: AVAILABLE Compressed: YES Tag: TAG20110305T061543
    Piece Name: /mnt/rman_202/pnetproy/al_pres_1hm6ef8f_1_1
    List of Archived Logs in backup set 3597
    Thrd Seq Low SCN Low Time Next SCN Next Time
    1 41 2173739307 02-MAR-11 2173784198 02-MAR-11
    1 42 2173784198 02-MAR-11 2173816111 03-MAR-11
    1 43 2173816111 03-MAR-11 2173819171 03-MAR-11
    1 44 2173819171 03-MAR-11 2173882472 04-MAR-11
    1 45 2173882472 04-MAR-11 2173885557 04-MAR-11
    1 46 2173885557 04-MAR-11 2173947612 05-MAR-11
    1 47 2173947612 05-MAR-11 2173951657 05-MAR-11
    BS Key Size Device Type Elapsed Time Completion Time
    3835 198.44M DISK 00:00:43 06-MAR-11
    BP Key: 3838 Status: AVAILABLE Compressed: YES Tag: TAG20110306T061548
    Piece Name: /mnt/rman_202/pnetproy/al_pres_1km6h3kk_1_1
    List of Archived Logs in backup set 3835
    Thrd Seq Low SCN Low Time Next SCN Next Time
    1 45 2173882472 04-MAR-11 2173885557 04-MAR-11
    1 46 2173885557 04-MAR-11 2173947612 05-MAR-11
    1 47 2173947612 05-MAR-11 2173951657 05-MAR-11
    1 48 2173951657 05-MAR-11 2174026607 06-MAR-11
    1 49 2174026607 06-MAR-11 2174062014 06-MAR-11
    1 50 2174062014 06-MAR-11 2174087203 06-MAR-11
    1 51 2174087203 06-MAR-11 2174090299 06-MAR-11
    BS Key Size Device Type Elapsed Time Completion Time
    4131 185.94M DISK 00:00:40 07-MAR-11
    BP Key: 4134 Status: AVAILABLE Compressed: YES Tag: TAG20110307T061546
    Piece Name: /mnt/rman_202/pnetproy/al_pres_1nm6jo0i_1_1
    List of Archived Logs in backup set 4131
    Thrd Seq Low SCN Low Time Next SCN Next Time
    1 47 2173947612 05-MAR-11 2173951657 05-MAR-11
    1 48 2173951657 05-MAR-11 2174026607 06-MAR-11
    1 49 2174026607 06-MAR-11 2174062014 06-MAR-11
    1 50 2174062014 06-MAR-11 2174087203 06-MAR-11
    1 51 2174087203 06-MAR-11 2174090299 06-MAR-11
    1 52 2174090299 06-MAR-11 2174147018 07-MAR-11
    1 53 2174147018 07-MAR-11 2174149955 07-MAR-11
    BS Key Size Device Type Elapsed Time Completion Time
    4435 161.37M DISK 00:00:35 08-MAR-11
    BP Key: 4438 Status: AVAILABLE Compressed: YES Tag: TAG20110308T061540
    Piece Name: /mnt/rman_202/pnetproy/al_pres_1qm6mccc_1_1
    List of Archived Logs in backup set 4435
    Thrd Seq Low SCN Low Time Next SCN Next Time
    1 49 2174026607 06-MAR-11 2174062014 06-MAR-11
    1 50 2174062014 06-MAR-11 2174087203 06-MAR-11
    1 51 2174087203 06-MAR-11 2174090299 06-MAR-11
    1 52 2174090299 06-MAR-11 2174147018 07-MAR-11
    1 53 2174147018 07-MAR-11 2174149955 07-MAR-11
    1 54 2174149955 07-MAR-11 2174239915 08-MAR-11
    1 55 2174239915 08-MAR-11 2174242816 08-MAR-11
    BS Key Size Device Type Elapsed Time Completion Time
    4745 79.24M DISK 00:00:18 09-MAR-11
    BP Key: 4748 Status: AVAILABLE Compressed: YES Tag: TAG20110309T061555
    Piece Name: /mnt/rman_202/pnetproy/al_pres_1tm6p0os_1_1
    List of Archived Logs in backup set 4745
    Thrd Seq Low SCN Low Time Next SCN Next Time
    1 53 2174147018 07-MAR-11 2174149955 07-MAR-11
    1 54 2174149955 07-MAR-11 2174239915 08-MAR-11
    1 55 2174239915 08-MAR-11 2174242816 08-MAR-11
    1 56 2174242816 08-MAR-11 2174304682 09-MAR-11
    1 57 2174304682 09-MAR-11 2174307679 09-MAR-11
    BS Key Size Device Type Elapsed Time Completion Time
    5270 135.13M DISK 00:00:31 10-MAR-11
    BP Key: 5273 Status: AVAILABLE Compressed: YES Tag: TAG20110310T061603
    Piece Name: /mnt/rman_202/pnetproy/al_proy_20m6rl53_1_1
    List of Archived Logs in backup set 5270
    Thrd Seq Low SCN Low Time Next SCN Next Time
    1 55 2174239915 08-MAR-11 2174242816 08-MAR-11
    1 56 2174242816 08-MAR-11 2174304682 09-MAR-11
    1 57 2174304682 09-MAR-11 2174307679 09-MAR-11
    1 58 2174307679 09-MAR-11 2174353241 09-MAR-11
    1 59 2174353241 09-MAR-11 2174384330 10-MAR-11
    1 60 2174384330 10-MAR-11 2174387259 10-MAR-11
    RMAN>
    For example the backups of archivelog from Feb 21st will never be deleted unless I force the delete.
    I'd like to understand why it happens :-)
    Thanks a lot,
    Regards,
    Diego.

  • Deleting archives with RMAN when physical database is in place

    hi all,
    i want to backup and remove archvie logs using RMAN on one of my system which is having a physical standby database.how can i ensure RMAN backup and delete only archive logs which are shipped to DR site(physical standby database).when ever i fire my rman script it should delte only the archvies which are alredy shipped.i appreciate your valueble inpus in this regard.
    regards
    SAngeeth

    Hi,
    @sangeeth +" what if my database has no flash recovery area confgured. "+
    This is introduced in Oracle Database 11g R1. Please check http://download.oracle.com/docs/cd/B28359_01/backup.111/b28270/wnbradv.htm#sthref6
    Archived log deletion policy enhancements
    When you CONFIGURE an archived log deletion policy, the configuration applies to all archiving destinations, including the flash recovery area. Both BACKUP ... DELETE INPUT and DELETE ... ARCHIVELOG obey this configuration, as does the flash recovery area. You can also CONFIGURE an archived redo log deletion policy so that logs are eligible for deletion only after being applied to or transferred to standby database destinations. You can set the policy for mandatory standby destinations only, or for any standby destinations.
    Regards,
    Vaibhav

  • RMAN-08137: WARNING: archived log not deleted as it is still needed

    I am trying to delete archive logs older than 7 days in streams environment.
    1) we dont have a standby database
    2) checkpoint_retention_time = 7
    Please help me with this.
    Regards,
    Mike

    SQL> set serveroutput on
    DECLARE
    hScn number := 0;
    lScn number := 0;
    sScn number;
    ascn number;
    alog varchar2(1000);
    begin
    select min(start_scn), min(applied_scn) into sScn, ascn
    from dba_capture;
    DBMS_OUTPUT.ENABLE(2000);
    for cr in (select distinct(a.ckpt_scn)
    from system.logmnr_restart_ckpt$ a
    where a.ckpt_scn <= ascn and a.valid = 1
    and exists (select * from system.logmnr_log$ l
    where a.ckpt_scn between l.first_change# and l.next_change#)
    order by a.ckpt_scn desc)
    loop
    if (hScn = 0) then
    hScn := cr.ckpt_scn;
    else
    lScn := cr.ckpt_scn;
    exit;
    end if;
    end loop;
    if lScn = 0 then
    lScn := sScn;
    end if;
    dbms_output.put_line('Capture will restart from SCN ' || lScn ||' in the following file:');
    for cr in (select name, first_time
    from DBA_REGISTERED_ARCHIVED_LOG
    where lScn between first_scn and next_scn order by thread#)
    loop
    dbms_output.put_line(cr.name||' ('||cr.first_time||')');
    end loop;
    end;
    After i ran the above script from metalink i got the below output.
    When I have run the above code that is given in metalink to check the minimum archive logs required to restart streams i got the below ouput.
    Capture will restart from SCN 55313283790in the following file:
    +FLASH/ORCL/archivelog/2011_02_22/thread_1_seq_842.346.443519740 (11-MAR-11)*
    +FLASH/ORCL/archivelog/2011_02_22/thread_2_seq_832.189.440690538 (11-MAR-11)*
    Does this mean that I will not be able to delete the archive logs from 11-mar-11 ?
    Regards,
    Mike

  • RMAN-08120: WARNING: archived log not deleted, not yet applied by standby

    i get RMAN-08120: WARNING: archived log not deleted, not yet applied by standby on primary
    but when i run below query i get the same result from primary and standby
    SQL> select max(sequence#) from v$archived_log;
    MAX(SEQUENCE#)
    44051
    SQL>
    standby is one log switch behind only!

    i get RMAN-08120: WARNING: archived log not deleted, not yet applied by standby on primary You already have answer by post of Mseberg.
    but when i run below query i get the same result from primary and standby
    SQL> select max(sequence#) from v$archived_log;
    MAX(SEQUENCE#)
    44051
    SQL>
    standby is one log switch behind only!this is wrong query used on primary & standby. even if any one of archive gap available lets suppose sequence *44020* , this archive not transported to standby due to some network problem and so on. later if archives from *44021* all the archives transported on standby upto *44051* , then it shows the maximum sequence transferred to standby, It wont shows applied sequence.
    Check the below queries.
    Primary:-
    SQL> select thread#,max(sequence#) from v$archived_log group by thread#;
    Standby:-
    SQL> select thread#,max(sequence#) from v$archived_log where applied='YES' group by thread#;
    HTH.

  • Is RMAN only way to take backup and delete Archive Logs?

    On primary db:
    ===============
    OS: Windows 2003 server 32-bit
    Oracle: Oracle 10g (10.2.0.1.0) R2 32-bit
    On Physical standby db:
    ===============
    OS: Windows 2003 server 32-bit
    Oracle: Oracle 10g (10.2.0.1.0) R2 32-bit
    Data Guard just configured. Archive Logs are properly being shipped to standby db. Is RMAN only way to take backup and delete Archive Logs from both primary and standby db? What other command can be used?
    Thanks

    No, but anything else is way more work. Without using RMAN you would have to find another way to keep track of applied logs.
    RMAN make this very simple :
    RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY;Using another method would be like using the handle of your screwdriver as a hammer.
    See "RMAN Recipes for Oracle Database 11g" ISBN 978-1-5959-851-1
    Best Regards
    mseberg

  • How to delete archive log by RMAN.

    Hi All,
    How to delete archive log by RMAN and what is the difference between
    delete all input & all delete input in RMAN backup.

    plus archivelog all delete inputYou get an error on the syntax.
    "PLUS ARCHIVELOG" does not allow the "ALL" keyword.
    (See "backupSpecOperand" in the RMAN Documentation of the BACKUP command syntax).
    However, "DELETE INPUT" allows the optional "ALL" keyword as in "DELETE ALL INPUT" to delete from all archivelog destinations.
    I guess that you have confused the "ALL" keyword in "BACKUP ARCHIVELOG" as being possible in "BACKUP .. PLUS ARCHIVELOG".
    "ALL" is allowed in "BACKUP ARCHIVELOG" but not in "BACKUP .. PLUS ARCHIVELOG".
    Hemant K Chitale

  • Can I call an external program from my rman script

    Hi
    Is it possible to do an external call to a bat-file in a rman script?
    My script looks like this (it's pretty much generated from EM):
    $rman_script="backup device type disk tag '%TAG' database;
    sql 'alter system archive log current';
    backup device type disk tag '%TAG' archivelog all not backed up delete all input;
    allocate channel for maintenance type disk;
    delete noprompt obsolete device type disk;
    release channel;
    Can i somehow make an external call before at the end?
    Regards
    Klaus Mogensen

    You can use the HOST command.

  • Recovery window retention policy deletes archive logs before a backup?

    Hi All,
    Oracle 11G on Windows 2008 R2
    This afternoon, I changed my RMAN retention policy from 'RETENTION POLICY REDUNDANCY 3' to RETENTION POLICY RECOVERY WINDOW OF 3 DAYS'
    However, i checked tonight and after my daily backup ran, all the archive logs prior to the backup had been deleted! Thus meaning i dont think i can restore to any point in time, prior to my daily backup. All the .arc logs were there after the backup. So i tried another test and kicked off the daily backup again. During the backup process, the archive logs got deleted again! Now i don't have any archive logs..
    Is this proper behaviour of RETENTION POLICY RECOVERY WINDOW?? I thought it would keep all the files needed for me to restore to any point in time for the previous 3 days. When i used REDUNDANCY, with my daily backups, it kept 3 days worth of backups+ archive logs so i could restore point-in-time to any point. How can i use RECOVERY WINDOW so that i can actually restore to any point-in-time for the 3 days??
    I wanted to change to RECOVERY WINDOW since i read that by using REDUNDANCY it only keeps X copies of a backup (so if i ran the backup 3 times in a day, i would only have those 3).
    Thanks in advance.

    Hi All,
    Here is the SHOW ALL output:
    RMAN> show all;
    RMAN configuration parameters for database with db_unique_name MMSPRD7 are:
    CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 3 DAYS;
    CONFIGURE BACKUP OPTIMIZATION OFF; # default
    CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
    CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
    CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
    CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
    CONFIGURE MAXSETSIZE TO UNLIMITED; # default
    CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
    CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
    CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOA
    D TRUE ; # default
    CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
    CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:\ORACLE\DATABASE\ORA11G\DATABASE\SNCFM
    MSPRD7.ORA'; # default
    Here is the RMAN script:
    Recovery Manager: Release 11.2.0.3.0 - Production on Mon Jan 20 23:03:12 2014
    Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
    connected to target database: XXX (DBID=)
    RMAN> CROSSCHECK ARCHIVELOG ALL;
    2> CROSSCHECK BACKUPSET;
    3> CROSSCHECK BACKUP;
    4> CROSSCHECK COPY;
    5> DELETE NOPROMPT EXPIRED ARCHIVELOG ALL;
    6> DELETE NOPROMPT EXPIRED BACKUPSET;
    7> DELETE NOPROMPT OBSOLETE;
    8> BACKUP CURRENT CONTROLFILE;
    9> BACKUP AS COMPRESSED BACKUPSET DATABASE PLUS ARCHIVELOG DELETE INPUT;
    Also, not sure if you needed the whole RMAN output, but here is the deletion part:
    RMAN retention policy will be applied to the command
    RMAN retention policy is set to recovery window of 3 days
    using channel ORA_DISK_1
    Deleting the following obsolete backups and copies:
    Type                 Key    Completion Time    Filename/Handle
    Backup Set           1392   15-JAN-14        
      Backup Piece       1392   15-JAN-14          F:\ORAFRA\MMSPRD7\BACKUPSET\2014_01_15\O1_MF_NNNDF_TAG20140115T190054_9FG89R8N_.BKP
    Backup Set           1393   15-JAN-14        
      Backup Piece       1393   15-JAN-14          F:\ORAFRA\MMSPRD7\BACKUPSET\2014_01_15\O1_MF_ANNNN_TAG20140115T192204_9FG9KDHX_.BKP
    Backup Set           1397   16-JAN-14        
      Backup Piece       1397   16-JAN-14          F:\ORAFRA\MMSPRD7\BACKUPSET\2014_01_16\O1_MF_ANNNN_TAG20140116T190027_9FJWNW6L_.BKP
    Backup Set           1400   17-JAN-14        
      Backup Piece       1400   17-JAN-14          F:\ORAFRA\MMSPRD7\BACKUPSET\2014_01_17\O1_MF_ANNNN_TAG20140117T190138_9FMK349M_.BKP
    deleted backup piece
    backup piece handle=F:\ORAFRA\MMSPRD7\BACKUPSET\2014_01_15\O1_MF_NNNDF_TAG20140115T190054_9FG89R8N_.BKP RECID=1392 STAMP=836938856
    deleted backup piece
    backup piece handle=F:\ORAFRA\MMSPRD7\BACKUPSET\2014_01_15\O1_MF_ANNNN_TAG20140115T192204_9FG9KDHX_.BKP RECID=1393 STAMP=836940124
    deleted backup piece
    backup piece handle=F:\ORAFRA\MMSPRD7\BACKUPSET\2014_01_16\O1_MF_ANNNN_TAG20140116T190027_9FJWNW6L_.BKP RECID=1397 STAMP=837025228
    deleted backup piece
    backup piece handle=F:\ORAFRA\MMSPRD7\BACKUPSET\2014_01_17\O1_MF_ANNNN_TAG20140117T190138_9FMK349M_.BKP RECID=1400 STAMP=837111700
    Deleted 4 objects

  • RMAN script errors out for some DB's

    I have a single RMAN script that uses env variables to execute RMAN for two databases. It runs fine. I cloned the two DB's (changed DBID's), all four are on the same host. Now I try to use same script for all four. I receive an error when trying to run against the cloned databases. Here is script:
    spool log to full.log append;
    connect catalog rman/xxxxxx@iasrman
    connect target /
    run {
    sql 'ALTER SYSTEM SWITCH LOGFILE';
    backup incremental level 0 database diskratio=0 plus archivelog delete input;
    And here is error, it stops same place everytime, input appreciated.
    Recovery Manager: Release 9.2.0.5.0 - 64bit Production
    RMAN>
    connected to recovery catalog database
    RMAN>
    connected to target database: PRSMQ02 (DBID=944525168)
    RMAN> 2> 3> 4>
    sql statement: ALTER SYSTEM SWITCH LOGFILE
    Starting backup at 30-MAY-07
    current log archived
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=20 devtype=DISK
    allocated channel: ORA_DISK_2
    channel ORA_DISK_2: sid=19 devtype=DISK
    allocated channel: ORA_DISK_3
    channel ORA_DISK_3: sid=18 devtype=DISK
    allocated channel: ORA_DISK_4
    channel ORA_DISK_4: sid=17 devtype=DISK
    allocated channel: ORA_DISK_5
    channel ORA_DISK_5: sid=11 devtype=DISK
    channel ORA_DISK_1: starting archive log backupset
    channel ORA_DISK_1: specifying archive log(s) in backup set
    input archive log thread=1 sequence=25 recid=25 stamp=623931644
    channel ORA_DISK_1: starting piece 1 at 30-MAY-07
    channel ORA_DISK_2: starting archive log backupset
    channel ORA_DISK_2: specifying archive log(s) in backup set
    input archive log thread=1 sequence=26 recid=26 stamp=623931644
    channel ORA_DISK_2: starting piece 1 at 30-MAY-07
    channel ORA_DISK_1: finished piece 1 at 30-MAY-07
    piece handle=/iasrman/q02/prsmq02/prsmq02_df623931649_s59_s1 comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
    channel ORA_DISK_1: deleting archive log(s)
    archive log filename=/q02/archive/prism/log_prsmq02_25.arc recid=25 stamp=623931644
    channel ORA_DISK_2: finished piece 1 at 30-MAY-07
    piece handle=/iasrman/q02/prsmq02/prsmq02_df623931649_s60_s1 comment=NONE
    channel ORA_DISK_2: backup set complete, elapsed time: 00:00:02
    channel ORA_DISK_2: deleting archive log(s)
    archive log filename=/q02/archive/prism/log_prsmq02_26.arc recid=26 stamp=623931644
    Finished backup at 30-MAY-07
    Starting backup at 30-MAY-07
    using channel ORA_DISK_1
    using channel ORA_DISK_2
    using channel ORA_DISK_3
    using channel ORA_DISK_4
    using channel ORA_DISK_5
    channel ORA_DISK_1: starting incremental level 0 datafile backupset
    channel ORA_DISK_1: specifying datafile(s) in backupset
    input datafile fno=00009 name=/q02/oradata01/prsmdata/Data_13.dbf
    input datafile fno=00016 name=/q02/oradata01/prsmdata/Data_20.dbf
    input datafile fno=00025 name=/q02/oradata01/prsmdata/Data_04.dbf
    input datafile fno=00005 name=/q02/oraindx01/prsmdata/Index_11.dbf
    input datafile fno=00020 name=/q02/oradata01/prsmdata/Tools02.dbf
    input datafile fno=00022 name=/q02/oraindx01/prsmdata/index_12.dbf
    channel ORA_DISK_1: starting piece 1 at 30-MAY-07
    channel ORA_DISK_2: starting incremental level 0 datafile backupset
    channel ORA_DISK_2: specifying datafile(s) in backupset
    input datafile fno=00010 name=/q02/oradata01/prsmdata/Data_14.dbf
    input datafile fno=00015 name=/q02/oradata01/prsmdata/Data_19.dbf
    input datafile fno=00024 name=/q02/oradata01/prsmdata/Data_03.dbf
    input datafile fno=00003 name=/q02/oratmp01/prsmdata/rbs01.dbf
    input datafile fno=00001 name=/q02/orasys01/prsmdata/system01.dbf
    input datafile fno=00012 name=/q02/orasys01/prsmdata/system02.dbf
    channel ORA_DISK_2: starting piece 1 at 30-MAY-07
    channel ORA_DISK_3: starting incremental level 0 datafile backupset
    channel ORA_DISK_3: specifying datafile(s) in backupset
    input datafile fno=00008 name=/q02/oradata01/prsmdata/Data_12.dbf
    input datafile fno=00014 name=/q02/oradata01/prsmdata/Data_18.dbf
    input datafile fno=00023 name=/q02/oradata01/prsmdata/Data_02.dbf
    input datafile fno=00028 name=/q02/oradata01/prsmdata/Data06.dbf
    input datafile fno=00019 name=/q02/oratmp01/prsmdata/rbs02.dbf
    input datafile fno=00021 name=/q02/orasys01/prsmdata/DRSYS.dbf
    channel ORA_DISK_3: starting piece 1 at 30-MAY-07
    channel ORA_DISK_4: starting incremental level 0 datafile backupset
    channel ORA_DISK_4: specifying datafile(s) in backupset
    input datafile fno=00007 name=/q02/oradata01/prsmdata/Data_11.dbf
    input datafile fno=00013 name=/q02/oradata01/prsmdata/Data_17.dbf
    input datafile fno=00018 name=/q02/oradata01/prsmdata/Data_01.dbf
    input datafile fno=00006 name=/q02/oradata01/prsmdata/Tools01.dbf
    input datafile fno=00002 name=/q02/oradata01/prsmdata/Users01.dbf
    input datafile fno=00026 name=/q02/oradata01/prsmdata/Data05.dbf
    channel ORA_DISK_4: starting piece 1 at 30-MAY-07
    channel ORA_DISK_5: starting incremental level 0 datafile backupset
    channel ORA_DISK_5: specifying datafile(s) in backupset
    input datafile fno=00004 name=/q02/oradata01/prsmdata/Data_15.dbf
    input datafile fno=00011 name=/q02/oradata01/prsmdata/Data_16.dbf
    input datafile fno=00017 name=/q02/oradata01/prsmdata/Data_22.dbf
    input datafile fno=00027 name=/q02/oradata01/prsmdata/Data_05.dbf
    channel ORA_DISK_5: starting piece 1 at 30-MAY-07
    channel ORA_DISK_1: finished piece 1 at 30-MAY-07
    piece handle=/iasrman/q02/prsmq02/prsmq02_df623931654_s61_s1 comment=NONE
    channel ORA_DISK_1: starting piece 2 at 30-MAY-07
    channel ORA_DISK_2: finished piece 1 at 30-MAY-07
    piece handle=/iasrman/q02/prsmq02/prsmq02_df623931654_s62_s1 comment=NONE
    channel ORA_DISK_2: starting piece 2 at 30-MAY-07
    channel ORA_DISK_3: finished piece 1 at 30-MAY-07
    piece handle=/iasrman/q02/prsmq02/prsmq02_df623931654_s63_s1 comment=NONE
    channel ORA_DISK_3: starting piece 2 at 30-MAY-07
    channel ORA_DISK_4: finished piece 1 at 30-MAY-07
    piece handle=/iasrman/q02/prsmq02/prsmq02_df623931654_s64_s1 comment=NONE
    channel ORA_DISK_4: starting piece 2 at 30-MAY-07
    channel ORA_DISK_5: finished piece 1 at 30-MAY-07
    piece handle=/iasrman/q02/prsmq02/prsmq02_df623931654_s65_s1 comment=NONE
    channel ORA_DISK_5: starting piece 2 at 30-MAY-07
    channel ORA_DISK_2: finished piece 2 at 30-MAY-07
    piece handle=/iasrman/q02/prsmq02/prsmq02_df623931654_s62_s2 comment=NONE
    channel ORA_DISK_2: starting piece 3 at 30-MAY-07
    channel ORA_DISK_1: finished piece 2 at 30-MAY-07
    piece handle=/iasrman/q02/prsmq02/prsmq02_df623931654_s61_s2 comment=NONE
    channel ORA_DISK_1: starting piece 3 at 30-MAY-07
    channel ORA_DISK_4: finished piece 2 at 30-MAY-07
    piece handle=/iasrman/q02/prsmq02/prsmq02_df623931654_s64_s2 comment=NONE
    channel ORA_DISK_4: starting piece 3 at 30-MAY-07
    channel ORA_DISK_5: finished piece 2 at 30-MAY-07
    piece handle=/iasrman/q02/prsmq02/prsmq02_df623931654_s65_s2 comment=NONE
    channel ORA_DISK_5: starting piece 3 at 30-MAY-07
    channel ORA_DISK_3: finished piece 2 at 30-MAY-07
    piece handle=/iasrman/q02/prsmq02/prsmq02_df623931654_s63_s2 comment=NONE
    channel ORA_DISK_3: starting piece 3 at 30-MAY-07
    channel ORA_DISK_2: finished piece 3 at 30-MAY-07
    piece handle=/iasrman/q02/prsmq02/prsmq02_df623931654_s62_s3 comment=NONE
    channel ORA_DISK_2: starting piece 4 at 30-MAY-07
    channel ORA_DISK_4: finished piece 3 at 30-MAY-07
    piece handle=/iasrman/q02/prsmq02/prsmq02_df623931654_s64_s3 comment=NONE
    channel ORA_DISK_4: starting piece 4 at 30-MAY-07
    channel ORA_DISK_1: finished piece 3 at 30-MAY-07
    piece handle=/iasrman/q02/prsmq02/prsmq02_df623931654_s61_s3 comment=NONE
    channel ORA_DISK_1: starting piece 4 at 30-MAY-07
    channel ORA_DISK_2: finished piece 4 at 30-MAY-07
    piece handle=/iasrman/q02/prsmq02/prsmq02_df623931654_s62_s4 comment=NONE
    channel ORA_DISK_2: backup set complete, elapsed time: 00:53:23
    channel ORA_DISK_5: finished piece 3 at 30-MAY-07
    piece handle=/iasrman/q02/prsmq02/prsmq02_df623931654_s65_s3 comment=NONE
    channel ORA_DISK_5: starting piece 4 at 30-MAY-07
    channel ORA_DISK_3: finished piece 3 at 30-MAY-07
    piece handle=/iasrman/q02/prsmq02/prsmq02_df623931654_s63_s3 comment=NONE
    channel ORA_DISK_3: starting piece 4 at 30-MAY-07
    channel ORA_DISK_4: finished piece 4 at 30-MAY-07
    piece handle=/iasrman/q02/prsmq02/prsmq02_df623931654_s64_s4 comment=NONE
    channel ORA_DISK_4: starting piece 5 at 30-MAY-07
    channel ORA_DISK_1: finished piece 4 at 30-MAY-07
    piece handle=/iasrman/q02/prsmq02/prsmq02_df623931654_s61_s4 comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:59:04
    channel ORA_DISK_3: finished piece 4 at 30-MAY-07
    piece handle=/iasrman/q02/prsmq02/prsmq02_df623931654_s63_s4 comment=NONE
    channel ORA_DISK_3: backup set complete, elapsed time: 01:00:10
    channel ORA_DISK_5: finished piece 4 at 30-MAY-07
    piece handle=/iasrman/q02/prsmq02/prsmq02_df623931654_s65_s4 comment=NONE
    channel ORA_DISK_5: backup set complete, elapsed time: 01:00:25
    channel ORA_DISK_4: finished piece 5 at 30-MAY-07
    piece handle=/iasrman/q02/prsmq02/prsmq02_df623931654_s64_s5 comment=NONE
    channel ORA_DISK_4: backup set complete, elapsed time: 01:01:40
    Finished backup at 30-MAY-07
    Starting backup at 30-MAY-07
    current log archived
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of backup command at 05/30/2007 11:22:38
    RMAN-06004: ORACLE error from recovery catalog database: ORA-03114: not connected to ORACLE

    connect target /You need to inform the connection string to target database.
    Can to be explicitly or with 'export sid' in your script.

  • RMAN Script is not allocating channels

    I have a customer who is running a Solaris Server with Oracle 9i and is trying to backup using an RMAN script to define the channels to back up to through Networker.
    The script is as follows:
    run {
    allocate channel t1 type "sbt_tape";
    allocate channel t2 type "sbt_tape";
    send 'NSR_ENV=(NSR_SERVER=XXXX,NSR_DATA_VOLUME_POOL=Default)';
    sql 'alter system archive log current';
    change archivelog all crosscheck;
    set command id to 'bkrs';
    backup
    filesperset 20
    archivelog all
    delete input;
    release channel t1;
    release channel t2;
    Normally there are 3 channel allocations, but for some reason this does not work. He can only get 1 channel to work at a time which is impacting Backup Performance.
    There are no errors logged in the log files which is also odd. The device parallelism is 4 under Networker
    The version of Networker is 7.1
    Anyone else had any similar issues - I have been scratching my head on this for a while, or if anyone has any ideas on how to troubleshoot this I would appreciate any help
    Thanks

    I have now found some error information. Please see below.
    RMAN-00571: ======================================
    RMAN-00569: ===== ERROR MESSAGE STACK FOLLOWS =====
    RMAN-00571: =======================================
    RMAN-03009: failure of allocate command on t1 channel at 04/08/2004 10:37:02
    ORA-19554: error allocating device, device type: SBT_TAPE, device name:
    ORA-27211: Failed to load Media Management Library
    Any help much appreciated !!!!!

  • RMAN script for Unix

    We have decided to abandon user managed hot backups and go with RMAN. Could you critizize the following approach and see if we are missing anything? I am making whole database backup and controlfile and archivelogs. I am using RMAN catalog.
    In a Unix script setting all of the environment variables and then
    connect target ********
    connect catalog *********
    configure snapshot controlfile to '${ORACLE_HOME}/snapshot_${ORACLE_SID}_${TIMESTAMP}_ctl';
    run {
    allocate channel c1 type disk;
    allocate channel c2 type disk;
    allocate channel c3 type disk;
    backup database plus archivelogs;
    release channel c1;
    release channel c2;
    p.s. control file autobackup is on
    Also, I have these questions:
    1. How do I direct the output of this backup to a file?
    2. Is there a way to check for errors within this file to see if the backup went ok?
    3. Would anyone have a unix shell script example of the above?
    4. How do I make sure that catalog is synched with control file and what is on the file system?
    5. Is it customary to delete archive logs via RMAN script if, say, my policy is to keep it on the file system for 7 days?
    thank you for any input!

    Hi,
    You didnot mention the db version, assumed it's 10g.
    If you planned to schedule this job at os level, you might use crontab (unix). The snapshot controlfile config can set with catalog once, so it's not needed to include in your backup script. Like wise your retention can set as "recovery window of 7 days".
    1. How do I direct the output of this backup to a file?
    ==> inside rman script you might use the following command,
    set log to '/home/oracle/rmanbkp.log';
    2. Is there a way to check for errors within this file to see if the backup went ok?
    ==> you might check in the logfile for ORA- and RMAN- errors.
    3. Would anyone have a unix shell script example of the above?
    I use to schedule this job either by OEM or crontab using rman script file.
    4. How do I make sure that catalog is synched with control file and what is on the file system?
    RMAN will do auto sync with controlfile.
    5. Is it customary to delete archive logs via RMAN script if, say, my policy is to keep it on the file system for 7 days?
    Upon successful backup you may delete the archivelogs or you might decide to keep it for 7 days and then delete by applying "delete obsolete" command.
    Thanks,
    Nirmal

  • How to delete archive logs on the standby database....in 9i

    Hello,
    We are planning to setup a data guard (Maximum performance configuration ) between two Oracle 9i databases on two different servers.
    The archive logs on the primary servers are deleted via a RMAN job bases on a policy , just wondering how I should delete the archive logs that are shipped to the standby.
    Is putting a cron job on the standby to delete archive logs that are say 2 days old the proper approach or is there a built in data guard option that would some how allow archive logs that are no longer needed or are two days old deleted automatically.
    thanks,
    C.

    We are planning to setup a data guard (Maximum performance configuration ) between two Oracle 9i databases on two different servers.
    The archive logs on the primary servers are deleted via a RMAN job bases on a policy , just wondering how I should delete the archive logs that are shipped to the standby.
    Is putting a cron job on the standby to delete archive logs that are say 2 days old the proper approach or is there a built in data guard option that would some how allow archive logs that are no longer needed or are two days old deleted automatically.From 10g there is option to purge on deletion policy when archives were applied. Check this note.
    *Configure RMAN to purge archivelogs after applied on standby [ID 728053.1]*
    Still it is on 9i, So you need to schedule RMAN job or Shell script file to delete archives.
    Before deleting archives
    1) you need to check is all the archives are applied or not
    2) then you can remove all the archives completed before 'sysdate-2';
    RMAN> delete archvielog all completed before 'sysdate-2';
    As per your requirement.

  • Manual delete archived log files

    Because we don't have RMAN in our development server, I need to use manual operation to delete all archived logs. Is my procedure correct and safe?
    SHUTDOWN IMMEDIATE
    STARTUP MOUNT
    ALTER DATABASE NOARCHIVELOG;
    EXITRun OS command to manually delete archived log files:
    rm /oradata/arch/*
    Login to sqlplus
    SHUTDOWN IMMEDIATE
    STARTUP MOUNT
    ALTER DATABASE ARCHIVELOG;
    STARTUP OPENThanks!

    linuxos wrote:
    Oh I suppose RMAN need to be configured somthing before use. I tried it, and find no pre-requisite is required. Thanks!
    If the archives are deleted manually in open mode, how can Oracle match the archived logs' retention policy? Does Oracle store the archived logs in data dictionary?While you can delete archivelogs manually any time you want, you should let rman manage them with appropriate rman commands, preferably in a script that you schedule for regular execution.
    Some of your questions lead me to question if you understand that archivelogs are not actively open by the database, and they technically are not part of the database. They are simply a series of "offline" copies of the online redo logs. They are written to once, when an online redo is being archived, then they just sit there until needed for a recovery.

  • 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

Maybe you are looking for

  • Need 3 monitor support and currently have ATI  X1900XT

    I have a single x1900xt and now have 3 monitors I need to power. Is it possible to combine NVIDIA cards and ATI or do I need to purchase another x1900xt? It is important that this setup work both in windows XP as well as OSX. I am planning on connect

  • 23tm Multiple Monitors Touch Capability

    Me Again!! Having asked on this forum, I bought the two 23tm monitors to expand my Acer 571 laptop into a quasi desktop. I am using a Startech USB dock for the extra video ports (USB3SDOCKHD) which gives me a DVI and an HDMI output, thus providing di

  • Cannot resolve symbol: symbol: method getContentPane()

    ok, here is my code, why am I getting this error?? import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.applet.*; import java.util.*; public class Jsmileface extends Applet implements ActionListener      JButton pressButton =

  • 10.4.6 updaters for IiMac. What's the difference between the choices?

    It seems there are 3 choices for this update: 1) Going through the "software update" pulldown menu on my desktop which is about 100mb 2) On the "apple downloads" page there is one that is 163mb that seems appropriate and 3) a "combo" version that is

  • JSPinner and floating point quirk

    Please test these spinners only with their down arrow buttons to reach minimum value of each. When the number of fraction columns are 5,10 and 12, spinner stops at one step before the real minimum. They don't go to the real minimum. Why could this ha