Tuesday, April 29, 2008

Create Multiple Duplex backup by one Backup Command

In RMAN you can issue one backup command and there would be several identical copies of your each backup piece.You can produce up to four identical copies of each backup piece in the backup set on different backup destinations. Image copy is not supported.

There are three ways to multiplex of backup sets with RMAN BACKUP command.

A)Specify a default level of duplexing with CONFIGURE... BACKUP COPIES

Example:
----------
1)RMAN> CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 2;

2)RMAN> BACKUP DATAFILE 3 format '/oradata2/%U','/oradata2/flash_recovery_area/%U';


Starting backup at 30-APR-08
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00003 name=/oradata2/data1/data1/sysaux01.dbf
channel ORA_DISK_1: starting piece 1 at 30-APR-08
channel ORA_DISK_1: finished piece 1 at 30-APR-08 with 2 copies and tag TAG20080430T103732
piece handle=/oradata2/1njf413c_1_1 comment=NONE
piece handle=/oradata2/flash_recovery_area/1njf413c_1_2 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
Finished backup at 30-APR-08

3)LIST BACKUP;
.
.
.
Backup Set Copy #1 of backup set 42
Device Type Elapsed Time Completion Time Compressed Tag
----------- ------------ --------------- ---------- ---
DISK 00:00:34 30-APR-08 NO TAG20080430T103732

List of Backup Pieces for backup set 42 Copy #1
BP Key Pc# Status Piece Name
------- --- ----------- ----------
38 1 AVAILABLE /oradata2/1njf413c_1_1


Backup Set Copy #2 of backup set 42
Device Type Elapsed Time Completion Time Compressed Tag
----------- ------------ --------------- ---------- ---
DISK 00:00:34 30-APR-08 NO TAG20080430T103732

List of Backup Pieces for backup set 42 Copy #2
BP Key Pc# Status Piece Name
------- --- ----------- ----------
39 1 AVAILABLE /oradata2/flash_recovery_area/1njf413c_1_2

.
.
.

B)Use SET BACKUP COPIES in a RUN block
----------------------------------------
This will override the default CONFIGURE...BACKUP COPIES setting but will not override if you provide a COPIES option as part of the backup command.

Example:
-----------
RMAN> run{
2> set backup copies 2;
3> backup datafile 4 format '/oradata2/%U','/oradata2/flash_recovery_area/%U';
4> }


executing command: SET BACKUP COPIES

Starting backup at 30-APR-08
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00004 name=/oradata2/data1/data1/users01.dbf
channel ORA_DISK_1: starting piece 1 at 30-APR-08
channel ORA_DISK_1: finished piece 1 at 30-APR-08 with 2 copies and tag TAG20080430T110518
piece handle=/oradata2/1tjf42ne_1_1 comment=NONE
piece handle=/oradata2/flash_recovery_area/1tjf42ne_1_2 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 30-APR-08


C)Provide a COPIES option to the BACKUP command
-------------------------------------------------------

You can specify up to 4 values for the FORMAT option.
Example:
-----------
RMAN> run{
2> backup copies 3 datafile 3 format '/oradata2/%U', '/export/home/oracle/%U',
3> '/oradata2/flash_recovery_area/%U';
4> }

No comments:

Post a Comment