RMAN Image Copies

There are several ways to create an image copy

Using the FORMAT clause

For example:

BACKUP AS COPY DATABASE FORMAT '/u01/app/oracle/copy/%U';

Using tbe CONFIGURE command

For example:

CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/u01/app/oracle/copy/%U';
BACKUP AS COPY DATABASE;

Using ALLOCATE CHANNEL command

For example:

RUN
{
  ALLOCATE CHANNEL c1 TYPE DISK FORMAT '/u01/app/oracle/copy/%U';
  BACKUP AS COPY DATABASE;
  RELEASE CHANNEL c1;
}

To create an image copy of an entire database use:

RMAN> BACKUP AS COPY DATABASE;

To create an image copy of a specific datafile use:

RMAN> BACKUP AS COPY DATAFILE <file#>

For example:

RMAN> BACKUP AS COPY DATAFILE 4 FORMAT '/u01/app/oracle/copy/users01.dbf';

To list all datafile image copies use:

LIST DATAFILECOPY ALL;

To delete all datafile image copies use:

DELETE DATAFILECOPY ALL;

Each datafile copy has a key which is reported by LIST DATAFILECOPY ALL;

The key is not the same as the data file number - there can be multiple copies of the same data file.

Individual datafile copies can be listed by specifying the key. For example:

RMAN> LIST DATAFILECOPY 26

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

Key     File S Completion Time Ckp SCN    Ckp Time
------- ---- - --------------- ---------- ---------------
26      4    A 15-AUG-15       3325470    15-AUG-15
        Name: /u01/app/oracle/copy/users01.dbf
        Tag: TAG20150815T010526

Individual datafile copies can be deleted by specifying the key. For example:

RMAN> DELETE DATAFILECOPY 26;

Controlfile Image Copies

To list all controlfile copies use

RMAN> LIST COPY OF CONTROLFILE;

For example:

RMAN> LIST COPY OF CONTROLFILE;

List of Control File Copies
===========================

Key     S Completion Time Ckp SCN    Ckp Time
------- - --------------- ---------- ---------------
25      A 15-AUG-15       3324254    15-AUG-15
        Name: /u01/app/oracle/copy/cf_D-TEST_id-2066695660_23qekadv
        Tag: TAG20150815T001910

20      A 14-AUG-15       3322965    14-AUG-15
        Name: /u01/app/oracle/copy/cf_D-TEST_id-2066695660_1tqek8bd
        Tag: TAG20150814T234341

15      A 14-AUG-15       3322589    14-AUG-15
        Name: /u01/app/oracle/copy/cf_D-TEST_id-2066695660_1nqek7j8
        Tag: TAG20150814T232907

To list an individual control file copy use:

RMAN> LIST CONTROLFILECOPY <key>;

For example:

RMAN> LIST CONTROLFILECOPY 20;

List of Control File Copies
===========================

Key     S Completion Time Ckp SCN    Ckp Time
------- - --------------- ---------- ---------------
20      A 14-AUG-15       3322965    14-AUG-15
        Name: /u01/app/oracle/copy/cf_D-TEST_id-2066695660_1tqek8bd
        Tag: TAG20150814T234341

To delete a specific controlfile copy use:

RMAN> DELETE CONTROLFILECOPY <key>;

For example:

RMAN> DELETE CONTROLFILECOPY 20;

Alternatively specify the control file copy name e.g.:

RMAN> DELETE CONTROLFILECOPY '/u01/app/oracle/copy/cf_D-TEST_id-2066695660_1tqek8bd';