User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active
 

This article will show how to do a RMAN Incrementally Updated Backup on a 12cR2 database.
This is a backup method which datafiles images copy backup are regularly rolled forward (updated) using RMAN incremental backup.
Having a up to date image copy backups can drastically reduce recovery time in comparison to conventional RMAN backupsets.

Before starting, you will need ...
... Oracle RDBMS 12c installed
    (Check Silent install of Oracle 12c RDBMS)
... Oracle database instance in archive log mode
    (Check Silent database 12c creation with dbca)
... Enabling Change Block Tracking is recommended
    (Check RMAN Best Practice)
... Using FRA (Fast Recovery Area) is recommended

Incrementally Updated Backup (IUB) script

In this article, we will use the following RMAN backup script to do our test.
This script will do all the steps for the Incrementally Updated Backup (IUB):

RUN {
  RECOVER COPY OF DATABASE WITH TAG 'uxoradb_incr_bck' UNTIL TIME 'SYSDATE-7';
  BACKUP AS COMPRESSED BACKUPSET INCREMENTAL LEVEL 1 FOR RECOVER OF COPY WITH TAG 'uxoradb_incr_bck' DATABASE;
  BACKUP AS COMPRESSED BACKUPSET DEVICE TYPE DISK TAG 'uxoradb_incr_bck' ARCHIVELOG ALL DELETE INPUT;
  DELETE NOPROMPT OBSOLETE DEVICE TYPE DISK;
}

More in detail, this script will :
1- Update db datafiles copy backup with previous incremental backup if it is older than 7 days (it will do nothing if no datafiles copy backup).
2- Create a incremental backup (or it will create a full db datafiles copy backup if it does not exist yet)
3- Create archive logs backup
4- Delete obsolete backup

In other word, this will create a full db datafiles copy backup on the first run, then it will create incremental backup on next run and then update (rolling forward) db datafiles copy with it if more than 7 days old.

Running this Incrementally Updated Backup (IUB) script

Setting a test environement

First, we will check that instance is in archivelog mode and create a testing pdb with some sample data :

[oracle]$ sqlplus / as sysdba
-- Switch to root container
SQL> alter session set container = CDB$ROOT ;
    Session altered.

-- Check if archivelog mode is set
SQL> archive log list;
    Database log mode                       Archive log Mode
    Automatic archival                      Enabled
    Archive destination                     USE_DB_RECOVERY_FILE_DEST
    Oldest online log sequence              17
    Next log sequence to archive            19
    Current log sequence                    19

-- Enable block change tracking
SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING;
    Database altered.

-- Check if FRA is set
SQL> show parameter db_recovery_file_dest
    NAME                       TYPE        VALUE
    -------------------------- ----------- ------
    db_recovery_file_dest      string      +FRA
    db_recovery_file_dest_size big integer 20871M

-- Force archiving the current log 
SQL> ALTER SYSTEM ARCHIVE LOG CURRENT ;
    System ARCHIVE altered.

-- Create pluggable database
SQL> CREATE PLUGGABLE DATABASE uxopdb ADMIN USER pdbadm IDENTIFIED BY OraPdbadm_pw0;
    Database altered.

SQL> alter pluggable database uxopdb open ;
    Pluggable database UXOPDB altered.

SQL> alter session set container = UXOPDB ;
    Session altered.

-- Create new tablespace
SQL> create tablespace users ;
    Tablespace created.

-- Deploy hr data sample
SQL> @?/demo/schema/human_resources/hr_main.sql

    specify password for HR as parameter 1:
    Enter value for 1: OraHr_pw0

    specify default tablespeace for HR as parameter 2:
    Enter value for 2: users

    specify temporary tablespace for HR as parameter 3:
    Enter value for 3: temp

    specify log path as parameter 4:
    Enter value for 4: $ORACLE_HOME/demo/schema/log/
    ...
    ...
    ...
    Commit complete.

    PL/SQL procedure successfully completed.

-- Check pdb datafiles
SQL> Alter system checkpoint ;
    System altered.

SQL> select FILE#, STATUS, ENABLED, NAME, CHECKPOINT_CHANGE# from v$datafile;

     FILE# STATUS  ENABLED    NAME                                                                             CHECKPOINT_CHANGE#
    ------ ------- ---------- -------------------------------------------------------------------------------- ------------------
        41 SYSTEM  READ WRITE +DATA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/DATAFILE/system.323.973306819             18521980
        42 ONLINE  READ WRITE +DATA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/DATAFILE/sysaux.321.973306819             18521980
        43 ONLINE  READ WRITE +DATA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/DATAFILE/undotbs1.318.973306819           18521980
        44 ONLINE  READ WRITE +DATA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/DATAFILE/users.320.973307483              18521980

1st run

This first run will not find the datafiles copy, so it will do a copy of all datafiles first and backup archive logs.

