A recovery catalog is required for KEEP FOREVER, but is not required for any other KEEP option.

For example, if you specify KEEP UNTIL TIME '01-JAN-13', then the backup is obsolete one second after midnight on January 1, 2013. Select the PDBs that you want to back up by following these steps: Click Add to display the Available Pluggable Databases page. The destination CDB does not manage backups created on the source CDB after it has been plugged in to the destination CDB. RMAN deletes all copies of any log that it backed up from both the fast recovery area and the other archiving destinations. Oracle Data Guard Concepts and Administration to learn about archived redo log management with standby databases, Oracle Database Backup and Recovery Reference to learn about the CONFIGURE ARCHIVELOG DELETION POLICY and DELETE ARCHIVELOG commands, Deleting RMAN Backups and Archived Redo Logs. For example, enter the following command: Only one backup set is shown in this output, but there are now two copies of it. When you connect to the root and back up a PDB, this backup is visible to the root and to that particular PDB but not to the other PDBs. Although the content of the backups is the same, BACKUP DATABASE and BACKUP INCREMENTAL LEVEL 0 DATABASE are different. After the third run of the script, the following files are available for a point-in-time recovery: An image copy of the database, as of the checkpoint SCN of the preceding run of the script, 24 hours earlier, An incremental backup for the changes after the checkpoint SCN of the preceding run, Archived redo logs including all changes between the checkpoint SCN of the image copy and the current time. In an Oracle Real Application Clusters (Oracle RAC) environment, the change tracking file must be located on shared storage accessible from all nodes in the cluster. Note the following additional details about Example 9-15: Each time a data file is added to the database, an image copy of the new data file is created the next time the script runs. Oracle Database Backup and Recovery Reference to learn about the FORMAT clause, and the installation guides in the Oracle Database documentation library to learn about the default file locations for your platform. From the Customized Backup section, select Pluggable Databases, and then click Schedule Customized Backup. You can use the RMAN BACKUP INCREMENTAL FROM SCN command to create a backup on the primary database that starts at the current SCN of the standby database, which you can then use to roll forward the standby database. Start RMAN and connect to a target database and a recovery catalog (if used) as described in. Oracle Database Backup and Recovery Reference for information about the BACKUP command. To create level 0 multisection incremental backups, the COMPATIBLE parameter must be set to 11.0 or higher.

You may want to exclude specified tablespaces from a whole database backup. All existing RMAN backups are usable after their metadata is exported into the data dictionary by using the dbms_pdb.exportrmanbackup() procedure. The following example makes a differential incremental backup at level 1 of the SYSTEM and tools tablespaces. Execute BACKUP with SECTION SIZE to indicate that a multisection backup must be created. The BACKUP command takes a DEVICE TYPE clause that specifies whether to back up to disk or tape device. For an Oracle RAC environment, it is 1/30,000 of the size of the database, times the number of enabled threads. You might want to perform nightly backups of the whole multitenant container database (CDB) by using an incremental backup strategy, or you might want to make frequent separate backups of individual PDBs and do less frequent backups of either the whole CDB or of the root. The following example backs up the CDB, switches the online redo logs, and includes archived logs in the backup: Proxy PDBs are not backed up while backing up a CDB. This approach enables you to back up multiple PDBs with a single command. For example, if you run a daily backup script, then you never have more than 1 day of redo to apply for media recovery. Tags do not need to be unique, so multiple backup sets or image copies can have the same tag (for example, weekly_backup). Connect to the root as a common user with the SYSDBA or SYSBACKUP privilege. To back up a sparse PDB while connected to root: Start RMAN and connect to the root as a common user with the SYSBACKUP or SYSDBA privilege as described in Connecting as Target to the Root. For example, you can tag data file copies that you intend to use in a SWITCH command as for_switch_only and file copies to use only for a RESTORE command as for_restore_only. Oracle Database Administrators Reference for Microsoft Windows to learn how to make VSS backups with RMAN. For the following procedure, assume that you archive to /arc_dest1, /arc_dest2, and the fast recovery area. Note the following characteristics of the BACKUP KEEP command: It automatically backs up the data files, control file (even if the control file autobackup is disabled), and the server parameter file.

