RMAN maintain metadata in repository about target database, its backup and recovery operations. For example (own configuration setting, target database schema, archived redo logs and backup files on disk or tap).
- RMAN maintain metadata about target DB, it backup and recovery operations. For example (own configuration setting, target DB schema, archived redo logs and backup files on disk or tap.
- Primary storage is control file of the target DB.
- Another copy of RMAN repository can also saved in recovery catalog.
- LIST, REPORT, SHOW displays repository information.
- CONTROL_FILE_RECORD_KEEP_TIME parameter specifies in days after how record will be reused for new records in a control file. Default is 7 days.
- If you back up the whole database once a week, then you need to set value at least 7 days
- If the file is eligible for deletion then database attempts to delete file from flash recovery area. Otherwise, the database expands the size of the control file, logging the expansion in the alert log with a message like this example:
kccwnc: trying to expand control file section nnnn for Oracle Managed Files - If the control file is at the maximum size supported under the host operating system, then the database cannot expand the control file. This warning appears in the alert log
WARNING: Oracle Managed File filename is unknown to control file.
Recovery Without a Recovery catalog : Oracle recommends that you:
- Enable control file autobackup feature
- Keep a record of your DBID
- Use a minimum of two multiplexed or mirrored control files on separate disks
- Keep all Recovery Manager backup logs.
Types of Records in the Control File
Circular Reuse Records:
Contain noncritical information that is eligible to be overwritten. The CONTROL_FILE_RECORD_KEEP_TIME initialization parameter specifies the minimum age in days of a record before it can be reused.
Noncircular Reuse Records:
Contain critical information that can not be overwritten such as (datafiles, online redo logs, and redo threads)
Managing RMAN Repository
RMAN repository metadata is always stored in the control file of the target database. You can also create a recovery catalog in a separate database, and RMAN will record its metadata there as well.
Monitoring Control File Records
If you do not use a recovery catalog, then eventually RMAN control file records are overwritten. Set this initialization parameter in the parameter file of the target database to determine how long records are kept:
CONTROL_FILE_RECORD_KEEP_TIME = number_of_days_to_keep
The CROSSCHECK command checks whether RMAN backups and copies in the repository are still readable by RMAN. Assuming that you have configured automatic channels, you can run these commands:
RMAN> CROSSCHECK BACKUP; # checks RMAN backups on configured devices
RMAN> CROSSCHECK COPY; # checks RMAN image copies on configured devices
If backups are stored with a media manager and sbt channels are not configured, then you must allocate a maintenance channel before CROSSCHECK and DELETE commands on sbt devices:
RMAN> ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE sbt;
RMAN> CROSSCHECK BACKUP;
Deleting Backups Created with RMAN
The DELETE command removes RMAN backups and copies from DISK and sbt devices, marks the objects as DELETED in the control file, and removes the records from the recovery catalog (if you use a catalog). For example:
RMAN>DELETE BACKUPSET 101,102,103;
RMAN>DELETE CONTROLFILECOPY '/tmp/cf.cpy';
RMAN>DELETE NOPROMPT ARCHIVELOG UNTIL SEQUENCE =7300;
RMAN>DELETE BACKUP OF SPFILE TABLESPACE users DEVICE TYPE sbt;
RMAN>DELETE BACKUP OF DATABASELIKE'/tmp%'; # pattern match
RMAN>DELETE ARCHIVELOG ALL BACKED UP 2 TIMES TO DEVICE TYPE sbt;
The following options of the DELETE command are also useful:
|EXPIRED||DELETE EXPIRED||Deletes the backups and copies marked as EXPIRED (that is, "not found") by the CROSSCHECK command.|
|OBSOLETE||DELETE OBSOLETE||Deletes the backups and copies that are obsolete under the retention policy. REDUNDANCY and RECOVERY WINDOW parameters override the configured policy|
|NOPROMPT||DELETE NOPROMPT OBSOLETE||Specifies that you do not want to be prompted to confirm the files to be deleted.|