[oracle]$ rman target /
RMAN> RUN {
  RECOVER COPY OF DATABASE WITH TAG 'uxoradb_incr_bck' UNTIL TIME 'SYSDATE-7';
  BACKUP AS COMPRESSED BACKUPSET INCREMENTAL LEVEL 1 FOR RECOVER OF COPY WITH TAG 'uxoradb_incr_bck' DATABASE;
  BACKUP AS COMPRESSED BACKUPSET DEVICE TYPE DISK TAG 'uxoradb_incr_bck' ARCHIVELOG ALL DELETE INPUT;
  DELETE NOPROMPT OBSOLETE DEVICE TYPE DISK;
}

    Starting recover at 09/04/2018 16:39:30
    using channel ORA_DISK_1
    using channel ORA_DISK_2
    no copy of datafile 1 found to recover
    no copy of datafile 2 found to recover
    no copy of datafile 3 found to recover
    no copy of datafile 4 found to recover
    no copy of datafile 5 found to recover
    no copy of datafile 6 found to recover
    no copy of datafile 7 found to recover
    no copy of datafile 8 found to recover
    no copy of datafile 9 found to recover
    no copy of datafile 10 found to recover
    no copy of datafile 11 found to recover
    no copy of datafile 12 found to recover
    no copy of datafile 13 found to recover
    no copy of datafile 14 found to recover
    Finished recover at 09/04/2018 16:39:32

    Starting backup at 09/04/2018 16:39:33
    using channel ORA_DISK_1
    using channel ORA_DISK_2
    no parent backup or copy of datafile 3 found
    no parent backup or copy of datafile 1 found
    no parent backup or copy of datafile 5 found
    no parent backup or copy of datafile 7 found
    no parent backup or copy of datafile 4 found
    no parent backup or copy of datafile 6 found
    no parent backup or copy of datafile 2 found
    no parent backup or copy of datafile 13 found
    no parent backup or copy of datafile 10 found
    no parent backup or copy of datafile 9 found
    no parent backup or copy of datafile 8 found
    no parent backup or copy of datafile 14 found
    no parent backup or copy of datafile 12 found
    no parent backup or copy of datafile 11 found
    no parent backup or copy of datafile 34 found
    no parent backup or copy of datafile 35 found
    no parent backup or copy of datafile 33 found
    no parent backup or copy of datafile 36 found
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00013 name=+DATA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/mgmt_tablespace.301.957113995
    channel ORA_DISK_2: starting datafile copy
    input datafile file number=00010 name=+DATA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/undotbs1.307.957094389
    output file name=+FRA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/undotbs1.415.973010375 tag=UXORADB_INCR_BCK RECID=74 STAMP=973010446
    channel ORA_DISK_2: datafile copy complete, elapsed time: 00:01:15
    channel ORA_DISK_2: starting datafile copy
    input datafile file number=00003 name=+DATA/UXOCDBRAC/DATAFILE/sysaux.293.957088843
    output file name=+FRA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/mgmt_tablespace.476.973010375 tag=UXORADB_INCR_BCK RECID=76 STAMP=973010492
    channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:01
    channel ORA_DISK_1: starting datafile copy
    ...
    ...
    ...
    input datafile file number=00007 name=+DATA/UXOCDBRAC/DATAFILE/users.296.957088865
    output file name=+FRA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/mgmt_ecm_depot_ts.427.973010571 tag=UXORADB_INCR_BCK RECID=89 STAMP=973010571
    channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00011 name=+DATA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/users.304.957094407
    output file name=+FRA/UXOCDBRAC/DATAFILE/users.569.973010571 tag=UXORADB_INCR_BCK RECID=90 STAMP=973010571
    channel ORA_DISK_2: datafile copy complete, elapsed time: 00:00:01
    output file name=+FRA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/users.571.973010573 tag=UXORADB_INCR_BCK RECID=91 STAMP=973010572
    channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
    Finished backup at 09/04/2018 16:42:52

    Starting backup at 09/04/2018 16:42:53
    current log archived
    using channel ORA_DISK_1
    using channel ORA_DISK_2
    channel ORA_DISK_1: starting compressed archived log backup set
    channel ORA_DISK_1: specifying archived log(s) in backup set
    input archived log thread=1 sequence=288 RECID=666 STAMP=973010574
    channel ORA_DISK_1: starting piece 1 at 09/04/2018 16:42:55
    channel ORA_DISK_1: finished piece 1 at 09/04/2018 16:43:02
    piece handle=+FRA/UXOCDBRAC/BACKUPSET/2018_04_09/annnf0_uxoradb_incr_bck_0.290.973010575 tag=UXORADB_INCR_BCK comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
    channel ORA_DISK_1: deleting archived log(s)
    archived log file name=+FRA/UXOCDBRAC/ARCHIVELOG/2018_04_09/thread_1_seq_288.289.973010575 RECID=666 STAMP=973010574
    Finished backup at 09/04/2018 16:43:02

    Starting Control File and SPFILE Autobackup at 09/04/2018 16:43:02
    piece handle=+FRA/UXOCDBRAC/AUTOBACKUP/2018_04_09/s_973010582.289.973010583 comment=NONE
    Finished Control File and SPFILE Autobackup at 09/04/2018 16:43:03

    RMAN retention policy will be applied to the command
    RMAN retention policy is set to redundancy 1
    released channel: ORA_DISK_1
    released channel: ORA_DISK_2
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=59 instance=UXOCDB11 device type=DISK
    allocated channel: ORA_DISK_2
    channel ORA_DISK_2: SID=536 instance=UXOCDB11 device type=DISK
    no obsolete backups found

RMAN> list backup summary ;

    List of Backups
    ===============
    Key     TY LV S Device Type Completion Time     #Pieces #Copies Compressed Tag
    ------- -- -- - ----------- ------------------- ------- ------- ---------- ---
    175     B  A  A DISK        09/04/2018 01:16:43 1       1       YES        UXORADB_INCR_BCK
    176     B  F  A DISK        09/04/2018 01:16:46 1       1       NO         TAG20180409T011645

RMAN> list backup ;


    List of Backup Sets
    ===================

    BS Key  Size       Device Type Elapsed Time Completion Time
    ------- ---------- ----------- ------------ -------------------
    175     1.58M      DISK        00:00:00     09/04/2018 01:16:43
            BP Key: 175   Status: AVAILABLE  Compressed: YES  Tag: UXORADB_INCR_BCK
            Piece Name: +FRA/UXOCDBRAC/BACKUPSET/2018_04_09/annnf0_uxoradb_incr_bck_0.427.972955003

      List of Archived Logs in backup set 175
      Thrd Seq     Low SCN    Low Time            Next SCN   Next Time
      ---- ------- ---------- ------------------- ---------- ---------
      1    278     16469143   09/04/2018 01:10:10 16473564   09/04/2018 01:16:42

    BS Key  Type LV Size       Device Type Elapsed Time Completion Time
    ------- ---- -- ---------- ----------- ------------ -------------------
    176     Full    19.13M     DISK        00:00:01     09/04/2018 01:16:46
            BP Key: 176   Status: AVAILABLE  Compressed: NO  Tag: TAG20180409T011645
            Piece Name: +FRA/UXOCDBRAC/AUTOBACKUP/2018_04_09/s_972955005.296.972955005
      SPFILE Included: Modification time: 09/04/2018 00:28:05
      SPFILE db_unique_name: UXOCDBRAC
      Control File Included: Ckp SCN: 16473602     Ckp time: 09/04/2018 01:16:45


RMAN> list copy ;

    specification does not match any control file copy in the repository
    specification does not match any archived log in the repository
    List of Datafile Copies
    =======================

    Key     File S Completion Time     Ckp SCN    Ckp Time            Sparse
    ------- ---- - ------------------- ---------- ------------------- ------
    59      1    A 09/04/2018 01:15:38 16472954   09/04/2018 01:15:22 NO
            Name: +FRA/UXOCDBRAC/DATAFILE/system.564.972954923
            Tag: UXORADB_INCR_BCK

    68      2    A 09/04/2018 01:16:32 4988146    15/03/2018 10:22:51 NO
            Name: +FRA/UXOCDBRAC/5B41D09D321678CAE0531F00A8C01A09/DATAFILE/system.552.972954991
            Tag: UXORADB_INCR_BCK
            Container ID: 2, PDB Name: PDB$SEED

    ...     ...
    ...     ...
    ...     ...

    62      8    A 09/04/2018 01:16:00 16473195   09/04/2018 01:15:48 NO
            Name: +FRA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/system.469.972954951
            Tag: UXORADB_INCR_BCK
            Container ID: 3, PDB Name: OEMPDB

    60      9    A 09/04/2018 01:15:40 16472951   09/04/2018 01:15:22 NO
            Name: +FRA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/sysaux.507.972954923
            Tag: UXORADB_INCR_BCK
            Container ID: 3, PDB Name: OEMPDB
    
    ...     ...
    ...     ...
    ...     ...

    66      31   A 09/04/2018 01:16:26 16473291   09/04/2018 01:16:19 NO
            Name: +FRA/UXOCDBRAC/6955A438A2726835E0531F00A8C0CB50/DATAFILE/undotbs1.364.972954983
            Tag: UXORADB_INCR_BCK
            Container ID: 4, PDB Name: UXOPDB

    70      32   A 09/04/2018 01:16:37 16473348   09/04/2018 01:16:33 NO
            Name: +FRA/UXOCDBRAC/6955A438A2726835E0531F00A8C0CB50/DATAFILE/users.450.972954997
            Tag: UXORADB_INCR_BCK
            Container ID: 4, PDB Name: UXOPDB

2nd run

From the second run, it will do an incremental backup and an archive logs backup. The datafiles copy backup will not be updated yet.

[oracle]$ rman target /
RMAN> RUN {
  RECOVER COPY OF DATABASE WITH TAG 'uxoradb_incr_bck' UNTIL TIME 'SYSDATE-7';
  BACKUP AS COMPRESSED BACKUPSET INCREMENTAL LEVEL 1 FOR RECOVER OF COPY WITH TAG 'uxoradb_incr_bck' DATABASE;
  BACKUP AS COMPRESSED BACKUPSET DEVICE TYPE DISK TAG 'uxoradb_incr_bck' ARCHIVELOG ALL NOT BACKED UP DELETE INPUT;
  DELETE NOPROMPT OBSOLETE DEVICE TYPE DISK;
}

    Starting recover at 09/04/2018 01:51:41
    using channel ORA_DISK_1
    using channel ORA_DISK_2
    no copy of datafile 1 found to recover
    no copy of datafile 2 found to recover
    no copy of datafile 3 found to recover
    no copy of datafile 4 found to recover
    no copy of datafile 5 found to recover
    no copy of datafile 6 found to recover
    no copy of datafile 7 found to recover
    no copy of datafile 8 found to recover
    no copy of datafile 9 found to recover
    no copy of datafile 10 found to recover
    no copy of datafile 11 found to recover
    no copy of datafile 12 found to recover
    no copy of datafile 13 found to recover
    no copy of datafile 14 found to recover
    Finished recover at 09/04/2018 01:51:42

    Starting backup at 09/04/2018 01:51:43
    using channel ORA_DISK_1
    using channel ORA_DISK_2
    channel ORA_DISK_1: starting compressed incremental level 1 datafile backup set
    channel ORA_DISK_1: specifying datafile(s) in backup set
    input datafile file number=00013 name=+DATA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/mgmt_tablespace.301.957113995
    input datafile file number=00012 name=+DATA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/mgmt_ecm_depot_ts.305.957113993
    input datafile file number=00011 name=+DATA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/users.304.957094407
    channel ORA_DISK_1: starting piece 1 at 09/04/2018 01:51:45
    channel ORA_DISK_2: starting compressed incremental level 1 datafile backup set
    channel ORA_DISK_2: specifying datafile(s) in backup set
    input datafile file number=00010 name=+DATA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/undotbs1.307.957094389
    input datafile file number=00009 name=+DATA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/sysaux.306.957094389
    input datafile file number=00008 name=+DATA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/system.299.957094389
    input datafile file number=00014 name=+DATA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/mgmt_ad4j_ts.300.957113995
    channel ORA_DISK_2: starting piece 1 at 09/04/2018 01:51:45
    channel ORA_DISK_1: finished piece 1 at 09/04/2018 01:51:48
    piece handle=+FRA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/BACKUPSET/2018_04_09/nnndn1_uxoradb_incr_bck_0.547.972957105 tag=UXORADB_INCR_BCK comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
    channel ORA_DISK_1: starting compressed incremental level 1 datafile backup set
    channel ORA_DISK_1: specifying datafile(s) in backup set
    input datafile file number=00003 name=+DATA/UXOCDBRAC/DATAFILE/sysaux.293.957088843
    input datafile file number=00005 name=+DATA/UXOCDBRAC/DATAFILE/undotbs1.289.957088845
    channel ORA_DISK_1: starting piece 1 at 09/04/2018 01:51:48
    channel ORA_DISK_2: finished piece 1 at 09/04/2018 01:51:48
    piece handle=+FRA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/BACKUPSET/2018_04_09/nnndn1_uxoradb_incr_bck_0.476.972957107 tag=UXORADB_INCR_BCK comment=NONE
    channel ORA_DISK_2: backup set complete, elapsed time: 00:00:03
    channel ORA_DISK_2: starting compressed incremental level 1 datafile backup set
    channel ORA_DISK_2: specifying datafile(s) in backup set
    input datafile file number=00001 name=+DATA/UXOCDBRAC/DATAFILE/system.286.957088835
    input datafile file number=00007 name=+DATA/UXOCDBRAC/DATAFILE/users.296.957088865
    channel ORA_DISK_2: starting piece 1 at 09/04/2018 01:51:48
    channel ORA_DISK_1: finished piece 1 at 09/04/2018 01:51:49
    piece handle=+FRA/UXOCDBRAC/BACKUPSET/2018_04_09/nnndn1_uxoradb_incr_bck_0.415.972957109 tag=UXORADB_INCR_BCK comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
    channel ORA_DISK_1: starting compressed incremental level 1 datafile backup set
    channel ORA_DISK_1: specifying datafile(s) in backup set
    input datafile file number=00031 name=+DATA/UXOCDBRAC/6955A438A2726835E0531F00A8C0CB50/DATAFILE/undotbs1.321.972953899
    input datafile file number=00029 name=+DATA/UXOCDBRAC/6955A438A2726835E0531F00A8C0CB50/DATAFILE/system.309.972953899
    channel ORA_DISK_1: starting piece 1 at 09/04/2018 01:51:49
    channel ORA_DISK_2: finished piece 1 at 09/04/2018 01:51:49
    piece handle=+FRA/UXOCDBRAC/BACKUPSET/2018_04_09/nnndn1_uxoradb_incr_bck_0.563.972957109 tag=UXORADB_INCR_BCK comment=NONE
    channel ORA_DISK_2: backup set complete, elapsed time: 00:00:01
    channel ORA_DISK_2: starting compressed incremental level 1 datafile backup set
    channel ORA_DISK_2: specifying datafile(s) in backup set
    input datafile file number=00030 name=+DATA/UXOCDBRAC/6955A438A2726835E0531F00A8C0CB50/DATAFILE/sysaux.319.972953899
    input datafile file number=00032 name=+DATA/UXOCDBRAC/6955A438A2726835E0531F00A8C0CB50/DATAFILE/users.318.972953971
    channel ORA_DISK_2: starting piece 1 at 09/04/2018 01:51:50
    channel ORA_DISK_1: finished piece 1 at 09/04/2018 01:51:51
    piece handle=+FRA/UXOCDBRAC/6955A438A2726835E0531F00A8C0CB50/BACKUPSET/2018_04_09/nnndn1_uxoradb_incr_bck_0.314.972957111 tag=UXORADB_INCR_BCK comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
    channel ORA_DISK_1: starting compressed incremental level 1 datafile backup set
    channel ORA_DISK_1: specifying datafile(s) in backup set
    input datafile file number=00006 name=+DATA/UXOCDBRAC/5B41D09D321678CAE0531F00A8C01A09/DATAFILE/undotbs1.294.957088847
    skipping datafile 00006 because it has not changed
    input datafile file number=00002 name=+DATA/UXOCDBRAC/5B41D09D321678CAE0531F00A8C01A09/DATAFILE/system.297.957088837
    skipping datafile 00002 because it has not changed
    channel ORA_DISK_1: backup cancelled because all files were skipped
    channel ORA_DISK_1: starting compressed incremental level 1 datafile backup set
    channel ORA_DISK_1: specifying datafile(s) in backup set
    input datafile file number=00004 name=+DATA/UXOCDBRAC/5B41D09D321678CAE0531F00A8C01A09/DATAFILE/sysaux.291.957088843
    skipping datafile 00004 because it has not changed
    channel ORA_DISK_1: backup cancelled because all files were skipped
    channel ORA_DISK_2: finished piece 1 at 09/04/2018 01:51:51
    piece handle=+FRA/UXOCDBRAC/6955A438A2726835E0531F00A8C0CB50/BACKUPSET/2018_04_09/nnndn1_uxoradb_incr_bck_0.562.972957111 tag=UXORADB_INCR_BCK comment=NONE
    channel ORA_DISK_2: backup set complete, elapsed time: 00:00:01
    Finished backup at 09/04/2018 01:51:51

    Starting backup at 09/04/2018 01:51:52
    current log archived
    using channel ORA_DISK_1
    using channel ORA_DISK_2
    channel ORA_DISK_1: starting compressed archived log backup set
    channel ORA_DISK_1: specifying archived log(s) in backup set
    input archived log thread=1 sequence=282 RECID=654 STAMP=972957113
    channel ORA_DISK_1: starting piece 1 at 09/04/2018 01:51:53
    channel ORA_DISK_1: finished piece 1 at 09/04/2018 01:51:54
    piece handle=+FRA/UXOCDBRAC/BACKUPSET/2018_04_09/annnf0_uxoradb_incr_bck_0.287.972957113 tag=UXORADB_INCR_BCK comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
    channel ORA_DISK_1: deleting archived log(s)
    archived log file name=+FRA/UXOCDBRAC/ARCHIVELOG/2018_04_09/thread_1_seq_282.494.972957113 RECID=654 STAMP=972957113
    Finished backup at 09/04/2018 01:51:54

    Starting Control File and SPFILE Autobackup at 09/04/2018 01:51:54
    piece handle=+FRA/UXOCDBRAC/AUTOBACKUP/2018_04_09/s_972957115.494.972957115 comment=NONE
    Finished Control File and SPFILE Autobackup at 09/04/2018 01:51:56

    RMAN retention policy will be applied to the command
    RMAN retention policy is set to redundancy 1
    released channel: ORA_DISK_1
    released channel: ORA_DISK_2
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=80 instance=UXOCDB11 device type=DISK
    allocated channel: ORA_DISK_2
    channel ORA_DISK_2: SID=62 instance=UXOCDB11 device type=DISK
    no obsolete backups found


RMAN> list backup summary ;

    List of Backups
    ===============
    Key     TY LV S Device Type Completion Time     #Pieces #Copies Compressed Tag
    ------- -- -- - ----------- ------------------- ------- ------- ---------- ---
    175     B  A  A DISK        09/04/2018 01:16:43 1       1       YES        UXORADB_INCR_BCK
    176     B  F  A DISK        09/04/2018 01:16:46 1       1       NO         TAG20180409T011645
    177     B  1  A DISK        09/04/2018 01:50:50 1       1       YES        UXORADB_INCR_BCK
    178     B  1  A DISK        09/04/2018 01:50:50 1       1       YES        UXORADB_INCR_BCK
    ...
    ...
    186     B  A  A DISK        09/04/2018 01:51:50 1       1       YES        UXORADB_INCR_BCK
    187     B  A  A DISK        09/04/2018 01:51:53 1       1       YES        UXORADB_INCR_BCK
    188     B  F  A DISK        09/04/2018 01:51:55 1       1       NO         TAG20180409T015155

After 7 days

After 7 days, It will update db datafiles copy backup with previous incremental backups on the next run.
then it will do an incremental backup and an archive logs backup.

[oracle]$ rman target /
# Complete
RMAN> RUN {
    RECOVER COPY OF DATABASE WITH TAG 'uxoradb_incr_bck' UNTIL TIME 'SYSDATE-7';
    BACKUP AS COMPRESSED BACKUPSET INCREMENTAL LEVEL 1 FOR RECOVER OF COPY WITH TAG 'uxoradb_incr_bck' DATABASE;
    BACKUP AS COMPRESSED BACKUPSET DEVICE TYPE DISK TAG 'uxoradb_incr_bck' ARCHIVELOG ALL DELETE INPUT;
    DELETE NOPROMPT OBSOLETE DEVICE TYPE DISK;
}

    Starting recover at 18/08/2018 20:05:26
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=51 instance=UXOCDB11 device type=DISK
    allocated channel: ORA_DISK_2
    channel ORA_DISK_2: SID=522 instance=UXOCDB11 device type=DISK
    no copy of datafile 2 found to recover
    no copy of datafile 4 found to recover
    no copy of datafile 6 found to recover
    channel ORA_DISK_1: starting incremental datafile backup set restore
    channel ORA_DISK_1: specifying datafile copies to recover
    recovering datafile copy file number=00011 name=+FRA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/users.546.984408831
    recovering datafile copy file number=00012 name=+FRA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/mgmt_ecm_depot_ts.304.984408829
    recovering datafile copy file number=00013 name=+FRA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/mgmt_tablespace.476.984408665
    channel ORA_DISK_1: reading from backup piece +FRA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/BACKUPSET/2018_08_17/nnndn1_uxoradb_incr_bck_0.512.984413099
    channel ORA_DISK_2: starting incremental datafile backup set restore
    channel ORA_DISK_2: specifying datafile copies to recover
    recovering datafile copy file number=00008 name=+FRA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/system.480.984408781
    recovering datafile copy file number=00009 name=+FRA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/sysaux.531.984408755
    recovering datafile copy file number=00010 name=+FRA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/undotbs1.567.984408665
    recovering datafile copy file number=00014 name=+FRA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/mgmt_ad4j_ts.525.984408827
    channel ORA_DISK_2: reading from backup piece +FRA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/BACKUPSET/2018_08_17/nnndn1_uxoradb_incr_bck_0.569.984413099
    channel ORA_DISK_1: piece handle=+FRA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/BACKUPSET/2018_08_17/nnndn1_uxoradb_incr_bck_0.512.984413099 tag=UXORADB_INCR_BCK
    channel ORA_DISK_1: restored backup piece 1
    channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
    ...
    ...
    ...
    channel ORA_DISK_1: starting incremental datafile backup set restore
    channel ORA_DISK_1: specifying datafile copies to recover
    recovering datafile copy file number=00042 name=+FRA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/DATAFILE/sysaux.296.984408797
    recovering datafile copy file number=00044 name=+FRA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/DATAFILE/users.495.984408829
    channel ORA_DISK_1: reading from backup piece +FRA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/BACKUPSET/2018_08_17/nnndn1_uxoradb_incr_bck_0.263.984419291
    channel ORA_DISK_2: piece handle=+FRA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/BACKUPSET/2018_08_17/nnndn1_uxoradb_incr_bck_0.509.984419289 tag=UXORADB_INCR_BCK
    channel ORA_DISK_2: restored backup piece 1
    channel ORA_DISK_2: restore complete, elapsed time: 00:00:04
    channel ORA_DISK_1: piece handle=+FRA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/BACKUPSET/2018_08_17/nnndn1_uxoradb_incr_bck_0.263.984419291 tag=UXORADB_INCR_BCK
    channel ORA_DISK_1: restored backup piece 1
    channel ORA_DISK_1: restore complete, elapsed time: 00:00:08
    Finished recover at 18/08/2018 20:05:50

    Starting backup at 18/08/2018 20:05:52
    using channel ORA_DISK_1
    using channel ORA_DISK_2
    channel ORA_DISK_1: starting compressed incremental level 1 datafile backup set
    channel ORA_DISK_1: specifying datafile(s) in backup set
    input datafile file number=00013 name=+DATA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/mgmt_tablespace.301.957113995
    input datafile file number=00012 name=+DATA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/mgmt_ecm_depot_ts.305.957113993
    input datafile file number=00011 name=+DATA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/users.304.957094407
    channel ORA_DISK_1: starting piece 1 at 18/08/2018 20:05:54
    channel ORA_DISK_2: starting compressed incremental level 1 datafile backup set
    channel ORA_DISK_2: specifying datafile(s) in backup set
    input datafile file number=00010 name=+DATA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/undotbs1.307.957094389
    input datafile file number=00009 name=+DATA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/sysaux.306.957094389
    input datafile file number=00008 name=+DATA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/system.299.957094389
    input datafile file number=00014 name=+DATA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/DATAFILE/mgmt_ad4j_ts.300.957113995
    channel ORA_DISK_2: starting piece 1 at 18/08/2018 20:05:55
    channel ORA_DISK_1: finished piece 1 at 18/08/2018 20:05:58
    piece handle=+FRA/UXOCDBRAC/5B431C857C2E1771E0531F00A8C0E26C/BACKUPSET/2018_08_18/nnndn1_uxoradb_incr_bck_0.509.984513957 tag=UXORADB_INCR_BCK comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
    ...
    ...
    ...
    input datafile file number=00002 name=+DATA/UXOCDBRAC/5B41D09D321678CAE0531F00A8C01A09/DATAFILE/system.297.957088837
    skipping datafile 00002 because it has not changed
    channel ORA_DISK_2: backup cancelled because all files were skipped
    channel ORA_DISK_2: starting compressed incremental level 1 datafile backup set
    channel ORA_DISK_2: specifying datafile(s) in backup set
    input datafile file number=00004 name=+DATA/UXOCDBRAC/5B41D09D321678CAE0531F00A8C01A09/DATAFILE/sysaux.291.957088843
    skipping datafile 00004 because it has not changed
    channel ORA_DISK_2: backup cancelled because all files were skipped
    channel ORA_DISK_1: finished piece 1 at 18/08/2018 20:06:26
    piece handle=+FRA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/BACKUPSET/2018_08_18/nnndn1_uxoradb_incr_bck_0.553.984513983 tag=UXORADB_INCR_BCK comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
    Finished backup at 18/08/2018 20:06:26

    Starting backup at 18/08/2018 20:06:28
    current log archived
    using channel ORA_DISK_1
    using channel ORA_DISK_2
    channel ORA_DISK_1: starting compressed archived log backup set
    channel ORA_DISK_1: specifying archived log(s) in backup set
    input archived log thread=1 sequence=89 RECID=856 STAMP=984432157
    input archived log thread=1 sequence=90 RECID=857 STAMP=984434828
    input archived log thread=1 sequence=91 RECID=858 STAMP=984435077
    input archived log thread=1 sequence=92 RECID=859 STAMP=984438668
    input archived log thread=1 sequence=93 RECID=860 STAMP=984442104
    channel ORA_DISK_1: starting piece 1 at 18/08/2018 20:06:30
    ...
    ...
    ...
    piece handle=+FRA/UXOCDBRAC/BACKUPSET/2018_08_18/annnf0_uxoradb_incr_bck_0.364.984513991 tag=UXORADB_INCR_BCK comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
    channel ORA_DISK_1: deleting archived log(s)
    archived log file name=+FRA/UXOCDBRAC/ARCHIVELOG/2018_08_17/thread_1_seq_89.551.984432157 RECID=856 STAMP=984432157
    archived log file name=+FRA/UXOCDBRAC/ARCHIVELOG/2018_08_17/thread_1_seq_90.361.984434827 RECID=857 STAMP=984434828
    archived log file name=+FRA/UXOCDBRAC/ARCHIVELOG/2018_08_17/thread_1_seq_91.496.984435077 RECID=858 STAMP=984435077
    archived log file name=+FRA/UXOCDBRAC/ARCHIVELOG/2018_08_17/thread_1_seq_92.413.984438669 RECID=859 STAMP=984438668
    archived log file name=+FRA/UXOCDBRAC/ARCHIVELOG/2018_08_18/thread_1_seq_93.534.984442103 RECID=860 STAMP=984442104
    Finished backup at 18/08/2018 20:07:16

    Starting Control File and SPFILE Autobackup at 18/08/2018 20:07:16
    piece handle=+FRA/UXOCDBRAC/AUTOBACKUP/2018_08_18/s_984514036.534.984514037 comment=NONE
    Finished Control File and SPFILE Autobackup at 18/08/2018 20:07:17

    RMAN retention policy will be applied to the command
    RMAN retention policy is set to redundancy 1
    released channel: ORA_DISK_1
    released channel: ORA_DISK_2
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=51 instance=UXOCDB11 device type=DISK
    allocated channel: ORA_DISK_2
    channel ORA_DISK_2: SID=522 instance=UXOCDB11 device type=DISK
    no obsolete backups found

