Chapter 6. Oracle backup considerations on Unix
6.3 Backup the database using TDP for Oracle and RMAN
When you execute the backup command, you create one or more backup sets.
A backup set, which is a logical construction, contains one or more physical backup pieces. Backup pieces are operating system files that contain the backed up datafiles, control files, or archived redo logs. You cannot split a file across different backup sets or mix archived redo logs and datafiles into a single backup set.
A backup set is a complete set of backup pieces that constitute a full or
incremental backup of the objects specified in the backup command. Backup
sets are in an RMAN-specific format; image copies, in contrast, are available for use without additional processing.
Each backup piece contains control and checksum information that allows the Oracle server process to validate the backup piece during a restore. A backup set is created by the backup command. A restore command is required to extract files from a backup set.
6249ch05.fm Draft Document for Review May 2, 2001 8:03 pm
Figure 26. backup sets and backup pieces created by RMAN
6.3.1 Full backup
A full backup is a non incremental backup of one or more data files. A full backup has no effect on incremental backups and is not considered to be part of the incremental strategy.
If the database is in ARCHIVELOG mode, you can choose to do full backup while the database is online or offline. If the database is in NOARCHIVELOG mode, the database must be closed by a clean shutdown. Full backups can be taken of: • Data files • Tablespaces • Databases • Control files • Archive logs
Chapter 6. Oracle backup considerations on Unix 77
Draft Document for Review May 2, 2001 8:03 pm 6249ch05.fm
6.3.2 Whole database backup
A whole database backup set contains the control files and all database files that belong to that database. Whole database backups do not require the database to be operated in a specific archiving mode. They can be taken whether a database is operating in ARCHIVELOG or NOARCHIVELOG mode. If the database is in ARCHIVELOG mode, you can choose to back up the database while it is open or closed. If running in NOARCHIVELOG mode, the database must be shut down first. There are two types of whole database backups:
• Consistent whole database backup
A consistent whole database backup is a backup set where all files within it are consistent to the same point in time. A consistent whole database is the only valid backup for databases running in NOARCHIVELOG mode. The only way to take a consistent whole database backup is to shut down the database cleanly and take a backup while the database is offline. • Inconsistent whole database backup
An inconsistent whole database backup is a backup of an online database. It is inconsistent because portions of the databases may have been modified and written to disk during the backup process. The database must be in ARCHIVELOG mode in order to run an inconsistent backup.
6.3.3 Incremental backup
RMAN provides the capability of incrementally backing up databases at the individual block level. An incremental backup is a backup of one or more data files and contains only those blocks that have been modified since a previous backup at the same or lower level.
The multilevel incremental backup feature allows you to create different levels of incremental backups. Each level is denoted by an integer, with 0 being the lowest backup level. An incremental backup performed at a given level backs up only those blocks that have been modified since the last backup at the same or lower level. An incremental backup can be performed on:
After an inconsistent backup is performed, the archived and online redo logs should also be backed up. Inconsistent whole database backups are restored and made consistent by applying any subsequent incremental backups and redo logs, online and archive, during the recovery process.
6249ch05.fm Draft Document for Review May 2, 2001 8:03 pm • Individual data files
• Tablespaces
• The entire database
Incremental backup of control files or archived logs is not supported.
There are two types of incremental backups: noncumulative and cumulative. Noncumulative Incremental Backup: A noncumulative incremental backup backs up only those blocks that have changed since the previous incremental backup at the same or lower level. This is the default mode of operation for incremental backups.
A level 0 backup backs up all blocks that contain data. It performs the same backup as a full backup. A level 0 backup is required for subsequent
incremental backups at other levels. An incremental backup at a level greater than level 0 backs up only those blocks that have changed since a previous incremental backup at the same or lower level. The size of the backup depends on the number of blocks modified.
Figure 27 illustrates part of a monthly cycle of noncumulative incremental backups. The cycle is based on backup levels 0, 1, and 2. A weekly backup is performed at level 0 on Sunday, incremental backups level 2 are performed on monday to wednesday and on friday and saturday, and weekly incremental backups at level 1 on each thursday.
Chapter 6. Oracle backup considerations on Unix 79
Draft Document for Review May 2, 2001 8:03 pm 6249ch05.fm
Figure 27. noncumulative incremental backups Cumulative Incremental Backup:
A cumulative incremental backup at level n contains only blocks that have been changed since the most recent backup at level n - 1 or lower.
Cumulative backups require more storage space than differential backups, but they are preferable during a restore operation because only one backup for a given level is needed. Note that the first incremental backup must be a level 0 backup that contains all used blocks. A cumulative backup at level 2 will contain all blocks changed since the most recent level 1 backup, copying all blocks changed since the base level 0 backup only if a previous level 1 is unavailable. In contrast to a cumulative backup, a differential backup at level 2 will determine which level 1 or level 2 backup occurred most recently and copies all blocks changed since that backup.
6249ch05.fm Draft Document for Review May 2, 2001 8:03 pm
Figure 28. cumulative incremental backups
6.3.4 Image copies
An image copy is a single file (data file, archive log, or control file) that can be used as-is to perform a recovery. It is similar to an operating system copy of a single file except it is produced by an Oracle server process that performs additional tasks such as validating the blocks in the file and registering the copy in the control files. An image copy can be done only to disk.
Image copies are not discussed further in this chapter, because RMAN does not send image copies to TSM - they are always stored local on disk.