Incremental Updated Backup

  • From: wissem elkhlifi <wissem@xxxxxxxxxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Wed, 6 Jul 2011 09:39:56 +0200

    Hi,

    About RMAN incremental updated backup.I am comparing between the use of
“until time” clause and not including this clause "until time" in my
backups.
     With our backup strategy, we need to recover the database to any time
within the past 31 days and we weekly move the backups to tape.
    From the output below, I have the coclusion to use UNTIL TIME clause if
we want to recover the database to any point in time
    within the recovery window of 31 days. But, we have backup tapes! What
do you think?

    1- First Backup Script

    CONNECT TARGET /

    CROSSCHECK BACKUP;
    CROSSCHECK ARCHIVELOG ALL;

    # Incrementally updated backup.
    RECOVER COPY OF DATABASE WITH TAG 'LVL0_MERGE_INCR' UNTIL TIME
'SYSDATE-31';
    BACKUP CHECK LOGICAL INCREMENTAL LEVEL 1 CUMULATIVE COPIES=1 FOR RECOVER
OF COPY WITH TAG 'LVL0_MERGE_INCR' DATABASE;

    # Switch current logfile to archive
    sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';

    # Backup archivelogs
    BACKUP CHECK LOGICAL AS COMPRESSED BACKUPSET FILESPERSET 10 ARCHIVELOG
ALL DELETE INPUT;

    # delete obsolete backups
    CROSSCHECK BACKUP;
    DELETE NOPROMPT OBSOLETE;
    DELETE NOPROMPT EXPIRED BACKUP;

    exit;

    2- Second backup script:

    CONNECT TARGET /

    CROSSCHECK BACKUP;
    CROSSCHECK ARCHIVELOG ALL;

    # Incrementally updated backup.
    RECOVER COPY OF DATABASE WITH TAG 'LVL0_MERGE_INCR';
    BACKUP CHECK LOGICAL INCREMENTAL LEVEL 1 CUMULATIVE COPIES=1 FOR RECOVER
OF COPY WITH TAG 'LVL0_MERGE_INCR' DATABASE;

    # Switch current logfile to archive
    sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';

    # Backup archivelogs
    BACKUP CHECK LOGICAL AS COMPRESSED BACKUPSET FILESPERSET 10 ARCHIVELOG
ALL DELETE INPUT;

    # delete obsolete backups
    CROSSCHECK BACKUP;
    DELETE NOPROMPT OBSOLETE;
    DELETE NOPROMPT EXPIRED BACKUP;

    exit;

    My database is 11gR2.

    RMAN settings are the same for both scenarios and are the following and
my db is in archivelog mode:

    RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

    RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 31 DAYS;


    1- Backup Script number one:

    WITH UNTIL CLAUSE
    RECOVER COPY OF DATABASE WITH TAG ‘LVL0_MERGE_INCR’ UNTIL TIME
‘SYSDATE-31′;

    Now, using RMAN we will try to recover the database to a time in the
past within the 31 days of recovery window.

    RMAN> run{

    2> allocate channel dev1 type disk;

    3> set until time "to_date('2011-28-06:20:55:36',
'yyyy-dd-mm:hh24:mi:ss')";

    4> restore database;

    5> recover database;

    6> }

    allocated channel: dev1

    channel dev1: SID=395 device type=DISK

    executing command: SET until clause

    .... (content truncated)

    media recovery complete, elapsed time: 00:00:01

    Finished recover at 01-JUL-11

    released channel: dev1

    RMAN>


    SQL> alter database open resetlogs;

    Database altered.


    From the output above, you can see we can recover the database to any
point in time within the 31 days of recovery window.

    2- Backup Script number two:

    Without the until time clause

    RECOVER COPY OF DATABASE WITH TAG ‘LVL0_MERGE_INCR’;


    [oracle@wissem backupset]$ rlrman target /

    Recovery Manager: Release 11.2.0.1.0 - Production on Tue Jun 28 23:25:35
2011

    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights
reserved.

    connected to target database: ORAWISS (DBID=3175451436)

    RMAN> run{
    2> set until time "to_date('2011-01-07:21:35:36',
'yyyy-dd-mm:hh24:mi:ss')";
    3> restore database;
    4> recover database;
    5> }

    executing command: SET until clause

    Starting restore at 28-JUN-11
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=395 device type=DISK
    allocated channel: ORA_DISK_2
    channel ORA_DISK_2: SID=10 device type=DISK

    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of restore command at 06/28/2011 23:25:53
    RMAN-06026: some targets not found - aborting restore
    RMAN-06023: no backup or copy of datafile 5 found to restore
    RMAN-06023: no backup or copy of datafile 4 found to restore
    RMAN-06023: no backup or copy of datafile 2 found to restore
    RMAN-06023: no backup or copy of datafile 1 found to restore

    RMAN>

    We have all the backups, we cannot recover within the recovery window of
31 days.
    But, if we will have backups in tape, is it possible to have this error?


    Thank you

Other related posts: