If you restore and recover the whole database or a subset, then the database resets the block change tracking file and starts tracking changes again. An incremental backup copies only data file blocks that have changed since a specified previous backup. Tags cannot use operating system environment variables or use special formats such as %T or %D. RMAN uses a snapshot control file to ensure a read-consistent version. Oracle recommends against using a raw device (that is, a disk without a file system) as a change tracking file. These backups copy the latest updates from the delta storage space assigned to each database. 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. The command makes an incremental level 1 backup and assigns it the tag incr_update. If the FORMAT, POOL, or TAG parameters are specified, then they are used for all backups. An incremental backup can be optimized only when it is based on a parent backup that was made after the start of the oldest bitmap in the block change tracking file. You are performing your backups to some device over a network when reduced network bandwidth is more important than CPU usage. You can skip tablespaces, such as read-only tablespaces, but any skipped tablespace that has not been offline or read-only since its last backup is lost if the database has to be restored from a backup. For a recovery window retention policy, either all of the copies of a backup set are obsolete, or none of them are. After starting RMAN, run the BACKUP INCREMENTAL command at the RMAN prompt. If backups of the non-CDB already exist, then you can just create backups of the archived redo log files. The size of the block change tracking file is proportional to the size of the database and the number of enabled threads of redo. The tag used when naming the backups is mypdb_bkup. Transportable tablespaces do not have to be in read/write mode for backup as in previous releases. Many forms of the BACKUP command let you associate a tag with a backup, and many RESTORE and RECOVER commands let you specify a tag to restrict which backups to use in the RESTORE or RECOVER operation. If the autobackup feature is not set, then you must manually back up the control file in one of the following ways: Include a backup of the control file within any backup by using the INCLUDE CURRENT CONTROLFILE option of the BACKUP command. This statement is true even if there are multiple copies of the backup pieces that form the backup set, such as when a backup set has been backed up from disk to tape. Oracle Database Backup and Recovery Reference to learn about the CONFIGURE CONTROLFILE AUTOBACKUP command. See Oracle Data Guard Concepts and Administration to learn how to use RMAN to restore files on a standby database. If block change tracking is enabled on a primary or standby database, then RMAN uses a block change tracking file to identify changed blocks for incremental backups. For example, on Wednesday SYSDATE-7 specifies the Wednesday before Monday 1/1. Subsequent incremental backups use the block change tracking file to scan only the blocks that have been marked as changed since the last backup. However, it is recommended that you back up the archived redo log files. To create incremental backups for use in an incrementally updated backup strategy, use the BACKUP FOR RECOVER OF COPY WITH TAG form of the BACKUP command. User-specified tags are a useful way to indicate the purpose or usage of different classes of backups or copies. RMAN can apply incremental backups during recovery transparently. You set the default device with the CONFIGURE DEFAULT DEVICE TYPE 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. Oracle Database Backup and Recovery Reference for information about the BACKUP command. You can only enable block change tracking at a physical standby database if a license for the Oracle Active Data Guard option is enabled. Example 9-10 Backing Up a Tablespace and Current Control File to Tape. Execute the BACKUP ARCHIVELOG command with the NOT BACKED UP clause. Making an Archival Backup for Long-Term Storage. If the control file autobackup feature is enabled, then RMAN makes two control file backups in these examples: the explicit backup of the files specified in the BACKUP command and the control file and server parameter file autobackup. Binary compression consumes CPU resources, so do not routinely schedule compressed backups when CPU usage is high. Starting with Oracle Database Release 18c, you can create preplugin backups of non-CDBs. If a media failure or disaster occurs, then you can restore your backups and recover lost changes. Backing up a whole multitenant container database (CDB) is similar to backing up a non-CDB. Apply the incremental backup to the most recent backup with the same tag. However, you cannot backup or switch archived redo log files when connected to a PDB. See "Overview of Files in the Fast Recovery Area" to learn about the database area and fast recovery area. Note two important features: The BACKUP command in Example 9-15 does not always create a level 1 incremental backup. Use the following steps to back up the root with Cloud Control: Cloud Control displays the Schedule Backup page. Execute the BACKUP ARCHIVELOG or BACKUP PLUS ARCHIVELOG command. Because you have the daily level 1 incremental backups, you never need to apply more than 1 day of redo. To delete archived redo logs in a CDB after they are backed up: Start RMAN and connect to the root as a user with the SYSDBA or SYSBACKUP privilege as described in Making Database Connections with RMAN. No copy of the backup set is reported as obsolete or based on the CHECKPOINT_CHANGE# of this backup set, with the current time and the availability of other backups. You must use tags to identify the data file copies and incremental backups in this strategy so that they do not interfere with other backup strategies. 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.
For each data file, a minimum of 320 kilobytes of space is allocated in the block change tracking file, regardless of the size of the data file. This example creates one backup set with the tag MONDAYBKP.
Use the BACKUP command to create incremental backups. This feature ensures that the backup contains all redo generated before the start of the command. If you have not logged in to the database previously, then the Database Login page is displayed. The following example makes a level 0 incremental database backup. Use the BACKUP BACKUPSET command to copy backup sets from disk to tape. If multiple backup sets are created by one BACKUP command, then each backup piece has the same default tag. 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. For example, assume that you archive logs 121 through 124 to two destinations: /arch1 and /arch2. 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. To create a preplugin backup of a non-CDB: Connect to a recovery catalog if one is used. Thus, the RECOVER command has no effect. The following factors that may cause the file to be larger than this estimate suggests: To avoid the overhead of allocating space as your database grows, the block change tracking file size starts at 10 megabytes. However, the output of this operation is one copy for each data file. 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. Connect to the sparse PDB as a, To back up a tablespace from a sparse PDB, connect to the selected PDB directly and then run the, To back up a data file from a sparse PDB, you can either connect to root or directly to the PDB. The BACKUP command is used to back up one or more application PDBs. Another purpose of an archival backup is to create a backup that you want to restore for testing purposes and then delete. The control file autobackup has a copy of the restore point, so it can be referenced as soon as the control file is restored. All existing RMAN backups are usable after their metadata is exported into the data dictionary by using the dbms_pdb.exportrmanbackup() procedure. For more information about each page of the wizard, click, Start RMAN and connect using one of the following techniques as described in, (Optional) Configure control file and server parameter file autobackups for the target database as described in. For a backup retention policy based on redundancy, a backup set is counted as one instance of a backup. Ensure that the target CDB is mounted or open. Issue a BACKUP PLUGGABLE DATABASE command at the RMAN prompt. Preplugin backups ensure that an RMAN backup is usable after a non-CDB is plugged in as a PDB into a CDB. 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. Backups created when connected to any PDB are visible when connected to the root. 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. Run the. See Oracle Data Guard Concepts and Administration to learn how to apply incremental backups to a standby database. The SCN is captured just after the data file backups complete. Click Next to move to the Options page of the wizard. You can use the BACKUP INCREMENTAL LEVEL 1 FROM SCN command in RMAN to create incremental backups in the fast recovery area. This section provides an overview of RMAN backups. 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. Multisection backups provide better performance by using multiple channels to back up large files in parallel. This task is especially important when the database uses a fast recovery area so that the space can be reused as needed. Create a full backup of the PDB including the archived redo log files. The following example backs up the database, switches the online redo logs, and includes archived logs in the backup: 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. To determine the number of backups for a file, RMAN only considers backups created on the same device type as the current backup. This section explains the basic concepts and tasks involved in making backups for long-term storage. 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. You can back up all or part of your database with the BACKUP command from within the RMAN client. If the rate of change to your database is predictable, then you can observe the size of your incremental backups to determine when a new level 0 backup is appropriate. You can offload all backups of database files, including control file backups, to a physical standby database and thereby avoid consuming resources on the primary database. 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. Ensure that the database instance is mounted or open. You can also back up and recover individual tablespaces and data files in a PDB. Execute BACKUP with SECTION SIZE and AS COPY to indicate that a multisection backup must be created using image copies. When backing up to disk, you can specify a format to spread the backup across several drives for improved performance. A manual backup of the control file is different from a control file autobackup. Configuring a Redundancy-Based Retention Policy, Reporting on RMAN Operations to learn how to use the LIST and REPORT commands. Views That Contain Metadata for Multisection Backups. Ensure that the prerequisites required for creating preplugin backups are met as described in. An application container consists of exactly one application root (different from the root in its CDB) and one or more application PDBs. 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. Several features of RMAN backups are specific to archived redo logs. If integer backups of the logs exist, then the BACKUP ARCHIVELOG command skips the logs. Connect to the application root as an application common user with the SYSDBA or SYSBACKUP privilege. Use the BACKUP command to back up multitenant container databases (CDBs) and pluggable databases (PDBs). cdb_prod is the net service name of the CDB. Oracle Database Concepts for an introduction to PDBs. This backup contains blocks that changed between Tuesday and Wednesday. This section assumes that the block change tracking feature is currently enabled. If you do not explicitly specify a tag with the TAG parameter of the BACKUP command, then RMAN implicitly creates a default tag for backups (except for control file autobackups). If you are backing up a subset of available backup sets, then execute the, About RMAN File Management in a Data Guard Environment, Configuring the Default Device for Backups: Disk or SBT, Configuring the Default Type for Backups: Backup Sets or Copies, Skipping Offline, Read-Only, and Inaccessible Files, Configuring Control File and Server Parameter File Autobackups, Overview of Files in the Fast Recovery Area, Listing Restore Points Using the LIST Command, Creating and Executing Dynamic Stored Scripts, Overview of Flashback Database, Restore Points and Guaranteed Restore Points. Example 9-17 Creating a Temporary Archival Backup. Configuring the Snapshot Control File Location, Making a Manual Backup of the Control File. As explained in "About RMAN File Management in a Data Guard Environment", you can run RMAN backups at any database in a Data Guard environment. If the parameter is not set, and if the database is open, then you can set the parameter with the following form of the ALTER SYSTEM statement: Execute the following ALTER DATABASE statement: You can also create the change tracking file in a location that you choose yourself by using the following form of SQL statement: The REUSE option tells Oracle Database to overwrite any existing block change tracking file with the specified name. After a year has passed, the backup becomes obsolete regardless of the backup retention policy settings. 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. You can configure the file name and location of the snapshot control file. Oracle Database Administrators Reference for Microsoft Windows to learn how to make VSS backups with RMAN. To perform backup and recovery tasks for the application root or application PDBs, you connect either to the application root or CDB root. Choose a backup strategy according to an acceptable MTTR (mean time to recover). Otherwise, RMAN includes these files in the backup set that contains data file 1. Use the backup set key from the previous step to back up the backup set. The incremental level 1 backups to apply to those image copies are selected based upon the tag of the image copy data files and the available incremental level 1 backups. Configure RMAN to automatically skip backups of archived redo logs. 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. Table 9-3 Effect of Advanced Script When Run Daily. Ensure that appropriate channels are configured for the backup. If RMAN backups of the PDB already exist, then these backups are usable after the PDB is migrated to another destination CDB. The server parameter file that is backed up is the one currently in use by the instance. If you cannot shut down the database, then you can disable and enable block change tracking. This backup contains blocks that changed between Monday 1/8 and Tuesday 1/9. When you specify tablespaces, RMAN translates the tablespace name internally into a list of data files. After you make a level 0 incremental backup, the next incremental backup can use change tracking data. Tablespaces can be read-only or read-write. If you create a multiplexed backup set, then each copy of the backup set is assigned the same tag. If multiple backups of the requested file have the desired tag, then RMAN restores the most recent backup that has the desired tag, within any constraints on the RESTORE command. Moving backups from disk to tape and then freeing space on disk. If required, configure channel parallelism so that RMAN can perform the backup operation using multiple drives in parallel. To determine whether change tracking is enabled: Enter the following query in SQL*Plus (sample output included): To move the change tracking file, use the ALTER DATABASE RENAME FILE statement. 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. Enable control file autobackup for the CDB. The application root serves as the parent container to all the application PDBs plugged into it. Because tablespaces in different PDBs can have the same name, to eliminate ambiguity you must connect directly to a PDB to back up one or more of its tablespaces. "Configuring the Default Type for Backups: Backup Sets or Copies" explains how to configure the default disk device. Overview of Flashback Database, Restore Points and Guaranteed Restore Points to learn about restore points. An application common user can only connect to the application root in which it was created or a PDB that is plugged in to this application root. It only backs up those data blocks changed since the most recent level 1 or level 0 backup. If you run RECOVER COPY daily without specifying an UNTIL TIME, then a continuously updated image copy cannot satisfy a recovery window of more than a day. The base database for your sparse database must be read-only. Starting with Oracle Database 12c Release 1 (12.1), RMAN supports multisection incremental backups.
After the maximum of eight bitmaps is reached, the oldest bitmap is overwritten by the bitmap that tracks the current changes. Start RMAN. The database performs an online redo log switch to archive the redo that is in the current online logs and is necessary to make this new backup consistent. 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. The command makes an incremental level 1 backup and assigns it the tag incr_update. The tag of an image copy is inherited by default when the image copy is backed up as a new image copy. Run the BACKUP command with the DELETE INPUT clause. If no location is specified in the FORMAT clause, then RMAN creates the backup in a platform-specific location. You can back up archived redo logs in a multitenant container database (CDB) by using the BACKUP ARCHIVELOG command. To back up a sparse PDB while connected to the PDB: Performing Recovery of a Sparse PDB with RMAN. 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. About Binary Compression for RMAN Backup Sets, AS COMPRESSED BACKUPSET option of the BACKUP command in Oracle Database Backup and Recovery Reference for performance details regarding backup sets. Example 9-14 Backing Up a Database in NOARCHIVELOG Mode. The V$CONTROLFILE.BLOCK_SIZE column indicates the control file block size, whereas the DB_BLOCK_SIZE initialization parameter indicates the block size of data file 1. 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. Use the following steps to create a multisection backup of a database as image copies: Ensure that the COMPATIBLE parameter for the target database is set to 12.0.0 or higher. This example backs up the current control file to the fast recovery area as a backup set: RMAN first creates a snapshot control file. Use the BACKUP command to back up an application container, which consists of the application root and all the application PDBs that belong to the application root. The database must be mounted. Oracle Database Backup and Recovery Reference to learn about the BACKUP command, Oracle Data Guard Concepts and Administration to learn how to back up a standby database with RMAN. Use the BACKUP command with the KEEP option to make archival backups. With DELETE ALL INPUT, RMAN deletes each backed-up archived redo log file from all log archiving destinations. For example: Start RMAN and connect to a target database and recovery catalog. To back up archived logs, use the BACKUP ARCHIVELOG command. Start RMAN and connect to the PDB as a local user with the SYSBACKUP or SYSDBA privilege. Each backup piece is 500MB.
In this case, the fast recovery area automates management of files that are backed up in a VSS snapshot and deletes them as needed. Use the RMAN BACKUP command to back up the application root. Starting with Oracle Database Release 18c, you can create preplugin backups of PDBs to disk and tape. 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. You can switch archived redo log files when you connect to root of a CDB. You can also use the FORMAT parameter to name an ASM disk group as the backup destination, as shown in the following example: No %U is required in this case because Automatic Storage Management (ASM) generates unique file names as needed. Generate a report to see the effect of these copies under a recovery window-based backup retention policy. You can specify an end date for an archival backup with the KEEP UNTIL TIME clause, or specify that the backup is kept FOREVER. You can enable block change tracking when the database is either open or mounted. Table 9-3 shows the effect of the script when it is run once per day starting on Monday, January 1. Perform a full backup of the non-CDB, including archived redo log files. This statement changes the location of the change tracking file while preserving its contents. To view the effect of a backup retention policy on backups of backups: The following example backs up data file 5: For example, run the following command (sample output included). The KEEP option also specifies that the backup is exempt from the retention policy either forever or for a specified period. This example shows that copies of data files in tablespaces users and tools are assigned the tag MONDAYCPY. To create a default configuration that distributes backups to multiple disk drives by default, configure multiple disk channels. Start RMAN and connect to the CDB root as a common user with the. To back up image copies from disk to tape: The following example backs up data file copies that have the tag DBCopy: The following example backs up the latest image copies of a database to tape, assigns the tag QUARTERLY_BACKUP, and deletes the input disk backups: The characters in a tag must be limited to the characters that are legal in file names on the target database file system. A recovery catalog is required for KEEP FOREVER, but is not required for any other KEEP option.
There is no need to explicitly mention the type of compression used or how to decompress the backup set in the recovery operation. Example 9-12 Backing Up the Current Control File as Image Copy. Afterward, you run the following backup: With failover, RMAN completes the backup, using logs 122 and 124 in /arch2. Multisection full backups of databases and data files are supported starting with Oracle Database 11g Release 1. 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.
Oracle Database Backup and Recovery Reference to learn about the RECOVER command. Starting with Oracle Database 12c Release 1 (12.1), you can create multisection full backups that are stored as image copies. Preplugin backups can be either tape and disk backups. This backup contains blocks that changed between now and the most recent backup with the tag incr_update. You can write the archival backup to this special set of tapes and then place them in off-site storage. For this reason, the FORMAT string must allow for the creation of multiple backup pieces. You can persistently skip tablespaces across RMAN sessions by executing the CONFIGURE EXCLUDE command for each tablespace that you always want to skip. By incrementally updating backups, you can avoid the overhead of making full image copy backups of data files, while also minimizing time required for media recovery of your database. Example 9-4 Applying a Tag to a Backup Set. If you specify a section size that is larger than the size of the file, then RMAN does not use multisection backups for that file. Use one of the following techniques: Configure backup optimization so that the BACKUP ARCHIVELOG command skips backing up files when an identical archived log has been backed up to the specified device type. Block change tracking does not change the commands used to perform incremental backups. When you back up image copies that have multiple copies of the data files, specifying tags for the backups makes it easier to identify the input image copy. 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. That is, the command has no effect. As explained in "About Data Archival", one purpose of a backup and recovery strategy is to preserve data. The difference is that you intend to delete the backup soon after creating it. The following example makes a differential incremental backup at level 1 of the SYSTEM and tools tablespaces.