Query the V$FLASHBACK_DATABASE_LOG view as follows: The result is an estimate of the disk space needed to meet the current flashback retention target, based on the database workload since Flashback Database was enabled. Ideally, the fast recovery area should be large enough to contain the files listed in Table 5-2. The following RUN command shows sample vendor-specific PARMS settings: If you do not receive an error message, then the database successfully loaded the media management library. Specifies the upper limit (in minutes) on how far back in time the database may be flashed back. The following steps use the ALLOCATE CHANNEL command to perform a basic test of RMAN communication with the media manager. You can use SHOW ALL FOR DB_UNIQUE_NAME to show the configuration for a specific standby database or SHOW ALL FOR DB_UNIQUE_NAME ALL to show configurations for all known databases. If you specify SHIPPED TO STANDBY, then RMAN can delete logs when they have been transferred to all mandatory standby destinations. For this reason, it cannot be backed up or restored on a logical standby database. Example 5-5 Configuring the Backup Type for an SBT Device. The location must be large enough for the disk quota. If providing this much space is impractical, then it is best to create an area large enough to keep a backup of the most important tablespaces and all the archived logs not yet on tape. RMAN uses the DB_UNIQUE_NAME initialization parameter to distinguish one database from another. If the database creates an Oracle managed control file, and if the database uses a server parameter file, then the database sets the CONTROL_FILES initialization parameter in the server parameter file. The same rule applies to guaranteed restore points when flashback logging is enabled. The Tuesday backup is obsolete because of the retention policy setting. Otherwise, the database eventually halts because it cannot archive the online redo logs. See Also: "Configuring Archived Redo Log Locations" to learn how to configure archived redo logs in the recovery area. Additionally, RMAN retains all archived logs and level 1 incremental backups that are needed to recover to a random point within the window. CONFIGURE FOR DB_UNIQUE_NAME configures settings for a database in the Data Guard environment. Run the CONFIGURE RETENTION POLICY command at the RMAN prompt, as in the following example: The RECOVERY WINDOW parameter of the CONFIGURE command specifies the number of days between the current time and the earliest point of recoverability. The CONFIGURE DEVICE TYPE commands used in this example only affect parallelism and backup type and do not affect the values of settings not specified. Assume a different case in which REDUNDANCY is 1. The files placed in this location are maintained by Oracle Database and the generated file names are maintained in Oracle Managed Files (OMF) format. The initialization parameters CONTROL_FILES, DB_CREATE_ONLINE_LOG_DEST_n, DB_RECOVERY_FILE_DEST, and DB_CREATE_FILE_DEST all interact to determine the location where the database control files are created. In this case, the database automatically disables Flashback Database, writes a message to the alert log, and continues with database processing. For example, you can use the command in Example 5-7 (substituting the channel settings required by your media management vendor) to test whether a backup can be created on the media manager. The fast recovery area is an Oracle Database managed space that can be used to hold RMAN disk backups, control file autobackups and archived redo log files. This section explains what an RMAN configuration is and how you can use the CONFIGURE command to change RMAN default behavior for your backup and recovery environment.
The default retention policy is REDUNDANCY 1. Example 5-8 restores the backup created in Example 5-7 to a temporary directory. The output includes both parameters that you have changed and those that are set to the default. Instance availability is not affected if a mirrored copy of the online redo log exists in an accessible location outside the fast recovery area.
When backing up to disk, the logical block size of the database file must be an even multiple of the physical block size of the destination device. For example, assume that the default device type is SBT, and you execute the following command: In this case, RMAN uses only the disk channel that you manually allocated within the RUN command, overriding any defaults set by using CONFIGURE DEVICE TYPE, CONFIGURE DEFAULT DEVICE, or CONFIGURE CHANNEL settings. Consider configuring a fast recovery area as a first step in implementing a backup strategy. As you produce more backups, RMAN keeps track of which ones to retain and which are obsolete. If the backup and restore operations succeed, then you are ready to use the media manager with RMAN. The following examples configure the backup type for disk backups to copies and backup sets: The following examples configure compression for backup sets: As explained in "RMAN Channels", an RMAN channel is a connection to a database server session. The following shows sample output: After testing a channel allocation on the media manager, create and restore a test backup. RMAN retains all archived logs and incremental backups that are needed to recover the nonobsolete backups. Table 5-1 shows the commands that configure the default device. If you use RMAN in a Data Guard environment, then you can use the CONFIGURE command to register and configure settings for the physical databases in this environment.
The order of precedence is: SET CONTROLFILE AUTOBACKUP FORMAT (within a RUN block), SET CONTROLFILE AUTOBACKUP FORMAT (at RMAN prompt). No additional configuration is necessary. If REDUNDANCY is 2, then the Monday and Tuesday backups are obsolete. New standby databases are also automatically registered when RMAN connects as TARGET to a standby database for the first time. The SBT_LIBRARY parameter specifies the path to the library. For archived redo log files in the fast recovery area, the database retains them as long as possible and automatically deletes eligible logs when additional disk space is required. The BACKUP command can create either backup sets or image copies. You can use the substitution variables in a FORMAT parameter to generate unique backup piece names. Appendix C in the Oracle Database Backup and Recovery Reference for information about configuring RMAN for the Oracle Secure Backup (OSB) Cloud Module. The SET CONTROLFILE AUTOBACKUP FORMAT command, which you can specify either within a RUN command or at the RMAN prompt, overrides the configured autobackup format in the current session only. If you do not use Oracle Secure Backup, then you can use a third-party media manager. This parameter indirectly determines how much flashback log data is kept in the recovery area. If you receive the ORA-27211 error, the media management library could not be loaded: In this case, check the media management installation to ensure that the library is correctly installed, and recheck the value for the SBT_LIBRARY parameter as described in "Determining the Location of the Media Management Library". For example, if you specify the APPLIED ON STANDBY clause, then RMAN can delete logs after they have been applied at all mandatory remote destinations. Enable archiving to the fast recovery area and set other LOG_ARCHIVE_DEST_n initialization parameter to locations outside the fast recovery area. A Data Guard environment involves many considerations that are only relevant for Data Guard. Unlike other transient files, flashback logs cannot be backed up to other media. Before you can begin using RMAN with a third-party media manager, you must install the media manager and ensure that RMAN can communicate with it. A backup piece name is determined by the FORMAT string specified in the BACKUP command, CONFIGURE CHANNEL command, or ALLOCATE CHANNEL command. By default, there is no archived redo log deletion policy and this is why the archive redo log policy is set to the NONE clause. In the file name, ?
Depending on the type of media management software that you installed, you may have to define media pools, configure users and classes, and so on. The REDUNDANCY parameter of the CONFIGURE RETENTION POLICY command specifies how many full or level 0 backups of each data file and control file that RMAN should keep. To enable an archived redo log deletion policy: Run the CONFIGURE ARCHIVELOG DELETION POLICY command with the desired options. The generated file names for the archived logs in the fast recovery area are for Oracle Managed files and are not determined by the parameter LOG_ARCHIVE_FORMAT. For example, you can view the retention policy and default device type as follows: Optionally, use the CONFIGURE CLEAR command to return any configuration to its default value, as shown in the following examples: Backups for which no destination device type is specified are directed to the configured default device. To direct the restored archived logs to the fast recovery area, set a LOG_ARCHIVE_DEST_n parameter to LOCATION = USE_DB_RECOVERY_FILE_DEST. You can use the CONFIGURE ARCHIVELOG DELETION POLICY BACKED UP integer TIMES TO DEVICE TYPE command to enable an archived log deletion policy. If you do not specify SET ARCHIVELOG DESTINATION to override this behavior, then RMAN restores archived redo log files to the fast recovery area. Specifies the recovery area location, which can be a file system directory or ASM disk group, but not a raw disk. In an Oracle Real Application Clusters (Oracle RAC) database, all instances must have the same values for these initialization parameters. For example, assume the following scenario: The most recent backup of tablespace tools to tape is January 3.
Permanent files are active files used by the database instance. The size of flashback logs generated by the database can vary considerably depending on the database workload.
If more blocks are affected by database updates during a given interval, then more disk space is used by the flashback log data generated for that interval. You can also specify an ASM disk location, as shown in Example 5-3: Example 5-3 Configuring an ASM Disk Location. For example, %d specifies the name of the database, whereas %t specifies the backup time stamp. After you have started the instance with the restored server parameter file, RMAN can restore the control file from an autobackup. Specifies that backups should go to tape by default. The SET CONTROFILE AUTOBACKUP FORMAT in the RUN block overrides the SET CONTROLFILE AUTOBACKUP FORMAT outside the RUN block for the duration of the RUN block. If guaranteed restore points are configured, the instance fails because of interdependencies on the flashback logs. If PARMS values are needed for the ALLOCATE CHANNEL or the CONFIGURE CHANNEL command, or if a FORMAT string is recommended for the BACKUP or CONFIGURE command, then refer to the vendor documentation for this information. These parameters enable the fast recovery area without having to shut down and restart the database instance. CONFIGURE CHANNEL takes the same options used to specify one-time options with the ALLOCATE CHANNEL command. Set the DB_RECOVERY_FILE_DEST_SIZE initialization parameter by any of the following means: Shut down the database and set the DB_RECOVERY_FILE_DEST_SIZE parameter in the initialization parameter file of the database, as shown in the following example: Specify the parameter with the SQL statement ALTER SYSTEM SET when the database is open, as shown in the following examples: Use the Database Configuration Assistant to set the size.
Table 5-3 Initialization Parameters for the Fast Recovery Area. This module contains the media management library that the Oracle database loads and uses when accessing the media manager. For example, if you intend to set DB_FLASHBACK_RETENTION_TARGET to 24 hours, and if the database generates 20 gigabytes of redo in a day, then a general rule of thumb is to allow 20 GB to 30 GB of disk space for the flashback logs. Ensure that the steps in "Configuring RMAN to Make Backups to a Media Manager" are correctly done. If a recovery area is enabled, then the backup location defaults to the fast recovery area. If you are using the fast recovery area for archive logs, then set the initialization parameter LOG_ARCHIVE_DEST_n to use a non-fast recovery area location. Archived redo logs are needed by Flashback Database if the logs were created later than SYSDATE-'DB_FLASHBACK_RETENTION_TARGET'. This chapter explains the most basic tasks involved in configuring RMAN. The easiest technique for backing up to a media manager is to configure automatic SBT channels. Chapter 18, "Performing Flashback and Database Point-in-Time Recovery", Oracle Database Platform Guide for Microsoft Windows to learn about making backups in a VSS environment. The commands are: If you do not specify the FORMAT clause for disk backups, then RMAN creates backup pieces and image copies in the fast recovery area, with names in Oracle Managed Files name format. The backup piece name 12i1nk47_1_1 is an example. For example, assume that you have configured backup optimization.
To configure channels for use with a media manager: In the configuration, enter all parameters that you tested "Testing Backup and Restore Operations on the Media Manager". The actual steps depend on the media management product that you install and the platform on which you run the database. See Also: "Configuring Online Redo Log Locations" to learn how to configure online redo logs in the recovery area. Example 5-2 Configuring a Nondefault Backup Location. Because the fast recovery area is built on top of OMF, so it can be stored anywhere that Oracle Managed Files can. Verify that you are not using SET ARCHIVELOG DESTINATION to direct restored logs to some other destination. The following example configures vendor-specific channel parameters and sets the default device: Configure the default device type to SBT, as shown in the following command: If you use multiple tape devices, then you must specify the channel parallelism as described in "Configuring Parallel Channels for Disk and SBT Devices". The default backup type for disk is an uncompressed backup set. Note: Foreign archived redo logs are received by a logical standby database for a LogMiner session. In general, you should begin by installing and configuring the media management software on the target host or production network.
Clearing it returns it to its default setting of REDUNDANCY 1, whereas NONE disables it. See Oracle Secure Backup Administrator's Guide to learn how to set up RMAN for use specifically with Oracle Secure Backup.
If you have enabled Flashback Database or use the fast recovery area for archive logs, then take the appropriate steps from those that follow below. This error indicates that the media management software is not correctly configured. For example, after the second CONFIGURE CHANNEL command, which specifies only the FORMAT for configured disk channels, the MAXPIECESIZE for the disk channel is returned to its default value: By default, RMAN allocates one disk channel for all operations. See Also: "Configuring Control File Locations" to learn how to configure control files in the recovery area. Image copies of data files and control files. Immediately after each daily backup you run the command DELETE OBSOLETE. Refer to the media management vendor's software documentation for instructions. In Example 5-2, RMAN automatically replaces the format specifier %t with a four byte time stamp, %s with the backup set number, and %p with the backup piece number. To determine the optimum size for the fast recovery area: If you plan to use flashback logging or guaranteed restore points, then query V$ARCHIVED_LOG to determine how much redo the database generates in the time to which you intend to set DB_FLASHBACK_RETENTION_TARGET. Set LOG_ARCHIVE_DEST_n initialization parameters to archive only to non-fast recovery area locations. For disk, you can configure RMAN to create either backup sets or image copies as its default backup type with the CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO command. If the database uses a client-side initialization parameter file, then you must set the CONTROL_FILES initialization parameter manually in the initialization parameter file. For those databases where no DB_UNIQUE_NAME is provided, no two databases have the same value for DB_NAME. Example 5-6 PARMS Setting for Oracle Secure Backup, Oracle Database Backup and Recovery Reference for channel control options, Oracle Secure Backup Reference for RMAN-specific parameter settings for Oracle Secure Backup. RMAN can create control file autobackups in the fast recovery area. The following example shows how the two forms of SET CONTROLFILE AUTOBACKUP FORMAT interact: The first SET CONTROLFILE AUTOBACKUP FORMAT controls the name of the control file autobackup until the RMAN client exits, overriding any configured control file autobackup format. Table 5-4 Criteria to Determine an Identical File. Also, ensure that you have the PARMS and FORMAT strings required by your media management software. RMAN restores any redo log files needed during these operations to the fast recovery area and deletes them after they are applied during media recovery. "Specifying Multiple Formats for Disk Backups" to learn how to make disk backups in parallel, Oracle Database Backup and Recovery Reference for reference material on the CHANNEL parameter of the BACKUP command, Oracle Real Application Clusters Administration and Deployment Guide for information about taking advantage of parallel operations in an Oracle Real Application Clusters (Oracle RAC) configuration.