Consistent and Inconsistent RMAN Backups Online Backups and Backup Mode Backup Sets Image Copies Multiple Copies of RMAN Backups Control File and Server Parameter File Autobackups Incremental Backups Backup Retention Policies
(A) consistent and inconsistent RMAN backups- The RMAN BACKUP command supports backing up the following types of files: control files and datafiles server parameter files(pfile,spfile) archived redo logs (1)RMAN BACKUP- the output is always either one or more backup sets or one or more image copies. A backup set is an RMAN-specific proprietary format. By default RMAN creates backup sets. whereas an image copy is a bit-for-bit copy of a file. By default, RMAN creates backup sets. (2)Consistent Backups- A consistent backup occurs when the database is in a consistent state. consistent state- SHUTDOWN NORMAL, SHUTDOWN IMMEDIATE, or SHUTDOWN TRANSACTIONAL commands. A consistent shutdown guarantees that all redo has been applied to the datafiles. (3)Inconsistent Backups- A backup made when the database is open is inconsistent. backup made after an instance failure or SHUTDOWN ABORT command. RMAN does not permit to make inconsistent backups when the database is in NOARCHIVELOG mode. When a database is restored from an inconsistent backup, Oracle must perform media recovery before the database can be opened, applying any pending changes from the redo logs.
(b) Online Backups and Backup Mode- RMAN is guaranteed not to back up fractured blocks. fractured blocks- When performing a user-managed backup of an online tablespace or database, an operating system utility can back up a datafile at the same time that database writer is updating the file. It is possible for the utility to read a block in a half- updated state, so that the block that is copied to the backup media is updated in its first half, while the second half contains older data. This type of logical corruption is known as a fractured block, that is, a block that is not consistent with respect to an SCN.
During an RMAN backup, a database server session reads each data block and checks whether it is fractured by comparing the block header and footer. Unlike user-managed tools, RMAN does not require extra logging or backup mode because it knows the format of data blocks. RMAN does not need to freeze the datafile header checkpoint because it knows the order in which the blocks will be read, which enables it to capture a known good checkpoint for the file. (C)BACKUP SET- This section contains the following topics: Backup Sets and Backup Pieces Compression for Backup Sets Encryption for Backup Sets Filenames for Backup Pieces Number and Size of Backup Pieces Number and Size of Backup Sets Multiplexed Backup Sets Proxy Copies
(1) Backup Sets and Backup Pieces- BACKUP SET-RMAN can store backup data in a logical structure called a backup set, which is the smallest unit of an RMAN backup. BACKUP PIECE-A backup set contains one or more binary files in an RMAN-specific format. This file is known as a backup piece.backup piece contains data blocks. MULTISECTION BACKUP- This is a backup of a single large file, produced by multiple channels in parallel, each of which produces one backup piece. Each backup piece contains one file section of the file being backed up. The purpose of multisection backups is to enable multiple channels to back up a large file in parallel. FILE SECTION- A contiguous range of blocks in a datafile. A multisection backup processes a large file in parallel by copying each section to a separate backup piece. (2)Compression for Backup Sets- RMAN can use unused block compression to skip datafile blocks. RMAN always skips blocks that have never been used RMAN also skips blocks that are not currently used. RMAN also supports binary compression of backup sets.
RMAN supported algorithms are. (1)BZIP2- The BZIP2 algorithm is optimized for maximum compression. BZIP2 consumes more CPU resource than ZLIB , but will usually produce more compact backups. (2)ZLIB- ZLIB algorithm is optimized for CPU efficiency. The COMPATIBLE initialization parameter must be set to 11.0.0 or higher for ZLIB compression, which requires the Oracle Advanced Compression option. (3) Encryption for Backup Sets- RMAN supports backup encryption for backup sets. (1)WALLET-BASED ENCRYPTION- Wallet-based encryption is more secure than password-based encryption because no passwords are involved. (2)PASSWORD- BASED ENCRYPTION- You should use password-based encryption only when absolutely necessary because your backups need to be transportable. (4) Filenames for Backup Pieces- RMAN automatically(by default) generates a unique filename with the %U substitution variable in the default backup location. we can let RMAN determine a unique name for backup pieces or use the FORMAT clause to specify a name. example- /uo1/app/oracle/product/11.2.0/db_1/dbs/rman/2007_12_12/o1_mf_nnndf_TAG20071212T162825_2qyl9 (5) Number and Size of Backup Pieces- By default a backup set contains one backup piece. To restrict the size of each backup piece, specify the MAXPIECESIZE option of the CONFIGURE CHANNEL or ALLOCATE CHANNEL commands. if RMAN backup set size > backup piece size - RMAN creates multiple physical pieces to hold the backup set contents. Note that if you specify the SECTION SIZE parameter on the BACKUP command, then RMAN can create a multisection backup. In this case, a single backup set can contain multiple backup pieces, each containing a file section. (6)Number and Size of Backup set- backupSpec clause of the BACKUP command to specify the objects to be backed up. Each backupSpec clause produces at least one backup set. we can influence RMAN behavior with the MAXSETSIZE parameter in the CONFIGURE or BACKUP command.
(7)Multiplexed Backup set- RMAN can read from two datafiles simultaneously, and then combine the blocks from these datafiles into a single backup piece. The combination of blocks from multiple files is called backupmultiplexing. Image copies, by contrast, are never multiplexed. Datafile multiplexing-
RMAN can back up three datafiles into a backup set that contains only one backup piece. This backup piece contains the intermingled data blocks of the three input datafiles. RMAN multiplexing is determined by several factors. (1) FILESPERSET parameter- BACKUP command determines how many datafiles to put in each backup set. (a) Number of files in each backup set. The FILESPERSET default is 64. (2) MAXOPENFILES parameter of ALLOCATE CHANNEL or CONFIGURE CHANNEL- CHANNEL defines how many datafiles RMAN can read from simultaneously. The basic multiplexing algorithm is as follows: (a) The level of multiplexing- This is the number of input files simultaneously read and then written into the same backup piece. The MAXOPENFILES default is 8. EXAMPLE- Suppose that you back up 12 datafiles with one channel. The number of files in each backup set is 4. The level of multiplexing is the lesser of this number and 8. Thus, the channel simultaneously writes blocks from 4 datafiles into each backup piece. (8) Proxy Copies- During a proxy copy, RMAN turns over control of the data transfer to a media manager that supports this feature. Proxy copy can only be used with media managers that support it and cannot be used with channels of type DISK. The PROXY option of the BACKUP command specifies that a backup should be a proxy copy. (D) Image Copies- An image copy is an exact copy of a single datafile, archived redo log file, or control file Image copies are not stored in an RMAN-specific format. They are identical to the results of copying a file with operating system commands. Image copies are always full backups because they include every data block in a datafile. Image copy can also use with non-RMAN restore and recovery techniques. (1)RMAN- created image copy- RMAN BACKUP AS COPY command- To create image copies and have them recorded in the RMAN repository. A database server session is used to create the copy. As with backup pieces, FORMAT variables are also used to specify the names of image copies. RESTORE command-by default RMAN restores a datafile or control file to its original location by copying an image copy backup to that location because of the extra overhead of reading through an entire backup set in search of files to be restored. (2)USER-managed image copy- RMAN can use image copies created by mechanisms outside of RMAN(copy commands or third-party utilities) You can use the CATALOG command to inspect an existing image copy and enter its metadata into the RMAN repository. After you catalog these files, you can use them with the RESTORE or SWITCH commands just as you can for RMAN-generated image copies. (E) Control File and Server Parameter File Autobackups- control file autobackup-RMAN can restore the control file from the autobackup. If CONFIGURE CONTROLFILE AUTOBACKUP is ON, then RMAN automatically backs up the control file and the current server parameter file (if used to start up the database) at the end of a successful BACKUP command. ARCHIVELOG mode-RMAN makes control file autobackups when a structural change to the database affects the contents of the control file. Control file autobackups are never duplexed.
(F) Incremental Backups- an incremental backup copies only those data blocks that have changed since a previous backup. RMAN use to create incremental backups of datafiles, tablespaces, or the whole database. RMAN can create multilevel incremental backups. (A) Multilevel Incremental Backups- Each incremental level is denoted by a value of 0 or 1. A level 0 incremental backup, which is the base for subsequent incremental backups, copies all blocks containing data(backup set or image copy). A level 1 incremental backup can be either of the following types: (A) differential incremental backup-backs up all blocks changed after the most recent incremental backup at level 1 or 0. RMAN backs up all blocks that have changed since the most recent incremental backup at level 1 (cumulative or differential) or level 0. example - in a differential level 1 backup, RMAN determines which level 1 backup occurred most recently and backs up all blocks modified after that backup. If no level 1 is available, then RMAN copies all blocks changed since the base level 0 backup.
1.SUNDAY-An incremental level 0 backup backs up all blocks that have ever been in use in this database. 2.MONDAY-SATURDAY-An incremental level 1 backup all blocks that have changed since the most recent incremental backup at level 1 or 0. (B) Cumulative Incremental Backups-In a cumulative level 1 backup, RMAN backs up all blocks used since the most recent level 0 incremental backup.
1.SUNDAY-An incremental level 0 backup backs up all blocks that have ever been in use in this database. 2.MONDAY-SATURDAY-A cumulative incremental level 1 backup copies all blocks changed since the most recent level 0 backup. 3. Block Change Tracking- The block change tracking feature for incremental backups improves incremental backup performance by recording changed blocks in each datafile in a block change tracking file. This file is a small binary file stored in the database area. RMAN tracks changed blocks as redo is generated. RMAN only uses block change tracking when the incremental level is greater than 0 because a level 0 incremental backup includes all blocks. 4. Incremental Backup Algorithm- Checkpoint SCN - Every datafile has a datafile checkpoint SCN. When a level 0 incremental backup is restored, the restored datafile contains the checkpoint SCN that it had when the level 0 was created. Incremental start SCN -This SCN applies only to level 1 incremental backups. All blocks whose SCN is greater than or equal to the incremental start SCN are included in the backup. Blocks whose SCN is lower than the incremental start SCN are not included in the backup. Block SCN - Every data block in a datafile records the SCN at which the most recent change was made to the block. When RMAN makes a level 1 incremental backup of a file, RMAN reads the file, examines the SCN of every block, and backs up blocks whose SCN is greater than or equal to the incremental start SCN for this backup. If the backup is differential, then the incremental start SCN is the checkpoint SCN of the most recent level 1 backup If the backup is cumulative, then the incremental start SCN is the checkpoint SCN of the most recent level 0 backup. RMAN applies all blocks containing changed data during recovery, even if the change is to an object created with the NOLOGGING option. incremental backups are the only way to recover nologging changes. (g) Backup Retention Policies- CONFIGURE RETENTION POLICY -command to create a persistent and automatic backup retention policy. Obsolete Backups-As you produce backups over time, older backups become obsolete as they are no longer needed to satisfy the retention policy.Obsolete backups based on retention policy configured. Expired backups- A backup is considered an expired backup only when RMAN performs a crosscheck and cannot find the file. There are two mutually exclusive options for implementing a retention policy: (A) Recovery Window- A recovery window is a period of time that begins with the current time and extends backward in time to the point of recoverability. example- CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS; (B) Backup Redundancy- a redundancy-based retention policy specifies how many backups of each datafile must be retained. For example, you can configure a redundancy of 2 as follows: example- CONFIGURE RETENTION POLICY TO REDUNDANCY 2; (1)Backup Retention Policy and Flash Recovery Area Deletion Rule- If you configure a flash recovery area, then the database uses an internal algorithm to select files in the flash recovery area that are no longer needed to meet the configured retention policy. These backups have status OBSOLETE and are eligible for deletion.