Full recovery from Image Copies

[oracle]$ rman target /
# Complete
RMAN> RUN {
   SHUTDOWN IMMEDIATE;
   STARTUP MOUNT;
   RESTORE DATABASE;
   RECOVER DATABASE;
   ALTER DATABASE OPEN;
}

# Incomplete - Point In Time Recovery (PITR)
RMAN> RUN { 
   SHUTDOWN IMMEDIATE;
   STARTUP MOUNT;
   SET UNTIL TIME "TO_DATE('15-NOV-2004 00:09:00','DD-MON-YYYY HH24:MI:SS')";
   #SET UNTIL SCN 1000;       # alternatively, you can specify SCN
   #SET UNTIL SEQUENCE 9923;  # alternatively, you can specify log sequence number
   RESTORE DATABASE;
   RECOVER DATABASE;
   ALTER DATABASE OPEN RESETLOGS;
}

# Switch whole database to image copy backups.
RUN {
  SHUTDOWN IMMEDIATE;
  STARTUP MOUNT;
  SWITCH DATABASE TO COPY; # No restore, just switch
  RECOVER DATABASE;
  ALTER DATABASE OPEN;
}
# To restore and switch back to original location
# Check "Switch to Copy" recovery datafile example 

Datafile recovery from Image Copies

In this example, we will restore a corrupted datafile on the pluggable database uxopdb. We have deleted the db datafile 44 to simulate this issue.
Here is two ways to restore a datafile:

