Thursday, January 14, 2010

RMAN - Parallel Backup of a Very Large Datafile

In earlier versions, the smallest piece of an Oracle Recovery Manager (Oracle RMAN) backup was an entire file. Because Oracle datafiles can be up to 128TB in size, it is not feasible to back up a very large file. In Oracle Database 11g, however, Oracle RMAN can break up a single large file into sections and back up and restore them independently. The SECTION SIZE parameter in the BACKUP command tells Oracle RMAN to create a backup set in which each backup piece contains blocks from one file section, enabling the backup of large files to be parallelized across multiple channels. Restoring a multisection backup in parallel is automatic.

Let’s look at an example, in our Test database TESTDB, the SYSTEM tablespace contains a single 620MB datafile. Although it's not an candidate for a parallel bacup but for this test purpose I will try to use the parallel backup concept in this file itself. Three system backup to tape (SBT) channels are configured, with the parallelism setting for the SBT device set to 3.

RMAN> backup section size 250M tablespace SYSTEM;

Starting backup at 03-NOV-08
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=131 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: Data Protection for Oracle: version 5.5.1.0
allocated channel: ORA_SBT_TAPE_2
channel ORA_SBT_TAPE_2: SID=138 device type=SBT_TAPE
channel ORA_SBT_TAPE_2: Data Protection for Oracle: version 5.5.1.0
allocated channel: ORA_SBT_TAPE_3
channel ORA_SBT_TAPE_3: SID=130 device type=SBT_TAPE
channel ORA_SBT_TAPE_3: Data Protection for Oracle: version 5.5.1.0
channel ORA_SBT_TAPE_1: starting full datafile backup set
channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/oradata/TESTDB/system_01.dbf
backing up blocks 1 through 32000
channel ORA_SBT_TAPE_1: starting piece 1 at 03-NOV-08
channel ORA_SBT_TAPE_2: starting full datafile backup set
channel ORA_SBT_TAPE_2: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/oradata/TESTDB/system_01.dbf
backing up blocks 32001 through 64000
channel ORA_SBT_TAPE_2: starting piece 2 at 03-NOV-08
channel ORA_SBT_TAPE_3: starting full datafile backup set
channel ORA_SBT_TAPE_3: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/oradata/TESTDB/system_01.dbf
backing up blocks 64001 through 80640
channel ORA_SBT_TAPE_3: starting piece 3 at 03-NOV-08
channel ORA_SBT_TAPE_3: finished piece 3 at 03-NOV-08
piece handle=16juouo6_3_1 tag=TAG20081103T101014 comment=API Version 2.0,MMS Version 5.5.1.0
channel ORA_SBT_TAPE_3: backup set complete, elapsed time: 00:00:23
channel ORA_SBT_TAPE_1: finished piece 1 at 03-NOV-08
piece handle=16juouo6_1_1 tag=TAG20081103T101014 comment=API Version 2.0,MMS Version 5.5.1.0
channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:25
channel ORA_SBT_TAPE_2: finished piece 2 at 03-NOV-08
piece handle=16juouo6_2_1 tag=TAG20081103T101014 comment=API Version 2.0,MMS Version 5.5.1.0
channel ORA_SBT_TAPE_2: backup set complete, elapsed time: 00:00:25
Finished backup at 03-NOV-08


The command creates one backup set containing three (250+250+120MB) backup pieces. The command results in an Oracle RMAN backup set in which each backup piece contains a file section, which is a contiguous range of blocks in a datafile.

No comments:

Post a Comment