The COMPATIBLE initialization parameter of the database being backed up must be set to 12.2 or higher. To back up archived redo logs that need backups: Backup Optimization and the CONFIGURE command, Configuring an Archived Redo Log Deletion Policy, Using Backup Optimization to Skip Files for scenarios using NOT BACKED UP. About Backups of Archived Redo Logs for non-CDBs, About Backup of Archived Redo Logs in CDBs, Backing Up Archived Redo Log Files in non-CDBs, Backing Up Only Archived Redo Logs That Need Backups in non-CDBs, Deleting Archived Redo Logs After Backups in non-CDBs, Deleting Archived Redo Logs After Backups in CDBs. If no other conditions in this list apply, then the default location and file name format of the backup are platform-specific. However, unknown to RMAN, a user deletes logs 122 and 124 from the /arch1 directory. The size of the block change tracking file can increase and decrease as the database changes. The following command creates a multisection incremental backup of the entire database using image copies. Use the SECTION SIZE clause of the BACKUP command to create multisection backups. The database copy is updated with the incremental backup made 7 days ago, bringing the copy up to the checkpoint SCN of the level 1 incremental backup. Ensure that the target database is mounted or open. If you must restore and recover your database during the following 24 hours, then you can restore the data files from the incrementally updated data file copies. By archiving the logs immediately after the backup, you ensure that you have a full set of archived logs through the time of the backup. You can query the V$BLOCK_CHANGE_TRACKING view to determine whether change tracking is enabled, and if it is, the file name of the block change tracking file. RMAN can restore this incremental forever and apply changes from the redo log. See Oracle Data Guard Concepts and Administration to learn how to apply incremental backups to a standby database. The level 1 incremental backup made yesterday is applied to the database copy, bringing the copy up to the checkpoint SCN of the level 1 incremental backup. Start RMAN and connect to a target database and a recovery catalog (if used). The command is best understood in a sample script that implements the strategy. The TAG clause specifies the backup tag that is used to identify this RMAN backup. Example 9-10 Backing Up a Tablespace and Current Control File to Tape. Configuring the Snapshot Control File Location, Making a Manual Backup of the Control File. To back up one or more PDBs with Cloud Control, complete the following steps: From the Database Home page, select Backup & Recovery from the Availability menu, and then select Schedule Backup. Starting with Oracle Database 12c Release 1 (12.1), you can create multisection full backups that are stored as image copies. cdb_prod is the net service name of the CDB. The V$BACKUP_DATAFILE and RC_BACKUP_DATAFILE views provide information about the number of blocks in each section of a multisection backup. In this way, you guarantee that you can perform media recovery after restoring this backup. RMAN enables you to use the BACKUP command to perform backup operations on the application root, one or more application PDBs, and the application container. In this case, you lose the contents of the existing block change tracking file. When you specify a tag for image copies, the tag applies to each individual copy. The BACKED UP clause is a convenient way to back up archived logs to a specified device type. If integer backups of the logs exist, then the BACKUP ARCHIVELOG command skips the logs. This example backs up the entire database and archived logs to the configured default backup destination (disk or tape), producing compressed backup sets. SKIP to skip inaccessible data files or data files that are in offline or read-only tablespaces. An incremental backup is either a cumulative incremental backup or a differential incremental backup. The size of the block change tracking file is proportional to the size of the database and the number of enabled threads of redo. However, the output of this operation is one copy for each data file. To delete archived redo logs after a backup: Assume that you run the following BACKUP command: In this case, RMAN backs up only one copy of each log sequence number in these archiving locations. Tags are stored in uppercase, regardless of the case used when entering them. You can specify the temporary status of the backup with the BACKUP KEEP UNTIL parameter. The database performs a bitmap switch before each backup. Connect to the root as a common user with the SYSBACKUP or SYSDBA privilege and to a recovery catalog (if used), as described in Connecting as Target to the Root. Typically, you do not need to specify a format when backing up to tape because the default %U variable generates a unique file name for tape backups. If you specify DELETE INPUT rather than DELETE ALL INPUT, then RMAN only deletes the specific archived redo log files that it backed up. Use the following steps to back up the root with Cloud Control: Cloud Control displays the Schedule Backup page. If the database instance is not started, then either mount or open the database. Table 9-1 shows the archived redo log records in the control file. The example creates a normal restore point, which is a label for the time to which the backup is recovered. If the deletion policy is configured with the BACKED UP integer TIMES clause, then a BACKUP ARCHIVELOG command copies the logs unless integer backups exist on the specified device type. For example, RMAN deletes the logs in /arc_dest1 if these files were used as the source of the backup, but leave the contents of the /arc_dest2 intact. Primary and standby control file backups are interchangeable. You can also make backups to preserve data for long-time archival, as explained in "Making Database Backups for Long-Term Storage", and to transfer data, as explained in the chapters included in Transferring Data with RMAN. The COMPATIBLE parameter for the CDB must be set to 12.2 or higher. For example, another user might want a copy of the database for reporting or testing. Start SQL*Plus and connect to a target database with administrator privileges. Connect to the PDB as a local user with the SYSBACKUP or SYSDBA privilege and to a recovery catalog (if used), as described in Connecting as Target to a PDB. The following command creates a preplugin backup of my_pdb, including the archived redo log files. Click Select None to deselect all PDBs. If the database is in NOARCHIVELOG mode, then RMAN can make incremental backups only after a consistent shutdown. Incremental backups of a standby and primary database are interchangeable. Example 9-5 Applying Tags to Image Copies. The BACKUP ARCHIVELOG DELETE INPUT command deletes archived log files after they are backed up. In a CDB, archived redo logs can be backed up only when you connect to the root as a common user with the SYSDBA or SYSBACKUP privilege. For example: Using host operating system commands, move the block change tracking file to its new location. This task is especially important when the database uses a fast recovery area so that the space can be reused as needed. The command makes an incremental level 1 backup and assigns it the tag incr_update. You set the default device with the CONFIGURE DEFAULT DEVICE TYPE command. The tag used when naming the backups is mypdb_bkup. A multisection backup enables large data files to be divided into sections that can be backed up in parallel across multiple channels. Recovery files are full and incremental backup sets, control file autobackups, data file copies, and archived redo logs. One purpose of an archival backup is to create a test database. After starting RMAN, run the BACKUP INCREMENTAL command at the RMAN prompt. Block change tracking does not change the commands used to perform incremental backups. The following example backs up the server parameter file to tape: You can only back up a database in NOARCHIVELOG mode when the database is closed and in a consistent state. By default incremental backups are differential. You can back up all or part of your database with the BACKUP command from within the RMAN client. You can also place the block change tracking file in any location that you choose, by specifying its name when enabling block change tracking. In many cases, after your database has been configured in accordance with your backup strategy, you can back up the database by entering the following command at the RMAN prompt: RMAN uses the configured settings, the records of previous backups, and the control file record of the database structure to determine an efficient set of steps for the backup. The preceding commands are especially useful in the following scenarios: Ensuring that all backups exist both on disk and on tape. An incremental backup copies only data file blocks that have changed since a specified previous backup. If the control file block size is different from the block size for data file 1, then the control file cannot be written into the same backup set as the data file. If a media failure or disaster occurs, then you can restore your backups and recover lost changes. Specifying the %U substitution variable is the easiest way to meet this requirement. This chapter explains how to perform the most basic backup tasks and implement backup strategies using RMAN. Note two important features: The BACKUP command in Example 9-15 does not always create a level 1 incremental backup. Archived redo logs are the key to successful media recovery. When backup sets are used, you can create multisection full or incremental backups. The database must have been started with a server parameter file. In a Data Guard environment, you can offload incremental backups to a physical standby database. In the target database, connect to SQL*Plus as a user with the, Export the RMAN backup metadata for the non-CDB into its data dictionary by using the, Start RMAN and connect to the root as a common user with the, If you have not logged in to the database previously, then the Database Login page is displayed. Even if your redo logs are being archived to multiple destinations and you use RMAN to back up archived redo logs, RMAN selects only one copy of the archived redo log file to include in the backup set. When deciding how often to take level 0 backups, a general rule is to take a new level 0 backup whenever 20% or more of the data has changed. Using Block Change Tracking to Improve Incremental Backup Performance. The script in Example 9-15, run regularly, is all that is required to implement a strategy based on incrementally updated backups. You can back up one or more tablespaces with the BACKUP TABLESPACE command or one or more data files with the BACKUP DATAFILE command. For example, you can implement a three-level backup scheme so that a level 0 backup is taken monthly, a cumulative level 1 is taken weekly, and a differential level 1 is taken daily. The log backup contains just those archived logs needed to restore this backup to a consistent state. A database copy now exists, but no incremental level 1 backup exists with which to recover it. For disk backups of the recovery files, you must use the TO DESTINATION option. RMAN makes a control file autobackup after the files specified in the BACKUP command are backed up. To connect to the CDB and back up the application root and all its application PDBs: To connect to the application root and back up the application root and all its application PDBs: Start RMAN and establish one of the following types of connections: Start RMAN and connect to a target database as described in, Start RMAN and connect to a target database. Use the SECTION SIZE clause to create multisection backups. This backup contains blocks that changed between yesterday and today. After the maximum of eight bitmaps is reached, the oldest bitmap is overwritten by the bitmap that tracks the current changes. Another strategy is to use incrementally updated backups, as explained in "Incrementally Updating Backups". If backup optimization is enabled, then RMAN skips backups of archived logs that have already been backed up to the specified device. To determine the number of backups for a file, RMAN only considers backups created on the same device type as the current backup. No RMAN command can change a full backup into a level 0 incremental backup. Assume that you want to make a backup and then restore it to a new host the same day. If control file autobackup is enabled, then RMAN writes the current control file and server parameter file to a separate autobackup piece. You must use a third-party backup program other than RMAN to make VSS snapshots with the Oracle VSS writer. The following SQL query determines the number of blocks written to an incremental level 1 backup of each data file with at least 20% of its blocks backed up: Compare the number of blocks in level 1 backups to a level 0 backup. When you run the script, you can dynamically set the name of the restore point, backup format, and so on. Backing Up a Whole Database with RMAN for more information on how to perform a traditional backup on a normal database, Performing Complete Recovery of a Sparse Database, Oracle Database Backup and Recovery Reference for more information on the options to back up sparse databases. These backups copy the latest updates from the delta storage space assigned to each database. In this strategy, you create an image copy of each data file, and then periodically roll forward this copy by making and then applying a level 1 incremental backup. Oracle recommends against using a raw device (that is, a disk without a file system) as a change tracking file. A snapshot control file is not needed for an image copy. The first level 0 incremental backup scans the entire data file. RMAN incremental backups provide multiple benefits. The following example makes a level 0 incremental database backup. This example backs up the control file copy created in the previous example to tape: A snapshot control file is not needed when backing up a control file copy. Preplugin backups of a PDB can be used to perform restore and recover operations after the PDB is migrated and plugged in to a different destination CDB. With DELETE ALL INPUT, RMAN deletes each backed-up archived redo log file from all log archiving destinations. Connect to the CDB root as a common user with the SYSDBA or SYSBACKUP privilege. In an Oracle Real Application Clusters (Oracle RAC) environment, the following restrictions apply: The snapshot control file location must be on shared storagethat is, storage that is accessible by all Oracle RAC instances. Configure an archived redo log deletion policy. The following example backs up the database and all archived redo logs: The following example uses a configured disk or SBT channel to back up one copy of each log sequence number for all archived redo logs: You can also specify a range of archived redo logs by time, SCN, or log sequence number, as in the following example: You can indicate that RMAN should automatically skip backups of archived redo logs. By reading this small bitmap file to determine which blocks changed, RMAN avoids having to scan every block in the data file that it is backing up. Table 9-2 Effect of Basic Script When Run Daily. The format of the tag is TAGYYYYMMDDTHHMMSS, where YYYY is the year, MM is the month, DD is the day, HH is the hour (in 24-hour format), MM is the minutes, and SS is the seconds. The control file autobackup contains metadata about the previous backup, which is crucial for disaster recovery. You can also use the KEEP and NOKEEP options of the CHANGE command to change the status of an existing backup. Ensure you meet the following requirements before backing up a sparse database: To create your backup in the backup set format, use the, To create your backup in the image copy format use the, To create your backup in the compressed backup set format use the, While backing up tablespaces, RMAN translates the, Ensure that the database containing the sparse tablespace or data file has the, You can back up a sparse multitenant container database (CDB) or a CDB containing some sparse pluggable databases (PDBs) by performing a backup operation similar to backing up a sparse database using the, Oracle Data Guard Concepts and Administration. The preceding steps guarantee that data file backups taken during the command are recoverable to a consistent state. To understand the script and the strategy, you must understand the effects of these two commands when no data file copies or incremental backups exist. Oracle Database Concepts for conceptual information about application containers, Oracle Database Administrators Guide for information about creating application containers. You can also use BACKUP RECOVERY AREA to back up recovery files created in the current and all previous fast recovery area destinations. If the compatibility parameter for CDBs and PDBs is set to 12.2 or higher, RMAN also enables you to perform sparse backups on your CDB and PDB. You are performing your backups to some device over a network when reduced network bandwidth is more important than CPU usage. Choose a backup strategy according to an acceptable MTTR (mean time to recover). Example 9-16 shows how to maintain a window of 7 days by specifying the beginning time of your window of recoverability in the RECOVER command. You can use the Volume Shadow Copy Service (VSS) with the Oracle VSS writer to make a shadow copy or snapshot of files in a database. If you specify an UNTIL TIME of 9:00 p.m, then the backup is obsolete at 9:01 p.m. For a recovery window retention policy, either all of the copies of a backup set are obsolete, or none of them are. The output of this command can be either backup sets or image copies, so you can generate backup sets from image copies. You can back up one or more tablespaces containing sparse data files or individual sparse data files using the BACKUP command. For example: Start RMAN and connect to a target database and recovery catalog. Thus, you can apply an incremental backup of a standby database to a primary database, or apply an incremental backup of a primary database to a standby database. The base (read-only) data files in a sparse database are not encrypted. SYSDATE-7 now specifies a date after the base copy was created. Start RMAN and connect to the target database (non-CDB) as a user with the, Ensure that the required prerequisites are met as described in, (Optional) Configure autobackups for the database control file and server parameter file as described in. Oracle Database Administrators Guide for more information about NOLOGGING mode. Making an Archival Backup for Long-Term Storage. If the section size that you specify is larger than the size of the file, then RMAN does not use multisection backups for that file. Use the BACKUP command to create incremental backups. Ensure that the CDB is open or mounted. Backing Up the Application Root and its Application PDBs. Multisection full backups of databases and data files are supported starting with Oracle Database 11g Release 1. Backing Up Sparse Tablespaces and Data Files with RMAN. If you specify UNTIL, then RMAN marks the backup as obsolete when the UNTIL time has passed, regardless of any configured retention policy. In terms of the ability to recover from data loss, separately backing up the root and all PDBs, including the CDB seed, is equivalent to backing up the whole CDB. This chapter contains the following topics: Making and Updating RMAN Incremental Backups, Making Database Backups for Long-Term Storage, Backing Up the Database: Advanced Topics to learn about more advanced topics such as backup optimization, duplexing, backup encryption, and restartable backups, Oracle Data Guard Concepts and Administration to learn how to perform RMAN backup and recovery in a Data Guard environment. Create a full image copy backup of a data file with a specified tag. The application root serves as the parent container to all the application PDBs plugged into it. If you connect to a PDB, you can back up only data files in that PDB. The BLOCKS column specifies the number of blocks in each multisection backup. This section assumes that the block change tracking feature is currently enabled. RMAN can back up application containers, application PDBs, and the application root. RMAN always creates multisection incremental backups with FILESPERSET set to 1. The following command backs up the PDB when you are connected to the PDB as a local user with the SYSDBA or SYSBACKUP privilege: The following command backs up the PDB my_pdb when connected to the ROOT as a common user with the SYSDBA or SYSBACKUP privilege: When you use BACKUP PLUGGABLE DATABASE, all the required archived redo logs are backed up only when the CDB uses local undo. Optionally, you can remove PDBs from the table by clicking in the Select column for each PDB that you want to remove and then clicking Remove. A full backup is not usable as part of an incremental strategy, whereas a level 0 incremental backup is the basis of an incremental strategy. The RECOVER command in Example 9-15 causes RMAN to apply any available incremental level 1 backups with the specified tag to a set of data file copies with the same tag. For example, if you specify that logs be deleted only when backed up at least twice to tape, then BACKUP DELETE honors this policy. If backup optimization is not enabled, then RMAN backs up the logs generated in Step 1 plus all the logs generated during the backup. If you have not logged in to the database previously, then the Database Login page is displayed. The BACKUP BACKUPSET command creates additional copies of backup pieces in a backup set, but does not create a new backup set. Because the root contains critical metadata for the whole CDB, Oracle recommends that you back up the root or back up the whole CDB at regular intervals. About Sparse Backups for more information on sparse backups. Preplugin backups can be either tape and disk backups. Log in to the database using Named or New credentials and then click Login. Back up any remaining archived logs generated during the backup. The BACKUP command is used to back up CDBs. The procedure in this section assumes that you have configured an SBT device as your default device. It supports an optional RESTORE POINT clause that creates a normal restore point, which is a label for an SCN to which the backup must be recovered to be made consistent. The following example backs up the tablespaces users and examples to the configured default device. To make an open database backup of archived redo logs that includes the most recent online redo log, you can execute the BACKUP command with any of the following clauses: Before beginning the backup, RMAN switches out of the current redo log group, and archives all online redo logs that have not yet been archived, up to and including the redo log group that was current when the command was issued. Generate a report to see the effect of these copies under a redundancy-based backup retention policy.