I will show, how to create different types of backups using rman.
Offline Backup.
As first thing, I will do a little configuration change in my RMAN. I will turn on autobackup of the controlfile and change the location of the snapshot controlfile:[oracle@btest backup]$ rman target / nocatalog
Recovery Manager: Release 11.2.0.3.0 - Production on Mon Jan 23 11:39:55 2012
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: BTEST (DBID=4236471253)
using target database control file instead of recovery catalog
RMAN> show all;
RMAN configuration parameters for database with db_unique_name BTEST are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/product/11.2/db_1/dbs/snapcf_btest.f'; # default
RMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/backup/snap_ctl/snapcf_btest.f';
new RMAN configuration parameters:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/backup/snap_ctl/snapcf_btest.f';
new RMAN configuration parameters are successfully stored
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/backup/controlfile/%F';
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/backup/controlfile/%F';
new RMAN configuration parameters are successfully stored
Now, I will start an offline backup:
[oracle@btest ~]$ rman target / nocatalog
Recovery Manager: Release 11.2.0.3.0 - Production on Mon Jan 23 12:59:39 2012
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: BTEST (DBID=4236471253)
using target database control file instead of recovery catalog
RMAN> shutdown immediate;
database closed
database dismounted
Oracle instance shut down
RMAN> startup mount;
connected to target database (not started)
Oracle instance started
database mounted
Total System Global Area 234356736 bytes
Fixed Size 1344088 bytes
Variable Size 146804136 bytes
Database Buffers 83886080 bytes
Redo Buffers 2322432 bytes
RMAN> backup format='/backup/database/offline_%s_%d_%t.bkp' database;
Starting backup at 23-JAN-12
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 device
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=/oracle/oradata/system01.dbf
input datafile file number=00002 name=/oracle/oradata/sysaux01.dbf
input datafile file number=00003 name=/oracle/oradata/undotbs1.dbf
channel ORA_DISK_1: starting piece 1 at 23-JAN-12
channel ORA_DISK_1: finished piece 1 at 23-JAN-12
piece handle=/backup/database/offline_3_BTEST_773326941.bkp tag=TAG20120123T130220 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:46
Finished backup at 23-JAN-12
Starting Control File and SPFILE Autobackup at 23-JAN-12
piece handle=/backup/controlfile/c-4236471253-20120123-01 comment=NONE
Finished Control File and SPFILE Autobackup at 23-JAN-12
RMAN> alter database open;
database opened
The backups are there:
Database backup:
[oracle@btest database]$ ll
total 276892
-rw-r----- 1 oracle oinstall 283254784 Jan 23 13:03 offline_3_BTEST_773326941.bkp
Controlfile (spfile) autobackup:
[oracle@btest database]$ cd /backup/controlfile/
[oracle@btest controlfile]$ ll
total 7628
-rw-r----- 1 oracle oinstall 7798784 Jan 23 13:03 c-4236471253-20120123-01
Snapshot controlfile:
[oracle@btest controlfile]$ cd /backup/snap_ctl/
[oracle@btest snap_ctl]$ ll
total 7548
-rw-r----- 1 oracle oinstall 7716864 Jan 23 13:03 snapcf_btest.f
You can query the controlfile to see the backup:
[oracle@btest snap_ctl]$ rman target / nocatalog
Recovery Manager: Release 11.2.0.3.0 - Production on Mon Jan 23 13:09:18 2012
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: BTEST (DBID=4236471253)
using target database control file instead of recovery catalog
RMAN> list backup of database;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3 Full 270.13M DISK 00:00:41 23-JAN-12
BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20120123T130220
Piece Name: /backup/database/offline_3_BTEST_773326941.bkp
List of Datafiles in backup set 3
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 297559 23-JAN-12 /oracle/oradata/system01.dbf
2 Full 297559 23-JAN-12 /oracle/oradata/sysaux01.dbf
3 Full 297559 23-JAN-12 /oracle/oradata/undotbs1.dbf
RMAN> list backup of controlfile;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
4 Full 7.42M DISK 00:00:05 23-JAN-12
BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20120123T130308
Piece Name: /backup/controlfile/c-4236471253-20120123-01
Control File Included: Ckp SCN: 297559 Ckp time: 23-JAN-12
RMAN> list backup of spfile;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
4 Full 7.42M DISK 00:00:05 23-JAN-12
BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20120123T130308
Piece Name: /backup/controlfile/c-4236471253-20120123-01
SPFILE Included: Modification time: 05-DEC-11
SPFILE db_unique_name: BTEST
Now the same, with the recovery catalog:
[oracle@btest ~]$ rman target / catalog rcat/testOra1@rcat
Recovery Manager: Release 11.2.0.3.0 - Production on Mon Jan 23 13:40:11 2012
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: BTEST (DBID=4236471253)
connected to recovery catalog database
We can see, that after the resync, we can see the backup, that was medi with nocatalog option:
RMAN> list backup of database;
starting full resync of recovery catalog
full resync complete
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
212 Full 270.13M DISK 00:00:41 23-JAN-12
BP Key: 214 Status: AVAILABLE Compressed: NO Tag: TAG20120123T130220
Piece Name: /backup/database/offline_3_BTEST_773326941.bkp
List of Datafiles in backup set 212
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 297559 23-JAN-12 /oracle/oradata/system01.dbf
2 Full 297559 23-JAN-12 /oracle/oradata/sysaux01.dbf
3 Full 297559 23-JAN-12 /oracle/oradata/undotbs1.dbf
Now, we will make offline backup:
RMAN> shutdown immediate;
database closed
database dismounted
Oracle instance shut down
RMAN> startup mount;
connected to target database (not started)
Oracle instance started
database mounted
Total System Global Area 234356736 bytes
Fixed Size 1344088 bytes
Variable Size 146804136 bytes
Database Buffers 83886080 bytes
Redo Buffers 2322432 bytes
RMAN> backup format='/backup/database/offline_%s_%d_%t.bkp' database;
Starting backup at 23-JAN-12
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device
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=/oracle/oradata/system01.dbf
input datafile file number=00002 name=/oracle/oradata/sysaux01.dbf
input datafile file number=00003 name=/oracle/oradata/undotbs1.dbf
channel ORA_DISK_1: starting piece 1 at 23-JAN-12
channel ORA_DISK_1: finished piece 1 at 23-JAN-12
piece handle=/backup/database/offline_5_BTEST_773329559.bkp tag=TAG20120123T134556 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:57
Finished backup at 23-JAN-12
Starting Control File and SPFILE Autobackup at 23-JAN-12
piece handle=/backup/controlfile/c-4236471253-20120123-02 comment=NONE
Finished Control File and SPFILE Autobackup at 23-JAN-12
RMAN> alter database open;
database opened
List the backup:
RMAN> list backup of database;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
212 Full 270.13M DISK 00:00:41 23-JAN-12
BP Key: 214 Status: AVAILABLE Compressed: NO Tag: TAG20120123T130220
Piece Name: /backup/database/offline_3_BTEST_773326941.bkp
List of Datafiles in backup set 212
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 297559 23-JAN-12 /oracle/oradata/system01.dbf
2 Full 297559 23-JAN-12 /oracle/oradata/sysaux01.dbf
3 Full 297559 23-JAN-12 /oracle/oradata/undotbs1.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
230 Full 304.82M DISK 00:00:51 23-JAN-12
BP Key: 233 Status: AVAILABLE Compressed: NO Tag: TAG20120123T134556
Piece Name: /backup/database/offline_5_BTEST_773329559.bkp
List of Datafiles in backup set 230
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 301439 23-JAN-12 /oracle/oradata/system01.dbf
2 Full 301439 23-JAN-12 /oracle/oradata/sysaux01.dbf
3 Full 301439 23-JAN-12 /oracle/oradata/undotbs1.dbf
Offline backup without using configured defaults:
If you dont want to use preconfigured option, you can specify each of them separately in the backup script:
Offline backup to the different location:
[oracle@btest ~]$ rman target / catalog rcat/testOra1@rcat
Recovery Manager: Release 11.2.0.3.0 - Production on Mon Jan 23 14:08:44 2012
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: BTEST (DBID=4236471253)
connected to recovery catalog database
RMAN> shutdown immediate;
database closed
database dismounted
Oracle instance shut down
RMAN> startup mount;
connected to target database (not started)
Oracle instance started
database mounted
Total System Global Area 234356736 bytes
Fixed Size 1344088 bytes
Variable Size 146804136 bytes
Database Buffers 83886080 bytes
Redo Buffers 2322432 bytes
RMAN> run
{
allocate channel c1 device type disk format='/backup/database/offline_%d_%s_%t.bkp';
backup database;
backup current controlfile;
}
allocated channel: c1
channel c1: SID=18 device
Starting backup at 23-JAN-12
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00001 name=/oracle/oradata/system01.dbf
input datafile file number=00002 name=/oracle/oradata/sysaux01.dbf
input datafile file number=00003 name=/oracle/oradata/undotbs1.dbf
channel c1: starting piece 1 at 23-JAN-12
channel c1: finished piece 1 at 23-JAN-12
piece handle=/backup/database/offline_BTEST_7_773331054.bkp tag=TAG20120123T141049 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:57
Finished backup at 23-JAN-12
Starting backup at 23-JAN-12
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including current control file in backup set
channel c1: starting piece 1 at 23-JAN-12
channel c1: finished piece 1 at 23-JAN-12
piece handle=/backup/database/offline_BTEST_8_773331122.bkp tag=TAG20120123T141159 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 23-JAN-12
Starting Control File and SPFILE Autobackup at 23-JAN-12
piece handle=/backup/controlfile/c-4236471253-20120123-03 comment=NONE
Finished Control File and SPFILE Autobackup at 23-JAN-12
released channel: c1
RMAN> alter database open;
database opened
Limiting the size of the backup piece:
shutdown immediate;
startup mount;
RMAN> run
{
allocate channel t1 type disk maxpiecesize=100M format='/backup/database/offline_%d_%s_%t_%U.bkp';
backup database;
release channel t1;
}
allocated channel: t1
channel t1: SID=16 device
Starting backup at 23-JAN-12
channel t1: starting full datafile backup set
channel t1: specifying datafile(s) in backup set
input datafile file number=00001 name=/oracle/oradata/system01.dbf
input datafile file number=00002 name=/oracle/oradata/sysaux01.dbf
input datafile file number=00003 name=/oracle/oradata/undotbs1.dbf
channel t1: starting piece 1 at 23-JAN-12
channel t1: finished piece 1 at 23-JAN-12
piece handle=/backup/database/offline_BTEST_13_773332417_0dn1g7e1_1_1.bkp tag=TAG20120123T143335 comment=NONE
channel t1: starting piece 2 at 23-JAN-12
channel t1: finished piece 2 at 23-JAN-12
piece handle=/backup/database/offline_BTEST_13_773332417_0dn1g7e1_2_1.bkp tag=TAG20120123T143335 comment=NONE
channel t1: starting piece 3 at 23-JAN-12
channel t1: finished piece 3 at 23-JAN-12
piece handle=/backup/database/offline_BTEST_13_773332417_0dn1g7e1_3_1.bkp tag=TAG20120123T143335 comment=NONE
channel t1: starting piece 4 at 23-JAN-12
channel t1: finished piece 4 at 23-JAN-12
piece handle=/backup/database/offline_BTEST_13_773332417_0dn1g7e1_4_1.bkp tag=TAG20120123T143335 comment=NONE
channel t1: backup set complete, elapsed time: 00:01:02
Finished backup at 23-JAN-12
Starting Control File and SPFILE Autobackup at 23-JAN-12
piece handle=/backup/controlfile/c-4236471253-20120123-04 comment=NONE
Finished Control File and SPFILE Autobackup at 23-JAN-12
released channel: t1
RMAN> alter database open;
database opened
[oracle@btest database]$ ls -altr
total 1223244
drwxr-xr-x 7 oracle dba 4096 Jan 23 12:59 ..
-rw-r----- 1 oracle oinstall 283254784 Jan 23 13:03 offline_3_BTEST_773326941.bkp
-rw-r----- 1 oracle oinstall 319635456 Jan 23 13:46 offline_5_BTEST_773329559.bkp
-rw-r----- 1 oracle oinstall 320266240 Jan 23 14:11 offline_BTEST_7_773331054.bkp
-rw-r----- 1 oracle oinstall 7766016 Jan 23 14:12 offline_BTEST_8_773331122.bkp
-rw-r----- 1 oracle oinstall 104857600 Jan 23 14:33 offline_BTEST_13_773332417_0dn1g7e1_1_1.bkp
-rw-r----- 1 oracle oinstall 104857600 Jan 23 14:34 offline_BTEST_13_773332417_0dn1g7e1_2_1.bkp
-rw-r----- 1 oracle oinstall 104857600 Jan 23 14:34 offline_BTEST_13_773332417_0dn1g7e1_3_1.bkp
drwxr-xr-x 2 oracle oinstall 4096 Jan 23 14:34 .
-rw-r----- 1 oracle oinstall 5832704 Jan 23 14:34 offline_BTEST_13_773332417_0dn1g7e1_4_1.bkp
Recovery Manager: Release 11.2.0.3.0 - Production on Mon Jan 23 11:39:55 2012
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: BTEST (DBID=4236471253)
using target database control file instead of recovery catalog
RMAN> show all;
RMAN configuration parameters for database with db_unique_name BTEST are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/product/11.2/db_1/dbs/snapcf_btest.f'; # default
RMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/backup/snap_ctl/snapcf_btest.f';
new RMAN configuration parameters:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/backup/snap_ctl/snapcf_btest.f';
new RMAN configuration parameters are successfully stored
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/backup/controlfile/%F';
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/backup/controlfile/%F';
new RMAN configuration parameters are successfully stored
Now, I will start an offline backup:
[oracle@btest ~]$ rman target / nocatalog
Recovery Manager: Release 11.2.0.3.0 - Production on Mon Jan 23 12:59:39 2012
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: BTEST (DBID=4236471253)
using target database control file instead of recovery catalog
RMAN> shutdown immediate;
database closed
database dismounted
Oracle instance shut down
RMAN> startup mount;
connected to target database (not started)
Oracle instance started
database mounted
Total System Global Area 234356736 bytes
Fixed Size 1344088 bytes
Variable Size 146804136 bytes
Database Buffers 83886080 bytes
Redo Buffers 2322432 bytes
RMAN> backup format='/backup/database/offline_%s_%d_%t.bkp' database;
Starting backup at 23-JAN-12
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 device
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=/oracle/oradata/system01.dbf
input datafile file number=00002 name=/oracle/oradata/sysaux01.dbf
input datafile file number=00003 name=/oracle/oradata/undotbs1.dbf
channel ORA_DISK_1: starting piece 1 at 23-JAN-12
channel ORA_DISK_1: finished piece 1 at 23-JAN-12
piece handle=/backup/database/offline_3_BTEST_773326941.bkp tag=TAG20120123T130220 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:46
Finished backup at 23-JAN-12
Starting Control File and SPFILE Autobackup at 23-JAN-12
piece handle=/backup/controlfile/c-4236471253-20120123-01 comment=NONE
Finished Control File and SPFILE Autobackup at 23-JAN-12
RMAN> alter database open;
database opened
The backups are there:
Database backup:
[oracle@btest database]$ ll
total 276892
-rw-r----- 1 oracle oinstall 283254784 Jan 23 13:03 offline_3_BTEST_773326941.bkp
Controlfile (spfile) autobackup:
[oracle@btest database]$ cd /backup/controlfile/
[oracle@btest controlfile]$ ll
total 7628
-rw-r----- 1 oracle oinstall 7798784 Jan 23 13:03 c-4236471253-20120123-01
Snapshot controlfile:
[oracle@btest controlfile]$ cd /backup/snap_ctl/
[oracle@btest snap_ctl]$ ll
total 7548
-rw-r----- 1 oracle oinstall 7716864 Jan 23 13:03 snapcf_btest.f
You can query the controlfile to see the backup:
[oracle@btest snap_ctl]$ rman target / nocatalog
Recovery Manager: Release 11.2.0.3.0 - Production on Mon Jan 23 13:09:18 2012
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: BTEST (DBID=4236471253)
using target database control file instead of recovery catalog
RMAN> list backup of database;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3 Full 270.13M DISK 00:00:41 23-JAN-12
BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20120123T130220
Piece Name: /backup/database/offline_3_BTEST_773326941.bkp
List of Datafiles in backup set 3
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 297559 23-JAN-12 /oracle/oradata/system01.dbf
2 Full 297559 23-JAN-12 /oracle/oradata/sysaux01.dbf
3 Full 297559 23-JAN-12 /oracle/oradata/undotbs1.dbf
RMAN> list backup of controlfile;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
4 Full 7.42M DISK 00:00:05 23-JAN-12
BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20120123T130308
Piece Name: /backup/controlfile/c-4236471253-20120123-01
Control File Included: Ckp SCN: 297559 Ckp time: 23-JAN-12
RMAN> list backup of spfile;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
4 Full 7.42M DISK 00:00:05 23-JAN-12
BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20120123T130308
Piece Name: /backup/controlfile/c-4236471253-20120123-01
SPFILE Included: Modification time: 05-DEC-11
SPFILE db_unique_name: BTEST
Now the same, with the recovery catalog:
[oracle@btest ~]$ rman target / catalog rcat/testOra1@rcat
Recovery Manager: Release 11.2.0.3.0 - Production on Mon Jan 23 13:40:11 2012
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: BTEST (DBID=4236471253)
connected to recovery catalog database
We can see, that after the resync, we can see the backup, that was medi with nocatalog option:
RMAN> list backup of database;
starting full resync of recovery catalog
full resync complete
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
212 Full 270.13M DISK 00:00:41 23-JAN-12
BP Key: 214 Status: AVAILABLE Compressed: NO Tag: TAG20120123T130220
Piece Name: /backup/database/offline_3_BTEST_773326941.bkp
List of Datafiles in backup set 212
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 297559 23-JAN-12 /oracle/oradata/system01.dbf
2 Full 297559 23-JAN-12 /oracle/oradata/sysaux01.dbf
3 Full 297559 23-JAN-12 /oracle/oradata/undotbs1.dbf
Now, we will make offline backup:
RMAN> shutdown immediate;
database closed
database dismounted
Oracle instance shut down
RMAN> startup mount;
connected to target database (not started)
Oracle instance started
database mounted
Total System Global Area 234356736 bytes
Fixed Size 1344088 bytes
Variable Size 146804136 bytes
Database Buffers 83886080 bytes
Redo Buffers 2322432 bytes
RMAN> backup format='/backup/database/offline_%s_%d_%t.bkp' database;
Starting backup at 23-JAN-12
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device
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=/oracle/oradata/system01.dbf
input datafile file number=00002 name=/oracle/oradata/sysaux01.dbf
input datafile file number=00003 name=/oracle/oradata/undotbs1.dbf
channel ORA_DISK_1: starting piece 1 at 23-JAN-12
channel ORA_DISK_1: finished piece 1 at 23-JAN-12
piece handle=/backup/database/offline_5_BTEST_773329559.bkp tag=TAG20120123T134556 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:57
Finished backup at 23-JAN-12
Starting Control File and SPFILE Autobackup at 23-JAN-12
piece handle=/backup/controlfile/c-4236471253-20120123-02 comment=NONE
Finished Control File and SPFILE Autobackup at 23-JAN-12
RMAN> alter database open;
database opened
List the backup:
RMAN> list backup of database;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
212 Full 270.13M DISK 00:00:41 23-JAN-12
BP Key: 214 Status: AVAILABLE Compressed: NO Tag: TAG20120123T130220
Piece Name: /backup/database/offline_3_BTEST_773326941.bkp
List of Datafiles in backup set 212
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 297559 23-JAN-12 /oracle/oradata/system01.dbf
2 Full 297559 23-JAN-12 /oracle/oradata/sysaux01.dbf
3 Full 297559 23-JAN-12 /oracle/oradata/undotbs1.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
230 Full 304.82M DISK 00:00:51 23-JAN-12
BP Key: 233 Status: AVAILABLE Compressed: NO Tag: TAG20120123T134556
Piece Name: /backup/database/offline_5_BTEST_773329559.bkp
List of Datafiles in backup set 230
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 301439 23-JAN-12 /oracle/oradata/system01.dbf
2 Full 301439 23-JAN-12 /oracle/oradata/sysaux01.dbf
3 Full 301439 23-JAN-12 /oracle/oradata/undotbs1.dbf
Offline backup without using configured defaults:
If you dont want to use preconfigured option, you can specify each of them separately in the backup script:
Offline backup to the different location:
[oracle@btest ~]$ rman target / catalog rcat/testOra1@rcat
Recovery Manager: Release 11.2.0.3.0 - Production on Mon Jan 23 14:08:44 2012
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: BTEST (DBID=4236471253)
connected to recovery catalog database
RMAN> shutdown immediate;
database closed
database dismounted
Oracle instance shut down
RMAN> startup mount;
connected to target database (not started)
Oracle instance started
database mounted
Total System Global Area 234356736 bytes
Fixed Size 1344088 bytes
Variable Size 146804136 bytes
Database Buffers 83886080 bytes
Redo Buffers 2322432 bytes
RMAN> run
{
allocate channel c1 device type disk format='/backup/database/offline_%d_%s_%t.bkp';
backup database;
backup current controlfile;
}
allocated channel: c1
channel c1: SID=18 device
Starting backup at 23-JAN-12
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00001 name=/oracle/oradata/system01.dbf
input datafile file number=00002 name=/oracle/oradata/sysaux01.dbf
input datafile file number=00003 name=/oracle/oradata/undotbs1.dbf
channel c1: starting piece 1 at 23-JAN-12
channel c1: finished piece 1 at 23-JAN-12
piece handle=/backup/database/offline_BTEST_7_773331054.bkp tag=TAG20120123T141049 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:57
Finished backup at 23-JAN-12
Starting backup at 23-JAN-12
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including current control file in backup set
channel c1: starting piece 1 at 23-JAN-12
channel c1: finished piece 1 at 23-JAN-12
piece handle=/backup/database/offline_BTEST_8_773331122.bkp tag=TAG20120123T141159 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 23-JAN-12
Starting Control File and SPFILE Autobackup at 23-JAN-12
piece handle=/backup/controlfile/c-4236471253-20120123-03 comment=NONE
Finished Control File and SPFILE Autobackup at 23-JAN-12
released channel: c1
RMAN> alter database open;
database opened
Limiting the size of the backup piece:
shutdown immediate;
startup mount;
RMAN> run
{
allocate channel t1 type disk maxpiecesize=100M format='/backup/database/offline_%d_%s_%t_%U.bkp';
backup database;
release channel t1;
}
allocated channel: t1
channel t1: SID=16 device
Starting backup at 23-JAN-12
channel t1: starting full datafile backup set
channel t1: specifying datafile(s) in backup set
input datafile file number=00001 name=/oracle/oradata/system01.dbf
input datafile file number=00002 name=/oracle/oradata/sysaux01.dbf
input datafile file number=00003 name=/oracle/oradata/undotbs1.dbf
channel t1: starting piece 1 at 23-JAN-12
channel t1: finished piece 1 at 23-JAN-12
piece handle=/backup/database/offline_BTEST_13_773332417_0dn1g7e1_1_1.bkp tag=TAG20120123T143335 comment=NONE
channel t1: starting piece 2 at 23-JAN-12
channel t1: finished piece 2 at 23-JAN-12
piece handle=/backup/database/offline_BTEST_13_773332417_0dn1g7e1_2_1.bkp tag=TAG20120123T143335 comment=NONE
channel t1: starting piece 3 at 23-JAN-12
channel t1: finished piece 3 at 23-JAN-12
piece handle=/backup/database/offline_BTEST_13_773332417_0dn1g7e1_3_1.bkp tag=TAG20120123T143335 comment=NONE
channel t1: starting piece 4 at 23-JAN-12
channel t1: finished piece 4 at 23-JAN-12
piece handle=/backup/database/offline_BTEST_13_773332417_0dn1g7e1_4_1.bkp tag=TAG20120123T143335 comment=NONE
channel t1: backup set complete, elapsed time: 00:01:02
Finished backup at 23-JAN-12
Starting Control File and SPFILE Autobackup at 23-JAN-12
piece handle=/backup/controlfile/c-4236471253-20120123-04 comment=NONE
Finished Control File and SPFILE Autobackup at 23-JAN-12
released channel: t1
RMAN> alter database open;
database opened
[oracle@btest database]$ ls -altr
total 1223244
drwxr-xr-x 7 oracle dba 4096 Jan 23 12:59 ..
-rw-r----- 1 oracle oinstall 283254784 Jan 23 13:03 offline_3_BTEST_773326941.bkp
-rw-r----- 1 oracle oinstall 319635456 Jan 23 13:46 offline_5_BTEST_773329559.bkp
-rw-r----- 1 oracle oinstall 320266240 Jan 23 14:11 offline_BTEST_7_773331054.bkp
-rw-r----- 1 oracle oinstall 7766016 Jan 23 14:12 offline_BTEST_8_773331122.bkp
-rw-r----- 1 oracle oinstall 104857600 Jan 23 14:33 offline_BTEST_13_773332417_0dn1g7e1_1_1.bkp
-rw-r----- 1 oracle oinstall 104857600 Jan 23 14:34 offline_BTEST_13_773332417_0dn1g7e1_2_1.bkp
-rw-r----- 1 oracle oinstall 104857600 Jan 23 14:34 offline_BTEST_13_773332417_0dn1g7e1_3_1.bkp
drwxr-xr-x 2 oracle oinstall 4096 Jan 23 14:34 .
-rw-r----- 1 oracle oinstall 5832704 Jan 23 14:34 offline_BTEST_13_773332417_0dn1g7e1_4_1.bkp