The CATALOG START WITH command enables you to search through all files in an ASM disk group, Oracle Managed Files location, or traditional file system directory and investigate those that are not recorded in the RMAN repository. For on-going jobs, this view displays progress and status. If you run CROSSCHECK, and if RMAN cannot locate the files, then it updates their records in the RMAN repository to EXPIRED status. For example, enter the following commands: Wildcard characters are not legal in the START WITH clause.
You can then use the DELETE EXPIRED command to remove records of expired backups and copies from the RMAN repository. The best way to prevent the loss of RMAN metadata because of overwritten control file records is to use a recovery catalog. Use the ALTER SYSTEM command to change the location of the fast recovery area. If you use host operating system commands to delete files, then the database is not aware of the resulting free space. The record for backup set 3 is deleted after you run DELETE EXPIRED. RMAN can delete files when connected to any database. The KEEP FOREVER clause requires the use of a recovery catalog, because the control file cannot contain an infinitely large set of RMAN repository data. In this way you increase the likelihood of achieving the flashback target. Nevertheless, you can manage fast recovery area space as a whole to maximize the space available for retention of flashback logs. As explained in Table 12-1, RMAN uses all configured channels to perform the deletion. You can delete eligible logs from any location, inside or outside the recovery area, with BACKUP DELETE INPUT or DELETE ARCHIVELOG. This section explains how to ensure that the RMAN repository accurately reflects the reality of the RMAN-related files stored on disk and tape. Figure 12-1 illustrates a crosscheck of a media manager. RMAN updates each backup in the RMAN repository to status EXPIRED if the backup is no longer available. UNAVAILABLE or CHANGE UNCATALOG. A guaranteed restore point forces the retention of flashback logs required to perform Flashback Database to the restore point SCN. Updating a Backup to Status AVAILABLE or UNAVAILABLE describes how to make backups available or unavailable. For example, a directory containing a file is corrupted at the time of the crosscheck, but is later repaired, or the media manager was not configured properly and reported some backups as not existing when they really existed. RMAN provides multiple commands to maintain RMAN backups and repository records. RMAN sends this information to the target database server, which queries the media management software about the backups. Oracle Database Reference for information about the CONTROL_FILE_RECORD_KEEP_TIME initialization parameter. Start RMAN and connect to a target database and recovery catalog (if used). The following table describes the RMAN commands that can delete backups. To alter the KEEP status of an archival backup: This example allows a backup set to be subject to the backup retention policy: This example makes a data file copy exempt from the retention policy for 180 days: Making Database Backups for Long-Term Storage. Catalog the file names of the backup pieces. After you transfer backups from the recovery area to tape, you can delete files from the fast recovery area. Archived redo logs are not eligible for deletion until all the consumers of the logs have satisfied their requirements. After the files are cataloged, you can run the LIST command or query V$BACKUP_FILES view to confirm the information is contained in the RMAN repository. Starting with Oracle Database Release 19c, the management of space in the fast recovery area is simplified. For example: Remove the database from the operating system. The procedure for moving database files into and out of an ASM disk group with RMAN works when moving files into and out of a fast recovery area. This technique is useful for archiving backups to comply with business requirements. You can view the status of backups by running the RMAN LIST command or by querying V$BACKUP_FILES or recovery catalog views such as RC_DATAFILE_COPY or RC_ARCHIVED_LOG. When the retention target is reduced, flashback logs that are beyond the retention period are deleted immediately. If you configure a fast recovery area, then the database automatically deletes unneeded files in this area automatically; even so, you may want to delete backups and copies from tape. Oracle recommends that you use a minimum of two multiplexed or mirrored control files on separate disks. Typically, you do not need to run this command manually because RMAN automatically runs it as needed, for example, when you restore or create a control file. Monitor the alert log to ensure that Oracle Database is not overwriting control file records. Crosscheck the desired backups or copies. Some examples of information in noncircular reuse records include data files, online redo log files, and redo threads. The CONTROL_FILE_RECORD_KEEP_TIME initialization parameter determines the minimum age in days of a record before it can be overwritten: For example, if the parameter value is 14, then any record of age 14 days or older is a candidate for reuse. Backing Up the Database to decide on a retention policy, Oracle Data Guard Concepts and Administrationfor more information about archived log deletion policy with Data Guard. Use the CATALOG command to propagate information about user-managed copies to the RMAN repository. The alert log is located in the Automatic Diagnostic Repository (ADR). You can even catalog a backup piece from a prior incarnation of the database. If RMAN is connected to the recovery catalog, and if you specify the option INCLUDE COPIES AND BACKUPS, then RMAN also unregisters the database. The recovery catalog RMAN repository is stored in actual database tables, while the control file version of the repository is stored in an internal structure in the control file. Including or exempting backups from the retention policy. As with other forms of the DELETE command, the files deleted are removed from backup media, deleted from the recovery catalog, and marked as DELETED in the control file. Store the control file in a file system rather than on a raw device so that it can expand. Example 12-1 Fast Recovery Area Space Consumption. The following example displays details about the fast recovery area such as the location, disk quota, space usage, and number of files. For a crosscheck, RMAN can only update the status of a file from AVAILABLE to EXPIRED when connected to the database associated with the file. When the database must add new RMAN repository records to the control file, but no record is older than the threshold, the database attempts to expand the size of the control file. The information you provided is very collective, explained and useful. In such a situation, this warning appears in the alert log: The preceding message means that the control file cannot hold a record of all fast recovery area files needed to satisfy the configured retention policy. If you specify DELETE INPUT (without ALL), then RMAN deletes only the specific files that it backs up. The jobs which are in progress are stored only in memory while the finished jobs are stored in the controlfile. The following examples show many of the common ways to specify backups and archived logs to delete with the DELETE command: Deleting backups using primary keys from LIST output: Deleting backups based on the objects backed up and the media or disk location where the backup is stored: Deleting archived redo logs from disk based on whether they are backed up on tape: Deleting backup sets that were backed up twice to tape: Deleting backups of the target database that were backed up once to tape: Oracle Database Backup and Recovery Reference for complete information about the DELETE command options. If you specify ALL INPUT, then RMAN deletes all copies of the files recorded in the RMAN repository. The following example displays the PDBs that were deleted from the CDB test_db: The following commands remove RMAN repository records of backup pieces and image copies associated with a dropped PDB that is identified using its GUID. You can use the following strategy to protect the control file. The DELETE EXPIRED command deletes repository records for backups that fail the crosscheck. When the recovery area is completely full, the error displayed is as follows, where nnnnn is the number of bytes required and mmmmm is the disk quota: You have several choices for how to resolve a full fast recovery area when no files are eligible for deletion: Make more disk space available and increase DB_RECOVERY_FILE_DEST_SIZE to reflect the additional space. In this situation, the repository does not have information about archived logs needed for recovery, and you must catalog these logs. In such cases, use the DELETE BACKUP GUID command to delete backups of dropped PDBs. If it cannot catalog the file, then it makes its best guess about the contents of the skipped file.
The oldest record available for reuse is used first. Opening Physical Standby for Read Write using Flas ORA-01153: an incompatible media recovery is active. Run DELETE for any files that have been removed with an operating system utility. If you use a recovery catalog, then you can also access the record in the RC_BACKUP_SET catalog view. Flashback logs cannot be backed up outside the recovery area and are not backed up by BACKUP RECOVERY AREA. In a CDB, you can delete archived logs only when you connect to the root as a user with the SYSDBA or SYSBACKUP privilege. You cannot set KEEP attributes for backup sets or files stored in the fast recovery area. If you leave the existing files in the flash recovery, then the database deletes the transient files from the old fast recovery area as they become eligible for deletion. You can also change the status of an archival backup and subsequently include it in the configured retention policy. You can issue the DELETE EXPIRED command to delete all expired backups. As soon as the KEEP UNTIL period expires, however, the backup is immediately considered to be obsolete, regardless of any configured backup retention policy. You can use the CATALOG RECOVERY AREA command to catalog all files in the recovery area. In rare cases, the repository can mark a file as EXPIRED even though it exists. Ensure that the preplugin backups created on the source database are accessible to the target CDB. You can specify that DELETE removes backups that are EXPIRED or OBSOLETE. The BACKUP DELETE command backs up the files first, typically to tape, and then deletes the input files afterward. For example, you back up an archived redo log to disk and then use an operating system utility to delete it. However, you can change the status of files associated with a database other than the target database by using the FOR DB_UNIQUE_NAME option. Oracle Data Guard Concepts and Administration to learn how to use RMAN to back up and restore files in a Data Guard environment, Oracle Database Backup and Recovery Reference for a description of the RMAN CHANGE command. If a maintenance command changes RMAN metadata only, then you can connect RMAN as TARGET to any database in the Data Guard environment. "Overview of Files in the Fast Recovery Area" for information about the contents of the fast recovery area and the difference between permanent and transient files, "Configuring an Archived Redo Log Deletion Policy" for information about how to configure an archived redo log deletion policy that determines when logs are eligible to be deleted, Configuring the Backup Retention Policy for information about how to configure the retention policy, Oracle Data Guard Concepts and Administration to learn about archived redo log management in a Data Guard environment. Ensure that the preplugin archived redo log files created on the source CDB are accessible to the target database. Run the CHANGEUNAVAILABLE command when a backup cannot be found or has migrated offsite. About RMAN File Management in a Data Guard Environment, About Accessibility of Backups in a Data Guard Environment, Overview of Files in the Fast Recovery Area, Listing Restore Points Using the V$RESTORE_POINT View, About Logging for Flashback Database with Guaranteed Restore Points Defined, Description of "Figure 12-1 Crosschecking a Media Manager", Updating a Backup to Status AVAILABLE or UNAVAILABLE, Changing the Status of an Archival Backup, Maintaining RMAN Backups and RepositoryRecords. For example, use the following SQL statement to change the parameter on a running database: The database no longer provides the space management features of the fast recovery area for the files stored in the old DB_RECOVERY_FILE_DEST location. The following command catalogs the specified preplugin archived redo log. You can designate backups as exempt from the retention policy. The files in the fast recovery area cannot be marked as UNAVAILABLE. Unless you run CROSSCHECK, RMAN does not know about the deletion. The target database control file keeps records of all archived redo logs generated by the target database and all RMAN backups. You cannot manage the flashback logs in the fast recovery area directly other than by setting the flashback retention target or using guaranteed restore points. Thus, the BACKUP RECOVERY AREA operation does not include the flashback logs when backing up the fast recovery area contents to tape. It is possible for the RMAN repository to fail to reflect the true state of files on disk or tape. Nevertheless, the database continues to consume space in the fast recovery area until there is no reclaimable space left. RMAN prompts for confirmation. Use the crosscheck feature to check the status of a backup on disk or tape. For example, if you delete archived redo logs with an operating system utility, then remove the record for this log from the repository by issuing a CHANGE ARCHIVELOG UNCATALOG command. You may even need to delete an entire database. An image copy is a file generated with BACKUP AS COPY command, a log archived by the database, or a file cataloged with the CATALOG command. To catalog preplugin backups of archived redo log files: Optionally, view the relevant recovery catalog view, for example. Make a data file copy with an operating system utility. If you choose not to use a recovery catalog, however, then the control file of each target database is the exclusive repository for RMAN metadata. The space columns specify the amount in bytes. Archived redo logs cannot be deleted when connected to a PDB. If you are not using a recovery catalog to store RMAN metadata, then it is doubly important that you protect each target database control file. For example, the fast recovery area may become full, in which case you can add space to it. In some circumstances, users may have removed backups or archived redo logs with operating system utilities. The following rules govern when files become eligible for deletion from the recovery area: Permanent files are never eligible for deletion. You can configure or manually allocate multiple channels before issuing CROSSCHECK or DELETE commands. The CHANGEUNCATALOG command only changes the RMAN repository record of backups, and does not actually delete backups. Instead, use the GUID to identify the dropped PDB. The following sample commands illustrate different types of crosschecks: Oracle Database Backup and Recovery Reference for more details on using CROSSCHECK to check backups of specific files. During this operation, any files in the recovery area not listed in the RMAN repository are added. The database records the overwrite in the alert log located in the Automatic Diagnostic Repository (ADR). Each PDB has a globally unique identifier (GUID) which can be used to uniquely identify a PDB. Crosschecks are useful because they can do the following: Update outdated information about backups that disappeared from disk or tape or became corrupted, Update the repository if you delete archived redo logs or other files with operating system commands. See "Making Database Connections with RMAN". The default algorithm is AES128. After you drop a PDB, you cannot use the PDB name to change the status of backups associated with the dropped PDB. This view will list AES128, AES192, and AES256 encryption algorithms for the current release. If you have not performed a crosscheck recently, then issue a. Delete the expired backups. If you delete files by means other than RMAN, then you must perform a crosscheck periodically to ensure that the repository data stays current. Figure 12-1 Crosschecking a Media Manager. RMAN VIEWS (WHEN NO RECOVERY CATALOG AVAILABLE) . It is used by the RMAN client. The RMAN repository record for an object can sometimes fail to reflect the physical status of the object. The DELETE EXPIRED command issues warnings if any files marked as EXPIRED actually exist. You can use the CATALOG command to make RMAN aware of the existence of archived logs not recorded in the repository or copies of database files that are created through means other than RMAN. Ensure that your guaranteed restore points are necessary. You can override the archived redo log deletion policy settings by using the FORCE option in the DELETE command. Example 12-2 Fast Recovery Area Space Usage Based on Type of Files. Set the current container to the PDB whose preplugin backups must be crosschecked. You can use an RMAN command to perform these tasks.
RMAN can determine whether that backup piece can be used during a subsequent restore and recovery operation. V$RECOVERY_AREA_USAGE in Oracle Database Reference, V$RECOVERY_FILE_DEST in Oracle Database Reference. The media management software then checks its media catalog and reports back to the server that backup set 3 is missing. You can suppress these confirmations by using the NOPROMPT keyword with any form of the BACKUP command: Oracle Database Backup and Recovery Reference for a description of DELETE behavior when mismatches occur between the RMAN repository and physical media. This record is stored in the control file. You can use RMAN maintenance commands to update the repository with accurate information. Regardless of whether you use a recovery catalog, never use RMAN when CONTROL_FILE_RECORD_KEEP_TIME is set to 0. RMAN does not use files with status UNAVAILABLE in RESTORE or RECOVER commands. The CROSSCHECK command enables you to synchronize the logical backup records with the physical reality of files in backup storage. In this case, the RMAN repository shows that the file exists when it does not. For example, the following commands catalog files in the fast recovery area, and then in a secondary archiving destination: Delete all backups and copies associated with the database. You can catalog backup pieces on disk. Run a LIST command to identify the backups to be checked. When guaranteed restore points are defined on your database, you must monitor the amount of space used in your fast recovery area for files required to meet the guarantee. If the backup is on disk, then CROSSCHECK checks whether the header of the file is valid. If you must move the old files to the new fast recovery area, then see the Oracle Automatic Storage Management Administrator's Guide. You must then use DELETE FORCE to delete the file metadata. The control file contains two types of records: circular reuse records and noncircular reuse records. If not, delete them. The database in a Data Guard environment that creates a backup or copy is associated with the file. You want to catalog user-managed copies of Oracle7 database files created before you migrated to a higher release, or of Oracle8 and higher database files created before you started to use RMAN. The same options available for BACKUPKEEP are available with CHANGEKEEP . For example: Use the CATALOG command to add preplugin archived redo log files to the RMAN repository. Move backups from the fast recovery area to tertiary storage such as tape. If the RMAN retention policy requires keeping a set of backups larger than the fast recovery area disk quota, or if the retention policy is set to NONE, then the fast recovery area can fill completely with no reclaimable space. Otherwise, the database expands the size of the control file section containing the record for this file. For example, you may decide that you no longer want to keep a long-term backup. Before disabling the fast recovery area, you must first drop all guaranteed restore points and then turn off Flashback Database. If a recovery catalog is used, then the record can also be found in the recovery catalog after the recovery catalog is resynchronized from the control file. Create redundant copies of control files through, Start SQL*Plus on the target database and change the. Ensure that the preplugin backups and preplugin archived redo log files created on the source CDB are accessible to the target database. RMAN uses the configured settings to determine whether an archived redo log can be deleted.The ALL option in the DELETE ALL INPUT clause applies only to archived redo logs. The ALTER SYSTEM command can be used to disable the fast recovery area. In some circumstances, you may need to delete all backup sets, proxy copies, and image copies associated with a database. If you use a fast recovery area, then follow these guidelines to avoid a situation in which the control file cannot hold a record of all fast recovery area files needed to satisfy the backup retention policy: If the block size of the control file is not at its maximum, then use a larger block size, preferably 32 kilobytes. As a rule, the fast recovery area is self-maintaining. RMAN provides multiple methods of changing the repository status of backups and copies. This chapter contains the following topics: Overview of RMAN Backup and Repository Maintenance, Deleting RMAN Backups and Archived Redo Logs, Managing a Recovery Catalog for RMAN maintenance issues that are specific to a recovery catalog. For backups on SBT devices, the RMAN DELETE command instructs the media manager to delete the backup pieces or proxy copies on tape. An archival backup is still a fully valid backup, however, and can be restored just as any other RMAN backup.
You can delete backups and recovery catalog records for backups. DROP DATABASE requires that RMAN be connected to the target database, and that the target database be mounted. To remove a database from the operating system, you can use the DROP DATABASE command in RMAN. These records contain information that is continually generated by the database. If a backup is on tape, then the command checks that the backups exist in the media management software catalog. For example, issue: Start RMAN and connect to the root of the target CDB as a common user with the. Files that are obsolete under the retention policy are eligible for deletion. This chapter also explains maintenance tasks related to the fast recovery area. If you specify the DELETE OBSOLETE command with no arguments, then RMAN deletes all obsolete backups defined by the configured retention policy. For example, enter the following command: Views include V$BACKUP_PIECE, V$BACKUP_SET, V$BACKUP_DATAFILE, V$BACKUP_REDOLOG, and V$BACKUP_SPFILE. Transient files that have been copied to tape are eligible for deletion. By default, the CHANGE command only operates on files that are accessible according to the rules specified in "About Accessibility of Backups in a Data Guard Environment". You perform recovery with a backup control file and you change the archiving destination or format during recovery. By default, the archived redo logs deletion policy is configured to NONE. If you use DELETE for files on devices that are not configured for automatic channels, then you must first use ALLOCATE CHANNEL FOR MAINTENANCE command. If a control file autobackup is available, RMAN can restore the server parameter and backup control file, and mount the database. To prevent the control file from growing too large because of the addition of new records, records can be reused if they are older than a threshold that you specify. Thus, if RMAN crosschecks a file and does not find it, and if the file is associated with a database to which it is not connected as TARGET, then RMAN prompts you to perform the crosscheck when connected to the target database associated with the file. Although the fast recovery area is largely self-managing, some situations may require database administration intervention. If backups are accessible to RMAN according to the criteria specified in "About RMAN File Management in a Data Guard Environment", you can use RMAN maintenance commands such as CHANGE, DELETE, and CROSSCHECK for backups when connected to any primary or standby database. The DELETE command supports a wide range of options to identify objects to delete. In this scenario, use the CATALOG command to notify RMAN of the existence of the user-managed copy after breaking the mirror. If the underlying operating system prevents the expansion of the control file (due to a disk full condition, for instance), then the database overwrites the oldest record in the control file. In this case, the database automatically maintains and deletes backups and archived redo logs as needed. Thus, DELETE OBSOLETE deletes any backup created with BACKUP KEEP UNTIL TIME if the KEEP time has expired. The CROSSCHECK command does not delete operating system files or remove repository records. Oracle Database Administrators Guide for an overview of the control file and more details about managing control files. Managing RMAN backups involves the following related tasks: Managing the database backups that are stored on disk or tape, Managing the records of those backups in the RMAN repository. In scenarios where a sudden workload spike causes a large number of flashback logs to be created, the workload is monitored for a few days before deleting flashback logs that are beyond the retention period. Ensure that the target CDB is open in read-write mode. For example, the value of DB_UNIQUE_NAME is null when the database name is not known to the recovery catalog, as for Oracle9i databases that are registered in a recovery catalog. If offloading backups to tape still does not create enough space to satisfy the backup retention policy and flashback retention target, then allocate more space in the fast recovery area. The following command deletes preplugin backups of the PDB my_pdb. To Display the backup details of the database (Full, Incremental & Archive log backup), when the DB is not connect with the recover catalog.
Use the CROSSCHECK command to verify the status and availability of preplugin backups and preplugin archived redo log files known to RMAN. If you cannot use a recovery catalog, then you can take the following measures: Set the CONTROL_FILE_RECORD_KEEP_TIME value to slightly longer than the oldest file that you must keep. Archived redo logs can be deleted automatically by the database or by any of the user-initiated RMAN commands listed in Table 12-1. The following command displays the open mode of the database: The following example sets the preplugin container to the PDB my_pdb: The following command crosschecks the backups for PDB my_pdb. Because of the way that control file data is stored, RMAN cannot remove the record from the control file, only update it to DELETED status. If the command can catalog a file, then it does so. The CROSSCHECK command operates only on files that are currently recorded in the RMAN repository. If for some reason the file still exists on the media, then RMAN issues warnings and lists the mismatched objects that cannot be deleted. Connect to the root as a common user with the, Start RMAN and connect to the root as a common user with the.