I. Use of the LIST Command
List backup sets, data file images, etc.
List backup sets or image copies of arbitrary data files in a specified tablespace
List backup sets or image copies that contain archived logs within a specified range
RMAN> List backup;
RMAN> List copy;
RMAN> List backup of database;
RMAN> List backup of tablespace uers;
RMAN> List backup of archivelog all;
RMAN> List backup verbose;
RMAN> List backup summary;
RMAN> List backup of datafile {n | <dir>}
RMAN> List copy of archive from time = 'sysdate-7 ';
RMAN> List backup of archivelog from sequence 1000 until sequence 1020;
RMAN> List backupset tag = tag20101014t155753;
Ii. Use of the report command
The report command displays detailed analysis information in the storage warehouse.
For example, which files need to be backed up?
Which backups can be deleted?
Files that cannot be recovered
RMAN> report Schema;
RMAN> report need backup;
RMAN> report need backup days 3;
RMAN> report need Backup Redundancy 3;
RMAN> report need Backup Recovery window of 3 days;
RMAN> report obsolete;
RMAN> report unrecoverable;
RMAN> report schema at time 'sysdate-7 ';
RMAN> report need backup days 2 tablespace system;
Iii. Use of the DELETE command
Delete the physical files of the relevant backup set or image copy, and update the delete tag to the control file. If the recovery directory is used, the backup set in the recovery directory is cleared.
RMAN> Delete backupset;
RMAN> Delete backupset N;
RMAN> Delete Obsolete;
RMAN> Delete Obsolete redundancy 2;
RMAN> Delete noprompt copy;
RMAN> Delete noprompt backupset tag tag20101016t143521;
RMAN> Delete Obsolete recovery window of 7 days;
RMAN> Delete expired backupset;
RMAN> Delete expired copy;
RMAN> Delete expired archivelog all;
Iv. Use of the crosscheck command
This command is used to verify the backup set or image copy in the storage warehouse. After executing this command, the status of the object that has just been verified in the storage warehouse is updated to facilitate subsequent operations.
Several statuses during RMAN backup Verification:
Expired: the object does not exist on a disk or tape. When a backup set is in the expired status, all the copies in the backup set are also in the expired status.
Available: the object is available. When a backup set is available, all the copies in the backup set are also available.
Unavailabe: the object is unavailable. When a backup set is unavailable, all the copies in the backup set are also unavailable.
Note: expired is not the same as obsolette. For the differences between the two, see: Document
Restrictions during verification:The target database must be started.
For backup sets on disks, channels are not required for verification. The backup set on the tape must use a channel. If Automatic channels are not configured for the tape, you must manually allocate
You can verify the backup before resetlogs execution, that is, you can verify different incarnation
RMAN> crosscheck backupset; -- verify the backup set
RMAN> crosscheck copy; -- verify the image copy
RMAN> crosscheck backup of controlfile; -- check the backup control file
RMAN> crosscheck backup of archivelog all; -- verify the archive logs of all backups.
RMAN> crosscheck backup of datafile; -- verify datafile
RMAN> crosscheck backup of tablespace sysaux, system; -- verify the tablespace sysaux, System
RMAN> crosscheck backup completed between '13-OCT-10 'and '23-OCT-10'; -- validate time period, time period format set by nls_date_format
RMAN> crosscheck backupset 1067,1068; -- verify the specified backup set
V. Use of the validate command
Verify the integrity of data in a backup set. RMAN scans all the backup slices of the Backup set and checks the checksum to verify whether the content can be restored successfully.
Validate is a higher verification operation than crosscheck. Crosscheck only checks the header information of the Backup set, verifies the existence of the file, and validate verifies the validity of the data.
RMAN> validate backupset <primary key> [check logical]
Check the logical test data and index block to fill in the verified logical error to the V $ database_block_partition uption view.
You can also use the restore... validate clause to test whether data can be restored, rather than actually restored.
Vi. Backup retention policy
The retention policy mainly refers to the rules for retaining backup copies, which are usually used to meet recovery or other needs (such as disk space or tape space size restrictions ). Backup retention policies are divided into redundancy and recovery windows. These two retention policies are incompatible, either using the former or using the latter
Backup Redundancy
The default value is, which can be modified through RMAN> Configure retention policy to redundancy 2;
At this time, RMAN generates a backup for each data file, archive log, and control file. You can use the report obsolete command to view backups with more than one backup and Delete Obsolete To delete outdated backups.
Restore window
The recovery window allows you to complete the restoration to the point in time at a previous point in time, usually set to how many days.
Run the command RMAN> Configure retetion policy to recovery window of 7 days
This command will ensure that there are enough data files and archive logs for execution to return Incomplete recovery at any time point in a week, and allow deletion of backup that becomes obsolete over time, this condition must be met: sysdate-Backup checkpoint time> = 7
If the backup is larger than days but is required for restoration, it will still be retained.
Clear backup retention policy
RMAN> Configure retention policy clear;
Note: obsolete and expired
Obsolete: determines whether the backup is required for Restoration Based on the retention policy. If the backup is not needed or is replaced by an updated backup, the backup set is set to obsolete, this is an discarded backup set or image copy.
Expired: During crosscheck, the backup set or image copy is located based on the backup information recorded in the storage warehouse, but the corresponding backup set or image copy cannot be found, these backup sets or image copies are set to expired.