Classic recovery

This is the way to go if it's a small datafile or if longer downtime is not an issue.

[oracle]$ rman target /
RMAN> VALIDATE PLUGGABLE DATABASE UXOPDB ;

    Starting validate at 14/04/2018 13:29:10
    using channel ORA_DISK_1
    using channel ORA_DISK_2
    RMAN-06169: could not read file header for datafile 44 error reason 4
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of validate command at 04/14/2018 13:29:11
    RMAN-06056: could not access datafile 44

RMAN> restore datafile 44 ;

    Starting restore at 14/04/2018 13:29:46
    using channel ORA_DISK_1
    using channel ORA_DISK_2

    channel ORA_DISK_1: restoring datafile 00044
    input datafile copy RECID=211 STAMP=973308980 file name=+FRA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/DATAFILE/users.475.973308981
    destination for restore of datafile 00044: +DATA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/DATAFILE/users.320.973424201
    channel ORA_DISK_1: copied datafile copy of datafile 00044
    output file name=+DATA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/DATAFILE/users.320.973430987 RECID=0 STAMP=0
    Finished restore at 14/04/2018 13:29:48

RMAN> sql 'uxopdb' 'alter database datafile 44 offline';

    sql statement: alter database datafile 44 offline

RMAN> recover datafile 44 ;

    Starting recover at 14/04/2018 13:29:57
    using channel ORA_DISK_1
    using channel ORA_DISK_2
    channel ORA_DISK_1: starting incremental datafile backup set restore
    channel ORA_DISK_1: specifying datafile(s) to restore from backup set
    destination for restore of datafile 00044: +DATA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/DATAFILE/users.320.973430987
    channel ORA_DISK_1: reading from backup piece +FRA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/BACKUPSET/2018_04_13/nnndn1_uxoradb_incr_bck_0.547.973311241
    channel ORA_DISK_1: piece handle=+FRA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/BACKUPSET/2018_04_13/nnndn1_uxoradb_incr_bck_0.547.973311241 tag=UXORADB_INCR_BCK
    channel ORA_DISK_1: restored backup piece 1
    channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
    channel ORA_DISK_1: starting incremental datafile backup set restore
    channel ORA_DISK_1: specifying datafile(s) to restore from backup set
    destination for restore of datafile 00044: +DATA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/DATAFILE/users.320.973430987
    channel ORA_DISK_1: reading from backup piece +FRA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/BACKUPSET/2018_04_14/nnndn1_uxoradb_incr_bck_0.571.973426687
    channel ORA_DISK_1: piece handle=+FRA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/BACKUPSET/2018_04_14/nnndn1_uxoradb_incr_bck_0.571.973426687 tag=UXORADB_INCR_BCK
    channel ORA_DISK_1: restored backup piece 1
    channel ORA_DISK_1: restore complete, elapsed time: 00:00:08

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

RMAN> sql 'uxopdb' 'alter database datafile 44 online' ;

    sql statement: alter database datafile 44 online

RMAN> VALIDATE PLUGGABLE DATABASE UXOPDB ;
    ...
    ...
    Finished validate at 14/04/2018 13:42:42

"Switch to Copy" recovery

In the other hand, if you have a large datafile to restore and short downtime constraint, then you may want to check this solution.

[oracle]$ rman target /
RMAN> VALIDATE DATAFILE 44 ;

    Starting validate at 19/08/2018 16:11:45
    using channel ORA_DISK_1
    using channel ORA_DISK_2
    RMAN-06169: could not read file header for datafile 44 error reason 4
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of validate command at 08/19/2018 16:11:46
    RMAN-06056: could not access datafile 44

# This sql command may not work if in wrong container
RMAN> alter database datafile 44 offline;

    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of sql statement command at 08/20/2018 14:34:11
    ORA-01516: nonexistent log file, data file, or temporary file "44" in the current container

# If wrong container error, use sql keyword with the right container as follow
RMAN> sql 'uxopdb' 'alter database datafile 44 offline';

    sql statement: alter database datafile 44 offline

# Check datafile status
RMAN> select FILE#, STATUS, ENABLED, CHECKPOINT_CHANGE#, NAME from v$datafile where FILE# = 44 ;

         FILE# STATUS  ENABLED    CHECKPOINT_CHANGE# NAME
    ---------- ------- ---------- ------------------ ------------------------------------------------------------------------------
            44 RECOVER READ WRITE 22388149           +DATA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/DATAFILE/users.320.984588881

# Switch to datafile copy in +FRA
RMAN> switch datafile 44 to copy;

    datafile 44 switched to datafile copy "+FRA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/DATAFILE/users.495.984408829"

