Friday, June 10, 2011

Learn RMAN MaxSetSize and MaxPieceSize by example


RMAN> backup tablespace system maxsetsize 20M;

Starting backup at 10-JUN-11
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 06/10/2011 16:56:46
RMAN-06183: datafile or datafile copy /u01/app/oracle/oradata/prorcl/system01.dbf (file number 1) larger than MAXSETSIZE


RMAN> run {
2> allocate channel ch0 device type disk maxpiecesize 20M format '/tmp/%s_%p_%t';
3> backup tablespace system;
4> }

released channel: ORA_DISK_1
allocated channel: ch0
channel ch0: SID=48 device type=DISK

Starting backup at 10-JUN-11
channel ch0: starting full datafile backup set
channel ch0: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/prorcl/system01.dbf
channel ch0: starting piece 1 at 10-JUN-11
channel ch0: finished piece 1 at 10-JUN-11
piece handle=/tmp/16_1_753469135 tag=TAG20110610T165855 comment=NONE
channel ch0: starting piece 2 at 10-JUN-11
channel ch0: finished piece 2 at 10-JUN-11
piece handle=/tmp/16_2_753469135 tag=TAG20110610T165855 comment=NONE
channel ch0: starting piece 3 at 10-JUN-11
channel ch0: finished piece 3 at 10-JUN-11
piece handle=/tmp/16_3_753469135 tag=TAG20110610T165855 comment=NONE
channel ch0: starting piece 4 at 10-JUN-11
channel ch0: finished piece 4 at 10-JUN-11
piece handle=/tmp/16_4_753469135 tag=TAG20110610T165855 comment=NONE
channel ch0: starting piece 5 at 10-JUN-11
channel ch0: finished piece 5 at 10-JUN-11
piece handle=/tmp/16_5_753469135 tag=TAG20110610T165855 comment=NONE
channel ch0: starting piece 6 at 10-JUN-11
channel ch0: finished piece 6 at 10-JUN-11
piece handle=/tmp/16_6_753469135 tag=TAG20110610T165855 comment=NONE
channel ch0: starting piece 7 at 10-JUN-11
channel ch0: finished piece 7 at 10-JUN-11
piece handle=/tmp/16_7_753469135 tag=TAG20110610T165855 comment=NONE
channel ch0: starting piece 8 at 10-JUN-11
channel ch0: finished piece 8 at 10-JUN-11
piece handle=/tmp/16_8_753469135 tag=TAG20110610T165855 comment=NONE
channel ch0: starting piece 9 at 10-JUN-11
channel ch0: finished piece 9 at 10-JUN-11
piece handle=/tmp/16_9_753469135 tag=TAG20110610T165855 comment=NONE
channel ch0: backup set complete, elapsed time: 00:00:09
channel ch0: starting full datafile backup set
channel ch0: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ch0: starting piece 1 at 10-JUN-11
channel ch0: finished piece 1 at 10-JUN-11
piece handle=/tmp/17_1_753469144 tag=TAG20110610T165855 comment=NONE
channel ch0: backup set complete, elapsed time: 00:00:01
Finished backup at 10-JUN-11
released channel: ch0


RMAN> list backupset 4;

using target database control file instead of recovery catalog

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


BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
4 Full 175.63M DISK 00:00:08 10-JUN-11
List of Datafiles in backup set 4
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 484234 10-JUN-11 /u01/app/oracle/oradata/prorcl/system01.dbf

Backup Set Copy #1 of backup set 4
Device Type Elapsed Time Completion Time Compressed Tag
----------- ------------ --------------- ---------- ---
DISK 00:00:08 10-JUN-11 NO TAG20110610T165855

List of Backup Pieces for backup set 4 Copy #1
BP Key Pc# Status Piece Name
------- --- ----------- ----------
4 1 AVAILABLE /tmp/16_1_753469135
5 2 AVAILABLE /tmp/16_2_753469135
6 3 AVAILABLE /tmp/16_3_753469135
7 4 AVAILABLE /tmp/16_4_753469135
8 5 AVAILABLE /tmp/16_5_753469135
9 6 AVAILABLE /tmp/16_6_753469135
10 7 AVAILABLE /tmp/16_7_753469135
11 8 AVAILABLE /tmp/16_8_753469135
12 9 AVAILABLE /tmp/16_9_753469135

RMAN> exit


Recovery Manager complete.
[oracle@vmxdb01 admin]$ ls -lh /tmp/16*
-rw-r-----. 1 oracle oinstall 20M Jun 10 16:58 /tmp/16_1_753469135
-rw-r-----. 1 oracle oinstall 20M Jun 10 16:58 /tmp/16_2_753469135
-rw-r-----. 1 oracle oinstall 20M Jun 10 16:58 /tmp/16_3_753469135
-rw-r-----. 1 oracle oinstall 20M Jun 10 16:58 /tmp/16_4_753469135
-rw-r-----. 1 oracle oinstall 20M Jun 10 16:58 /tmp/16_5_753469135
-rw-r-----. 1 oracle oinstall 20M Jun 10 16:59 /tmp/16_6_753469135
-rw-r-----. 1 oracle oinstall 20M Jun 10 16:59 /tmp/16_7_753469135
-rw-r-----. 1 oracle oinstall 20M Jun 10 16:59 /tmp/16_8_753469135
-rw-r-----. 1 oracle oinstall 16M Jun 10 16:59 /tmp/16_9_753469135
[oracle@vmxdb01 admin]$