Oracle RMAN 11g Backup and Recovery (89 page)

BOOK: Oracle RMAN 11g Backup and Recovery
9.18Mb size Format: txt, pdf, ePub

252
Part II: Setup Principles and Practices

You can use the
controlfilecopy
parameter of the
backup
command to create a backup set that contains an externally created backup of the control file. This control file backup might be the result of the
alter database backup controlfile to ‘file_name’
SQL command or the use of the RMAN
copy
command (covered later in this chapter) to create a control file backup. Also, you can back up a standby database control file that was created with the
alter database create
standby controlfile
command. The benefit of this feature is that you can take external control file backup files and register them with RMAN, and create a backup set that contains the control file backup. Here are some examples of the use of this parameter: backup current controlfile;

sql "alter database backup controlfile

to ''d:\backup\robt\contf back.ctl''";

backup controlfilecopy 'd:\backup\robt\contf back.ctl';

Backup Set Backups

Perhaps you like to back up to disk first, and then to back up your backup sets to tape. RMAN

supports this operation through the use of the
backup
command. For example, suppose we issued a
backup database
command, and the entire backup set went to disk because that is our configured default device. Now, we wish to move that backup set to tape. We could issue the
backup
command with the
backupset
parameter, and Oracle would back up all of our backup sets to the channel that is allocated for the backup.

You can choose to back up all backup sets with the
backup backupset
command, or you can choose to back up specific backup sets. Further, you can only back up from disk to disk or from disk to tape. There is no support for tape-to-tape or tape-to-disk backups. The
delete input
option, which we previously discussed in regard to archive log backups, is also available with backup set backups. When used, the
delete input
option will cause the files of the source backup set to get deleted after a successful backup. Here are some examples of this command: backup backupset all;

backup backupset all

format 'd:\backup\newbackups\backup %U.bak'

tag 'Backup of backupsets on 6/15' channel 'ORA DISK 1';

backup backupset completed before 'sysdate - 2';

backup backupset completed before 'sysdate - 2' delete input;

backup backupset completed after 'sysdate - 2' delete input;

An example of a backup strategy here might be to perform RMAN backups to disk, and then to back up the backup sets to tape with the
backup backupset
command. Perhaps you want to keep two days’ worth of your backup sets on disk. You could then issue two commands. First, issue the
backup backupset completed before ‘sysdate - 2’
command to back up the last two days of backups. Next, to back up and then remove any backup sets older than two days, issue the
backup backupset completed after ‘sysdate - 2’ delete input
command, which would cause one final backup of the old backup sets and then remove them.

NOTE

Backup set backups are very handy if you want to back up your

control file automated backups elsewhere and to still have the catalog
track the location of the backup set.

Chapter 11: RMAN Backups
253

Flash Recovery Area Backups

RMAN offers the ability to back up the entire FRA to tape via the
backup recovery area
command. Not all files in the FRA are backed up. Files that are backed up include full and incremental backup sets, control file autobackups, archived logs, and datafile copies. If your backup FRA contains flashback logs, the current control file, and/or online redo logs, these files will not be backed up. Note that files must be backed up to tape.

Copies

Okay, all this newfangled talk of backup sets and pieces is just blowing your mind. You ask,

“Can’t I just make a copy of these database datafiles?” We’re here to make you feel better. With RMAN, you can just make copies of your different database structures, and that’s what we are going to talk about in this section. First, we will review the upside, and downside, to creating copies instead of backup sets. Then, we will look at how we create datafile copies, control file copies, and archived redo log file copies.

Introducing Image Copies

RMAN can create an exact duplicate of your database datafiles, archived redo logs, or your control file. An RMAN image copy is just that—it is simply a copy of the file with the name and/or location changed. There are no backup pieces or anything else to worry about. Image copies can only be made to disk, and you cannot make incremental copies. The database must be either mounted or open to make image copies. A history of the copies made is kept in the database control file, so you can track when copies have been made and where they reside.

You can make image copies of the entire database, tablespaces, or datafiles, just like a regular backup (this is very different from earlier versions of RMAN). The RMAN copy process provides some of the same protections as normal RMAN backup sets, such as checking for corrupted blocks and, optionally, logical corruption. Also, image copies can be combined with normal backup sets such as incremental backups and archived redo log backups to facilitate a complete database recovery.

Database, Tablespace, and Datafile Image Copies

The
backup
command supports the creation of database image copies. Simply use the
backup as
copy
command to do image copies, and the process is much like performing backup sets. Here is an example of making a database image copy with RMAN:

RMAN> backup as copy database;

RMAN will use the FRA to store backup copies, if it is configured. If you are using the FRA, the datafile images will be stored in a directory called datafile, as shown in this partial example output from a datafile image copy:

RMAN> backup as copy database;

Starting backup at 12-NOV-05

using channel ORA DISK 1

using channel ORA DISK 2

channel ORA DISK 1: starting datafile copyinput datafile fno 00001

name C:\ORACLE\PRODUCT\10.2.0\ORADATA\ROB10R2\SYSTEM01.DBF

Other books

The Distance from Me to You by Marina Gessner
Feet of the Angels by Evelyne de La Chenelière
Watchers - an erotic novella by Johnson-Smith, Jodie
Justice Healed by Olivia Jaymes