After knowing how to change the backup location in different scenarios, let's see a more advance topic about making backup copies in RMAN.
By default, all backup set only keep 1 copy in RMAN, if you want more copies of backup set, you have to duplicate them by different ways.
In this post, we will see 3 different ways to set backup copies.
Global Backup Copies
We configure both database and archivelog to backup 2 copies.
RMAN> configure datafile backup copies for device type disk to 2;
new RMAN configuration parameters:
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 2;
new RMAN configuration parameters are successfully stored
RMAN> configure archivelog backup copies for device type disk to 2;
new RMAN configuration parameters:
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 2;
new RMAN configuration parameters are successfully stored
Next, configure multiple locations of backup channels.
RMAN> configure channel device type disk format '/backup1/ORCLCDB/%U','/backup2/ORCLCDB/%U';
new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/backup1/ORCLCDB/%U', '/backup2/ORCLCDB/%U';
new RMAN configuration parameters are successfully stored
The first path is for copy #1, the second path is for copy #2.
Additionally, we can set the degree of parallelism to 4 to speed up backup process.
RMAN> configure device type disk parallelism 4;
new RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 4 BACKUP TYPE TO BACKUPSET;
new RMAN configuration parameters are successfully stored
Next, we perform a backup to inspect the process.
RMAN> backup database plus archivelog;
Starting backup at 06-JAN-21
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1154 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=1727 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=29 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=577 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=3 RECID=3 STAMP=1059269445
input archived log thread=1 sequence=4 RECID=4 STAMP=1059270134
channel ORA_DISK_1: starting piece 1 at 06-JAN-21
channel ORA_DISK_2: starting archived log backup set
channel ORA_DISK_2: specifying archived log(s) in backup set
input archived log thread=1 sequence=1 RECID=1 STAMP=1045783185
input archived log thread=1 sequence=2 RECID=2 STAMP=1045793980
channel ORA_DISK_2: starting piece 1 at 06-JAN-21
channel ORA_DISK_3: starting archived log backup set
channel ORA_DISK_3: specifying archived log(s) in backup set
input archived log thread=1 sequence=5 RECID=5 STAMP=1061078712
channel ORA_DISK_3: starting piece 1 at 06-JAN-21
channel ORA_DISK_3: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T000514
piece handle=/backup1/ORCLCDB/05vjthlr_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/05vjthlr_1_2 comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:25
channel ORA_DISK_2: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T000514
piece handle=/backup1/ORCLCDB/04vjthlr_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/04vjthlr_1_2 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:45
channel ORA_DISK_1: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T000514
piece handle=/backup1/ORCLCDB/03vjthlq_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/03vjthlq_1_2 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:05
Finished backup at 06-JAN-21
Starting backup at 06-JAN-21
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/ORCLCDB/system01.dbf
channel ORA_DISK_1: starting piece 1 at 06-JAN-21
channel ORA_DISK_2: starting full datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
input datafile file number=00003 name=/u01/app/oracle/oradata/ORCLCDB/sysaux01.dbf
channel ORA_DISK_2: starting piece 1 at 06-JAN-21
channel ORA_DISK_3: starting full datafile backup set
channel ORA_DISK_3: specifying datafile(s) in backup set
input datafile file number=00010 name=/u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/sysaux01.dbf
channel ORA_DISK_3: starting piece 1 at 06-JAN-21
channel ORA_DISK_4: starting full datafile backup set
channel ORA_DISK_4: specifying datafile(s) in backup set
input datafile file number=00006 name=/u01/app/oracle/oradata/ORCLCDB/pdbseed/sysaux01.dbf
channel ORA_DISK_4: starting piece 1 at 06-JAN-21
channel ORA_DISK_3: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T000621
piece handle=/backup1/ORCLCDB/08vjthnu_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/08vjthnu_1_2 comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:25
channel ORA_DISK_3: starting full datafile backup set
channel ORA_DISK_3: specifying datafile(s) in backup set
input datafile file number=00009 name=/u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/system01.dbf
input datafile file number=00012 name=/u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/users01.dbf
channel ORA_DISK_3: starting piece 1 at 06-JAN-21
channel ORA_DISK_4: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T000621
piece handle=/backup1/ORCLCDB/09vjthnu_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/09vjthnu_1_2 comment=NONE
channel ORA_DISK_4: backup set complete, elapsed time: 00:00:26
channel ORA_DISK_4: starting full datafile backup set
channel ORA_DISK_4: specifying datafile(s) in backup set
input datafile file number=00013 name=/u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/example01.dbf
input datafile file number=00011 name=/u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/undotbs01.dbf
channel ORA_DISK_4: starting piece 1 at 06-JAN-21
channel ORA_DISK_2: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T000621
piece handle=/backup1/ORCLCDB/07vjthnu_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/07vjthnu_1_2 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:33
channel ORA_DISK_2: starting full datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
input datafile file number=00005 name=/u01/app/oracle/oradata/ORCLCDB/pdbseed/system01.dbf
channel ORA_DISK_2: starting piece 1 at 06-JAN-21
channel ORA_DISK_3: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T000621
piece handle=/backup1/ORCLCDB/0avjthoo_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0avjthoo_1_2 comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:23
channel ORA_DISK_3: starting full datafile backup set
channel ORA_DISK_3: specifying datafile(s) in backup set
input datafile file number=00004 name=/u01/app/oracle/oradata/ORCLCDB/undotbs01.dbf
channel ORA_DISK_3: starting piece 1 at 06-JAN-21
channel ORA_DISK_4: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T000621
piece handle=/backup1/ORCLCDB/0bvjthoo_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0bvjthoo_1_2 comment=NONE
channel ORA_DISK_4: backup set complete, elapsed time: 00:00:24
channel ORA_DISK_4: starting full datafile backup set
channel ORA_DISK_4: specifying datafile(s) in backup set
input datafile file number=00008 name=/u01/app/oracle/oradata/ORCLCDB/pdbseed/undotbs01.dbf
channel ORA_DISK_4: starting piece 1 at 06-JAN-21
channel ORA_DISK_1: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T000621
piece handle=/backup1/ORCLCDB/06vjthnu_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/06vjthnu_1_2 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:58
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00007 name=/u01/app/oracle/oradata/ORCLCDB/users01.dbf
channel ORA_DISK_1: starting piece 1 at 06-JAN-21
channel ORA_DISK_2: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T000621
piece handle=/backup1/ORCLCDB/0cvjthov_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0cvjthov_1_2 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:24
channel ORA_DISK_3: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T000621
piece handle=/backup1/ORCLCDB/0dvjthpg_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0dvjthpg_1_2 comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:08
channel ORA_DISK_4: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T000621
piece handle=/backup1/ORCLCDB/0evjthpg_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0evjthpg_1_2 comment=NONE
channel ORA_DISK_4: backup set complete, elapsed time: 00:00:07
channel ORA_DISK_1: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T000621
piece handle=/backup1/ORCLCDB/0fvjthpo_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0fvjthpo_1_2 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 06-JAN-21
Starting backup at 06-JAN-21
current log archived
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=6 RECID=6 STAMP=1061078842
channel ORA_DISK_1: starting piece 1 at 06-JAN-21
channel ORA_DISK_1: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T000722
piece handle=/backup1/ORCLCDB/0gvjthpq_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0gvjthpq_1_2 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 06-JAN-21
Starting Control File and SPFILE Autobackup at 06-JAN-21
piece handle=/u01/app/oracle/fast_recovery_area/ORCLCDB/autobackup/2021_01_06/o1_mf_s_1061078843_hzbkdd4g_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 06-JAN-21
Let's see what files we have.
[root@test ~]# ll /backup*/ORCLCDB
/backup1/ORCLCDB:
total 6234532
-rw-r----- 1 oracle oinstall 1913805312 Jan 6 00:06 03vjthlq_1_1
-rw-r----- 1 oracle oinstall 1134441472 Jan 6 00:05 04vjthlr_1_1
-rw-r----- 1 oracle oinstall 406168064 Jan 6 00:05 05vjthlr_1_1
-rw-r----- 1 oracle oinstall 899538944 Jan 6 00:07 06vjthnu_1_1
-rw-r----- 1 oracle oinstall 552509440 Jan 6 00:06 07vjthnu_1_1
-rw-r----- 1 oracle oinstall 302989312 Jan 6 00:06 08vjthnu_1_1
-rw-r----- 1 oracle oinstall 287801344 Jan 6 00:06 09vjthnu_1_1
-rw-r----- 1 oracle oinstall 294313984 Jan 6 00:07 0avjthoo_1_1
-rw-r----- 1 oracle oinstall 184631296 Jan 6 00:07 0bvjthoo_1_1
-rw-r----- 1 oracle oinstall 281886720 Jan 6 00:07 0cvjthov_1_1
-rw-r----- 1 oracle oinstall 3678208 Jan 6 00:07 0dvjthpg_1_1
-rw-r----- 1 oracle oinstall 119627776 Jan 6 00:07 0evjthpg_1_1
-rw-r----- 1 oracle oinstall 2506752 Jan 6 00:07 0fvjthpo_1_1
-rw-r----- 1 oracle oinstall 251392 Jan 6 00:07 0gvjthpq_1_1
/backup2/ORCLCDB:
total 6234532
-rw-r----- 1 oracle oinstall 1913805312 Jan 6 00:06 03vjthlq_1_2
-rw-r----- 1 oracle oinstall 1134441472 Jan 6 00:05 04vjthlr_1_2
-rw-r----- 1 oracle oinstall 406168064 Jan 6 00:05 05vjthlr_1_2
-rw-r----- 1 oracle oinstall 899538944 Jan 6 00:07 06vjthnu_1_2
-rw-r----- 1 oracle oinstall 552509440 Jan 6 00:06 07vjthnu_1_2
-rw-r----- 1 oracle oinstall 302989312 Jan 6 00:06 08vjthnu_1_2
-rw-r----- 1 oracle oinstall 287801344 Jan 6 00:06 09vjthnu_1_2
-rw-r----- 1 oracle oinstall 294313984 Jan 6 00:07 0avjthoo_1_2
-rw-r----- 1 oracle oinstall 184631296 Jan 6 00:07 0bvjthoo_1_2
-rw-r----- 1 oracle oinstall 281886720 Jan 6 00:07 0cvjthov_1_2
-rw-r----- 1 oracle oinstall 3678208 Jan 6 00:07 0dvjthpg_1_2
-rw-r----- 1 oracle oinstall 119627776 Jan 6 00:07 0evjthpg_1_2
-rw-r----- 1 oracle oinstall 2506752 Jan 6 00:07 0fvjthpo_1_2
-rw-r----- 1 oracle oinstall 251392 Jan 6 00:07 0gvjthpq_1_2
Although file names look very similar between /backup1 and /backup2, they are different at the last digit. The last digit indicates the sequence number of copies.
Run Block Backup Copies
We also can set the backup copies in a run block. The key statement is SET BACKUP COPIES, which can set the number of backup copies for the entire run block, no matter what kind of backup object.
Example 1
RMAN> run {
set backup copies 2;
allocate channel c1 type disk format '/backup1/ORCLCDB/%U','/backup2/ORCLCDB/%U';
allocate channel c2 type disk format '/backup1/ORCLCDB/%U','/backup2/ORCLCDB/%U';
allocate channel c3 type disk format '/backup1/ORCLCDB/%U','/backup2/ORCLCDB/%U';
allocate channel c4 type disk format '/backup1/ORCLCDB/%U','/backup2/ORCLCDB/%U';
backup database plus archivelog;
}
2> 3> 4> 5> 6> 7> 8>
executing command: SET BACKUP COPIES
allocated channel: c1
channel c1: SID=577 device type=DISK
allocated channel: c2
channel c2: SID=1157 device type=DISK
allocated channel: c3
channel c3: SID=1712 device type=DISK
allocated channel: c4
channel c4: SID=26 device type=DISK
Starting backup at 06-JAN-21
current log archived
channel c1: starting archived log backup set
channel c1: specifying archived log(s) in backup set
input archived log thread=1 sequence=1 RECID=1 STAMP=1045783185
channel c1: starting piece 1 at 06-JAN-21
channel c2: starting archived log backup set
channel c2: specifying archived log(s) in backup set
input archived log thread=1 sequence=2 RECID=2 STAMP=1045793980
input archived log thread=1 sequence=3 RECID=3 STAMP=1059269445
channel c2: starting piece 1 at 06-JAN-21
channel c3: starting archived log backup set
channel c3: specifying archived log(s) in backup set
input archived log thread=1 sequence=4 RECID=4 STAMP=1059270134
channel c3: starting piece 1 at 06-JAN-21
channel c4: starting archived log backup set
channel c4: specifying archived log(s) in backup set
input archived log thread=1 sequence=5 RECID=5 STAMP=1061093084
input archived log thread=1 sequence=6 RECID=6 STAMP=1061093187
channel c4: starting piece 1 at 06-JAN-21
channel c4: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T040732
piece handle=/backup1/ORCLCDB/0cvjtvs5_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0cvjtvs5_1_2 comment=NONE
channel c4: backup set complete, elapsed time: 00:00:36
channel c4: starting archived log backup set
channel c4: specifying archived log(s) in backup set
input archived log thread=1 sequence=7 RECID=7 STAMP=1061093252
channel c4: starting piece 1 at 06-JAN-21
channel c4: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T040732
piece handle=/backup1/ORCLCDB/0dvjtvt9_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0dvjtvt9_1_2 comment=NONE
channel c4: backup set complete, elapsed time: 00:00:01
channel c1: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T040732
piece handle=/backup1/ORCLCDB/09vjtvs5_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/09vjtvs5_1_2 comment=NONE
channel c1: backup set complete, elapsed time: 00:01:01
channel c2: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T040732
piece handle=/backup1/ORCLCDB/0avjtvs5_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0avjtvs5_1_2 comment=NONE
channel c2: backup set complete, elapsed time: 00:01:01
channel c3: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T040732
piece handle=/backup1/ORCLCDB/0bvjtvs5_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0bvjtvs5_1_2 comment=NONE
channel c3: backup set complete, elapsed time: 00:01:01
Finished backup at 06-JAN-21
Starting backup at 06-JAN-21
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/ORCLCDB/system01.dbf
channel c1: starting piece 1 at 06-JAN-21
channel c2: starting full datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00003 name=/u01/app/oracle/oradata/ORCLCDB/sysaux01.dbf
channel c2: starting piece 1 at 06-JAN-21
channel c3: starting full datafile backup set
channel c3: specifying datafile(s) in backup set
input datafile file number=00010 name=/u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/sysaux01.dbf
channel c3: starting piece 1 at 06-JAN-21
channel c4: starting full datafile backup set
channel c4: specifying datafile(s) in backup set
input datafile file number=00006 name=/u01/app/oracle/oradata/ORCLCDB/pdbseed/sysaux01.dbf
channel c4: starting piece 1 at 06-JAN-21
channel c3: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T040835
piece handle=/backup1/ORCLCDB/0gvjtvu3_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0gvjtvu3_1_2 comment=NONE
channel c3: backup set complete, elapsed time: 00:00:26
channel c3: starting full datafile backup set
channel c3: specifying datafile(s) in backup set
input datafile file number=00009 name=/u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/system01.dbf
input datafile file number=00012 name=/u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/users01.dbf
channel c3: starting piece 1 at 06-JAN-21
channel c4: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T040835
piece handle=/backup1/ORCLCDB/0hvjtvu4_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0hvjtvu4_1_2 comment=NONE
channel c4: backup set complete, elapsed time: 00:00:29
channel c4: starting full datafile backup set
channel c4: specifying datafile(s) in backup set
input datafile file number=00013 name=/u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/example01.dbf
input datafile file number=00011 name=/u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/undotbs01.dbf
channel c4: starting piece 1 at 06-JAN-21
channel c2: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T040835
piece handle=/backup1/ORCLCDB/0fvjtvu3_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0fvjtvu3_1_2 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:46
channel c2: starting full datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00005 name=/u01/app/oracle/oradata/ORCLCDB/pdbseed/system01.dbf
channel c2: starting piece 1 at 06-JAN-21
channel c4: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T040835
piece handle=/backup1/ORCLCDB/0jvjtvv1_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0jvjtvv1_1_2 comment=NONE
channel c4: backup set complete, elapsed time: 00:00:17
channel c4: starting full datafile backup set
channel c4: specifying datafile(s) in backup set
input datafile file number=00004 name=/u01/app/oracle/oradata/ORCLCDB/undotbs01.dbf
channel c4: starting piece 1 at 06-JAN-21
channel c3: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T040835
piece handle=/backup1/ORCLCDB/0ivjtvuu_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0ivjtvuu_1_2 comment=NONE
channel c3: backup set complete, elapsed time: 00:00:25
channel c3: starting full datafile backup set
channel c3: specifying datafile(s) in backup set
input datafile file number=00008 name=/u01/app/oracle/oradata/ORCLCDB/pdbseed/undotbs01.dbf
channel c3: starting piece 1 at 06-JAN-21
channel c4: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T040835
piece handle=/backup1/ORCLCDB/0lvjtvvk_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0lvjtvvk_1_2 comment=NONE
channel c4: backup set complete, elapsed time: 00:00:07
channel c4: starting full datafile backup set
channel c4: specifying datafile(s) in backup set
input datafile file number=00007 name=/u01/app/oracle/oradata/ORCLCDB/users01.dbf
channel c4: starting piece 1 at 06-JAN-21
channel c4: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T040835
piece handle=/backup1/ORCLCDB/0nvjtvvr_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0nvjtvvr_1_2 comment=NONE
channel c4: backup set complete, elapsed time: 00:00:03
channel c1: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T040835
piece handle=/backup1/ORCLCDB/0evjtvu3_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0evjtvu3_1_2 comment=NONE
channel c1: backup set complete, elapsed time: 00:01:03
channel c2: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T040835
piece handle=/backup1/ORCLCDB/0kvjtvvh_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0kvjtvvh_1_2 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:17
channel c3: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T040835
piece handle=/backup1/ORCLCDB/0mvjtvvo_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0mvjtvvo_1_2 comment=NONE
channel c3: backup set complete, elapsed time: 00:00:10
Finished backup at 06-JAN-21
Starting backup at 06-JAN-21
current log archived
channel c1: starting archived log backup set
channel c1: specifying archived log(s) in backup set
input archived log thread=1 sequence=8 RECID=8 STAMP=1061093379
channel c1: starting piece 1 at 06-JAN-21
channel c1: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T040939
piece handle=/backup1/ORCLCDB/0ovju003_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0ovju003_1_2 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 06-JAN-21
Starting Control File and SPFILE Autobackup at 06-JAN-21
piece handle=/u01/app/oracle/fast_recovery_area/ORCLCDB/autobackup/2021_01_06/o1_mf_s_1061093380_hzbzlo4d_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 06-JAN-21
released channel: c1
released channel: c2
released channel: c3
released channel: c4
As you can see, we allocated 4 channel for parallel backups to the same destination in the run block. Of course, you can also set different destinations to spread backup pieces across several disks.
Please note that, the number of copies we specified only affects in the run block. Once we're out of the run block, the settings are gone. All values are back to the global settings.
Example 2
The format of locations can be configured in the backup command.
RMAN> run {
set backup copies 2;
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
backup database format '/backup1/ORCLCDB/%U','/backup2/ORCLCDB/%U' plus archivelog format '/backup3/ORCLCDB/%U','/backup4/ORCLCDB/%U';
}
2> 3> 4> 5> 6> 7> 8>
executing command: SET BACKUP COPIES
allocated channel: c1
channel c1: SID=1729 device type=DISK
allocated channel: c2
channel c2: SID=24 device type=DISK
allocated channel: c3
channel c3: SID=577 device type=DISK
allocated channel: c4
channel c4: SID=1161 device type=DISK
Starting backup at 06-JAN-21
current log archived
channel c1: starting archived log backup set
channel c1: specifying archived log(s) in backup set
input archived log thread=1 sequence=3 RECID=3 STAMP=1059269445
input archived log thread=1 sequence=4 RECID=4 STAMP=1059270134
channel c1: starting piece 1 at 06-JAN-21
channel c2: starting archived log backup set
channel c2: specifying archived log(s) in backup set
input archived log thread=1 sequence=1 RECID=1 STAMP=1045783185
input archived log thread=1 sequence=2 RECID=2 STAMP=1045793980
channel c2: starting piece 1 at 06-JAN-21
channel c3: starting archived log backup set
channel c3: specifying archived log(s) in backup set
input archived log thread=1 sequence=5 RECID=5 STAMP=1061093722
channel c3: starting piece 1 at 06-JAN-21
channel c3: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T041522
piece handle=/backup3/ORCLCDB/05vju0ar_1_1 comment=NONE
piece handle=/backup4/ORCLCDB/05vju0ar_1_2 comment=NONE
channel c3: backup set complete, elapsed time: 00:00:25
channel c2: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T041522
piece handle=/backup3/ORCLCDB/04vju0ar_1_1 comment=NONE
piece handle=/backup4/ORCLCDB/04vju0ar_1_2 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:45
channel c1: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T041522
piece handle=/backup3/ORCLCDB/03vju0ar_1_1 comment=NONE
piece handle=/backup4/ORCLCDB/03vju0ar_1_2 comment=NONE
channel c1: backup set complete, elapsed time: 00:01:06
Finished backup at 06-JAN-21
Starting backup at 06-JAN-21
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/ORA19C1/system01.dbf
channel c1: starting piece 1 at 06-JAN-21
channel c2: starting full datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00003 name=/u01/app/oracle/oradata/ORA19C1/sysaux01.dbf
channel c2: starting piece 1 at 06-JAN-21
channel c3: starting full datafile backup set
channel c3: specifying datafile(s) in backup set
input datafile file number=00010 name=/u01/app/oracle/oradata/ORA19C1/ORCLPDB1/sysaux01.dbf
channel c3: starting piece 1 at 06-JAN-21
channel c4: starting full datafile backup set
channel c4: specifying datafile(s) in backup set
input datafile file number=00006 name=/u01/app/oracle/oradata/ORA19C1/pdbseed/sysaux01.dbf
channel c4: starting piece 1 at 06-JAN-21
channel c3: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T041629
piece handle=/backup1/ORCLCDB/08vju0cu_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/08vju0cu_1_2 comment=NONE
channel c3: backup set complete, elapsed time: 00:00:26
channel c3: starting full datafile backup set
channel c3: specifying datafile(s) in backup set
input datafile file number=00009 name=/u01/app/oracle/oradata/ORA19C1/ORCLPDB1/system01.dbf
input datafile file number=00012 name=/u01/app/oracle/oradata/ORA19C1/ORCLPDB1/users01.dbf
channel c3: starting piece 1 at 06-JAN-21
channel c4: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T041629
piece handle=/backup1/ORCLCDB/09vju0cu_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/09vju0cu_1_2 comment=NONE
channel c4: backup set complete, elapsed time: 00:00:33
channel c4: starting full datafile backup set
channel c4: specifying datafile(s) in backup set
input datafile file number=00013 name=/u01/app/oracle/oradata/ORA19C1/ORCLPDB1/example01.dbf
input datafile file number=00011 name=/u01/app/oracle/oradata/ORA19C1/ORCLPDB1/undotbs01.dbf
channel c4: starting piece 1 at 06-JAN-21
channel c2: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T041629
piece handle=/backup1/ORCLCDB/07vju0cu_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/07vju0cu_1_2 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:41
channel c2: starting full datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00005 name=/u01/app/oracle/oradata/ORA19C1/pdbseed/system01.dbf
channel c2: starting piece 1 at 06-JAN-21
channel c3: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T041629
piece handle=/backup1/ORCLCDB/0avju0do_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0avju0do_1_2 comment=NONE
channel c3: backup set complete, elapsed time: 00:00:31
channel c3: starting full datafile backup set
channel c3: specifying datafile(s) in backup set
input datafile file number=00004 name=/u01/app/oracle/oradata/ORA19C1/undotbs01.dbf
channel c3: starting piece 1 at 06-JAN-21
channel c4: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T041629
piece handle=/backup1/ORCLCDB/0bvju0e0_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0bvju0e0_1_2 comment=NONE
channel c4: backup set complete, elapsed time: 00:00:24
channel c4: starting full datafile backup set
channel c4: specifying datafile(s) in backup set
input datafile file number=00008 name=/u01/app/oracle/oradata/ORA19C1/pdbseed/undotbs01.dbf
channel c4: starting piece 1 at 06-JAN-21
channel c2: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T041629
piece handle=/backup1/ORCLCDB/0cvju0e8_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0cvju0e8_1_2 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:20
channel c2: starting full datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00007 name=/u01/app/oracle/oradata/ORA19C1/users01.dbf
channel c2: starting piece 1 at 06-JAN-21
channel c1: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T041629
piece handle=/backup1/ORCLCDB/06vju0cu_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/06vju0cu_1_2 comment=NONE
channel c1: backup set complete, elapsed time: 00:01:07
channel c2: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T041629
piece handle=/backup1/ORCLCDB/0fvju0et_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0fvju0et_1_2 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:04
channel c3: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T041629
piece handle=/backup1/ORCLCDB/0dvju0eo_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0dvju0eo_1_2 comment=NONE
channel c3: backup set complete, elapsed time: 00:00:09
channel c4: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T041629
piece handle=/backup1/ORCLCDB/0evju0eo_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/0evju0eo_1_2 comment=NONE
channel c4: backup set complete, elapsed time: 00:00:08
Finished backup at 06-JAN-21
Starting backup at 06-JAN-21
current log archived
channel c1: starting archived log backup set
channel c1: specifying archived log(s) in backup set
input archived log thread=1 sequence=6 RECID=6 STAMP=1061093857
channel c1: starting piece 1 at 06-JAN-21
channel c1: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T041737
piece handle=/backup3/ORCLCDB/0gvju0f1_1_1 comment=NONE
piece handle=/backup4/ORCLCDB/0gvju0f1_1_2 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 06-JAN-21
Starting Control File and SPFILE Autobackup at 06-JAN-21
piece handle=/u01/app/oracle/fast_recovery_area/ORA19C1/autobackup/2021_01_06/o1_mf_s_1061093859_hzc01mk4_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 06-JAN-21
released channel: c1
released channel: c2
released channel: c3
released channel: c4
It looks neater than the previous run block. Also, we set different locations for database and archivelog, it's pretty flexible and customized.
Single Command Backup Copies
We can have several backup copies by setting DEVICE TYPE DISK COPIES after BACKUP in a single backup command.
RMAN> backup device type disk copies 2 database format '/backup1/ORCLCDB/%U','/backup2/ORCLCDB/%U' plus archivelog format '/backup3/ORCLCDB/%U','/backup4/ORCLCDB/%U';
Starting backup at 06-JAN-21
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=32 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=1 RECID=1 STAMP=1045783185
input archived log thread=1 sequence=2 RECID=2 STAMP=1045793980
input archived log thread=1 sequence=3 RECID=3 STAMP=1059269445
input archived log thread=1 sequence=4 RECID=4 STAMP=1059270134
input archived log thread=1 sequence=5 RECID=5 STAMP=1061157298
channel ORA_DISK_1: starting piece 1 at 06-JAN-21
channel ORA_DISK_1: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T215459
piece handle=/backup3/ORCLCDB/03vjvudj_1_1 comment=NONE
piece handle=/backup4/ORCLCDB/03vjvudj_1_2 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:06
Finished backup at 06-JAN-21
Starting backup at 06-JAN-21
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/ORCLCDB/system01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/ORCLCDB/sysaux01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/ORCLCDB/undotbs01.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/ORCLCDB/users01.dbf
channel ORA_DISK_1: starting piece 1 at 06-JAN-21
channel ORA_DISK_1: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T215605
piece handle=/backup1/ORCLCDB/04vjvufm_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/04vjvufm_1_2 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00010 name=/u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/sysaux01.dbf
input datafile file number=00009 name=/u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/system01.dbf
input datafile file number=00013 name=/u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/example01.dbf
input datafile file number=00011 name=/u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/undotbs01.dbf
input datafile file number=00012 name=/u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/users01.dbf
channel ORA_DISK_1: starting piece 1 at 06-JAN-21
channel ORA_DISK_1: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T215605
piece handle=/backup1/ORCLCDB/05vjvugp_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/05vjvugp_1_2 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/u01/app/oracle/oradata/ORCLCDB/pdbseed/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/ORCLCDB/pdbseed/system01.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/ORCLCDB/pdbseed/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 06-JAN-21
channel ORA_DISK_1: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T215605
piece handle=/backup1/ORCLCDB/06vjvuhi_1_1 comment=NONE
piece handle=/backup2/ORCLCDB/06vjvuhi_1_2 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 06-JAN-21
Starting backup at 06-JAN-21
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=6 RECID=6 STAMP=1061157442
channel ORA_DISK_1: starting piece 1 at 06-JAN-21
channel ORA_DISK_1: finished piece 1 at 06-JAN-21 with 2 copies and tag TAG20210106T215722
piece handle=/backup3/ORCLCDB/07vjvui2_1_1 comment=NONE
piece handle=/backup4/ORCLCDB/07vjvui2_1_2 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 06-JAN-21
Starting Control File and SPFILE Autobackup at 06-JAN-21
piece handle=/u01/app/oracle/fast_recovery_area/ORCLCDB/autobackup/2021_01_06/o1_mf_s_1061157443_hzdy4mrj_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 06-JAN-21
To check the backup result, we list the backup of database.
RMAN> list backup of database;
List of Backup Sets
===================
BS Key Type LV Size
------- ---- -- ----------
4 Full 1.49G
List of Datafiles in backup set 4
File LV Type Ckp SCN Ckp Time Abs Fuz SCN Sparse Name
---- -- ---- ---------- --------- ----------- ------ ----
1 Full 2921794 06-JAN-21 NO /u01/app/oracle/oradata/ORCLCDB/system01.dbf
3 Full 2921794 06-JAN-21 NO /u01/app/oracle/oradata/ORCLCDB/sysaux01.dbf
4 Full 2921794 06-JAN-21 NO /u01/app/oracle/oradata/ORCLCDB/undotbs01.dbf
7 Full 2921794 06-JAN-21 NO /u01/app/oracle/oradata/ORCLCDB/users01.dbf
Backup Set Copy #1 of backup set 4
Device Type Elapsed Time Completion Time Compressed Tag
----------- ------------ --------------- ---------- ---
DISK 00:00:29 06-JAN-21 NO TAG20210106T215605
List of Backup Pieces for backup set 4 Copy #1
BP Key Pc# Status Piece Name
------- --- ----------- ----------
5 1 AVAILABLE /backup1/ORCLCDB/04vjvufm_1_1
Backup Set Copy #2 of backup set 4
Device Type Elapsed Time Completion Time Compressed Tag
----------- ------------ --------------- ---------- ---
DISK 00:00:29 06-JAN-21 NO TAG20210106T215605
List of Backup Pieces for backup set 4 Copy #2
BP Key Pc# Status Piece Name
------- --- ----------- ----------
6 1 AVAILABLE /backup2/ORCLCDB/04vjvufm_1_2
BS Key Type LV Size
------- ---- -- ----------
5 Full 745.63M
List of Datafiles in backup set 5
Container ID: 3, PDB Name: ORCLPDB1
File LV Type Ckp SCN Ckp Time Abs Fuz SCN Sparse Name
---- -- ---- ---------- --------- ----------- ------ ----
9 Full 2918247 16-DEC-20 NO /u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/system01.dbf
10 Full 2918247 16-DEC-20 NO /u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/sysaux01.dbf
11 Full 2918247 16-DEC-20 NO /u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/undotbs01.dbf
12 Full 2918247 16-DEC-20 NO /u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/users01.dbf
13 Full 2918247 16-DEC-20 NO /u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/example01.dbf
Backup Set Copy #1 of backup set 5
Device Type Elapsed Time Completion Time Compressed Tag
----------- ------------ --------------- ---------- ---
DISK 00:00:14 06-JAN-21 NO TAG20210106T215605
List of Backup Pieces for backup set 5 Copy #1
BP Key Pc# Status Piece Name
------- --- ----------- ----------
7 1 AVAILABLE /backup1/ORCLCDB/05vjvugp_1_1
Backup Set Copy #2 of backup set 5
Device Type Elapsed Time Completion Time Compressed Tag
----------- ------------ --------------- ---------- ---
DISK 00:00:14 06-JAN-21 NO TAG20210106T215605
List of Backup Pieces for backup set 5 Copy #2
BP Key Pc# Status Piece Name
------- --- ----------- ----------
8 1 AVAILABLE /backup2/ORCLCDB/05vjvugp_1_2
BS Key Type LV Size
------- ---- -- ----------
6 Full 657.30M
List of Datafiles in backup set 6
Container ID: 2, PDB Name: PDB$SEED
File LV Type Ckp SCN Ckp Time Abs Fuz SCN Sparse Name
---- -- ---- ---------- --------- ----------- ------ ----
5 Full 2914979 16-DEC-20 NO /u01/app/oracle/oradata/ORCLCDB/pdbseed/system01.dbf
6 Full 2914979 16-DEC-20 NO /u01/app/oracle/oradata/ORCLCDB/pdbseed/sysaux01.dbf
8 Full 2914979 16-DEC-20 NO /u01/app/oracle/oradata/ORCLCDB/pdbseed/undotbs01.dbf
Backup Set Copy #1 of backup set 6
Device Type Elapsed Time Completion Time Compressed Tag
----------- ------------ --------------- ---------- ---
DISK 00:00:11 06-JAN-21 NO TAG20210106T215605
List of Backup Pieces for backup set 6 Copy #1
BP Key Pc# Status Piece Name
------- --- ----------- ----------
9 1 AVAILABLE /backup1/ORCLCDB/06vjvuhi_1_1
Backup Set Copy #2 of backup set 6
Device Type Elapsed Time Completion Time Compressed Tag
----------- ------------ --------------- ---------- ---
DISK 00:00:11 06-JAN-21 NO TAG20210106T215605
List of Backup Pieces for backup set 6 Copy #2
BP Key Pc# Status Piece Name
------- --- ----------- ----------
10 1 AVAILABLE /backup2/ORCLCDB/06vjvuhi_1_2
That's it.
Hi Sir,
Thanks for the content.
I have a question, how do we resolve control file auto backup issue going to only one location, not able duplex it.
You’re right, I don’t think AUTOBACKUP can be duplexed.