# Perform a recovery 
RMAN> recover datafile 44 ;

    Starting recover at 19/08/2018 16:13:41
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=492 instance=UXOCDB11 device type=DISK
    allocated channel: ORA_DISK_2
    channel ORA_DISK_2: SID=483 instance=UXOCDB11 device type=DISK
    channel ORA_DISK_1: starting incremental datafile backup set restore
    channel ORA_DISK_1: specifying datafile(s) to restore from backup set
    destination for restore of datafile 00044: +FRA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/DATAFILE/users.495.984408829
    channel ORA_DISK_1: reading from backup piece +FRA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/BACKUPSET/2018_08_18/nnndn1_uxoradb_incr_bck_0.553.984513983
    channel ORA_DISK_1: piece handle=+FRA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/BACKUPSET/2018_08_18/nnndn1_uxoradb_incr_bck_0.553.984513983 tag=UXORADB_INCR_BCK
    channel ORA_DISK_1: restored backup piece 1
    channel ORA_DISK_1: restore complete, elapsed time: 00:00:01

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

    Finished recover at 19/08/2018 16:13:48

# Set datafile back to online
RMAN> sql 'uxopdb' 'alter database datafile 44 online' ;

    sql statement: alter database datafile 44 online

RMAN> VALIDATE datafile 44 ;

    Starting validate at 19/08/2018 16:47:26
    using channel ORA_DISK_1
    using channel ORA_DISK_2
    channel ORA_DISK_1: starting validation of datafile
    channel ORA_DISK_1: specifying datafile(s) for validation
    input datafile file number=00044 name=+FRA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/DATAFILE/users.495.984408829
    channel ORA_DISK_1: validation complete, elapsed time: 00:00:03
    List of Datafiles
    =================
    File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
    ---- ------ -------------- ------------ --------------- ----------
    44   OK     0              483          12800           20900811
      File Name: +FRA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/DATAFILE/users.495.984408829
      Block Type Blocks Failing Blocks Processed
      ---------- -------------- ----------------
      Data       0              11882
      Index      0              19
      Other      0              416

    Finished validate at 19/08/2018 16:47:30

At this state, database is now usable but performance may be degraded if +FRA storage is slower than +DATA.
Now we can restore the datafile 44 in its original storage +DATA as follow:

[oracle]$ rman target /
# Perform a backup of the current datafile 44 into +DATA
RMAN> backup section size 2G as copy datafile 44 format ='+DATA' tag 'clonefile44';

    Starting backup at 19/08/2018 16:54:40
    using channel ORA_DISK_1
    using channel ORA_DISK_2
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00044 name=+FRA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/DATAFILE/users.495.984408829
    output file name=+DATA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/DATAFILE/users.320.984588881 tag=CLONEFILE44 RECID=329 STAMP=984588882
    channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
    Finished backup at 19/08/2018 16:54:44

    Starting Control File and SPFILE Autobackup at 19/08/2018 16:54:44
    piece handle=+FRA/UXOCDBRAC/AUTOBACKUP/2018_08_19/s_984588884.489.984588885 comment=NONE
    Finished Control File and SPFILE Autobackup at 19/08/2018 16:54:45

# Swith back to new copy
RMAN> sql 'uxopdb' 'alter database datafile 44 offline';

    sql statement: alter database datafile 44 offline

RMAN> switch datafile 44 to copy ;

    datafile 44 switched to datafile copy "+DATA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/DATAFILE/users.320.984588881"

RMAN> recover datafile 44;

    Starting recover at 19/08/2018 16:56:57
    using channel ORA_DISK_1
    using channel ORA_DISK_2

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

    Finished recover at 19/08/2018 16:56:59

RMAN> sql 'uxopdb' 'alter database datafile 44 online' ;

    sql statement: alter database datafile 44 online


Now one last thing, it seems the datafile copy has lost its tag during this process and it is required for the IUB otherwise it will create another copy.
So we gonna set back the uxoradb_incr_bck tag:

[oracle]$ rman target /
# Check datafile copy without tag
RMAN> list datafilecopy like '%9DD%user%' ;

    List of Datafile Copies
    =======================

    Key     File S Completion Time     Ckp SCN    Ckp Time            Sparse
    ------- ---- - ------------------- ---------- ------------------- ------
    330     44   A 19/08/2018 16:56:30 21939198   19/08/2018 16:54:41 NO
            Name: +FRA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/DATAFILE/users.495.984408829

# recatalog file with tag
RMAN> catalog datafilecopy '+FRA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/DATAFILE/users.495.984408829' level 0 TAG 'uxoradb_incr_bck' ;

    cataloged datafile copy
    datafile copy file name=+FRA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/DATAFILE/users.495.984408829 RECID=331 STAMP=984589585

# ReCheck datafile copy 
RMAN> list datafilecopy like '%9DD%user%' ;

    List of Datafile Copies
    =======================

    Key     File S Completion Time     Ckp SCN    Ckp Time            Sparse
    ------- ---- - ------------------- ---------- ------------------- ------
    331     44   A 19/08/2018 17:06:25 21939198   19/08/2018 16:54:41 NO
            Name: +FRA/UXOCDBRAC/69B164E6597C0D15E0531F00A8C069DD/DATAFILE/users.495.984408829
            Tag: UXORADB_INCR_BCK

Hope This Helps,
Michel.

 

Reference
Making and Updating RMAN Incremental Backups (docs.oracle.com)
Incrementally Updated Backups : Rolling Forward Image Copies Using RMAN (oracle-base.com)
Oracle 12c and RMAN switch datafile to copy, is it really so easy? (blog.dbi-services.com)

Enjoyed this article? Please like it or share it.

Add comment

Please connect with one of social login below (or fill up name and email)

     


Security code
Refresh