先写下解决方法。
SQL> select * from V$FLASH_RECOVERY_AREA_USAGE;
FILE_TYPE PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
------------ ------------------ ------------------------- ---------------
CONTROLFILE 0 0 0
ONLINELOG 0 0 0
ARCHIVELOG 48.21(这个已经快满了,当时) 0 306
BACKUPPIECE 0 0 0
IMAGECOPY 0 0 0
FLASHBACKLOG .06 0 11
进入RMAN执行
rman target /
检查一些无用的archivelog
RMAN> crosscheck archivelog all;
删除过期的归档
RMAN> delete expired archivelog all;
当初对delete obsolete和delete expired 这两个概念是模糊的。而且对report和crosscheck的概念也有些模糊不清。
以下是官方文档对crosscheck和expired的解释
When the CROSSCHECK command is used to determine whether backups recorded in the repository still exist on disk or tape, if RMAN cannot locate the backups, then it updates their records in the RMAN repository to EXPIRED status. You can then use the DELETE EXPIRED command to remove records of expired backups from the RMAN repository. If the expired files still exist, then the DELETE EXPIRED command terminates with an error.
To delete expired repository records:
-
If you have not performed a crosscheck recently, then issue a CROSSCHECK command. For example, issue:
CROSSCHECK BACKUP; # checks backup sets and copies on configured channels
-
Delete the expired backups. For example, issue:
DELETE EXPIRED BACKUP;
读后感,delete expired 就是删除RMAN repository 的被标记为expired的records。
下面是delete obsolete的解释
The RMAN DELETE command supports an OBSOLETE option, which deletes backups that are obsolete, that is, no longer needed to satisfy specified recoverability requirements. You can delete files obsolete according to the configured default retention policy, or another retention policy that you specify as an option to the DELETE OBSOLETE command. 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.
If you specify the DELETE OBSOLETE command with no arguments, then RMAN deletes all obsolete backups defined by the currently configured retention policy For example:
DELETE OBSOLETE;
You can also use the REDUNDANCY or RECOVERY WINDOW clauses with DELETE to delete backups obsolete under a specific retention policy instead of the configured default:
DELETE OBSOLETE REDUNDANCY = 3;
DELETE OBSOLETE RECOVERY WINDOW OF 7 DAYS;
delete obsolete就是根据备份策略直接的删除以前那些obsolete的backups。
REPORT的概念
用来分析可用的备份和让你的数据库回答一些重要的问题,例如:
哪些文件需要备份?
哪些文件有做过不可恢复的操作?
哪些备份是废弃的且可以删除的?
之前一段时间内的数据库的物理schema是怎么样的?
目前哪些文件还没有备份?
REPORT NEED BACKUP
分析哪些数据文件在制定的策略下面需要备份
REPORT UNRECOVERABLE
分析哪些数据文件需要备份,由于这些文件做了一些nologging的操作,例如direct-path insert
REPORT NEED BACKUP RECOVERY WINDOW OFn DAYS
REPORT NEED BACKUP REDUNDANCYn
REPORT NEED BACKUP DAYS = n 展示有N天的archived redo log 可供恢复使用的文件需要备份
REPORT NEED BACKUP INCREMENTAL n
RMAN> REPORT UNRECOVERABLE; 不可恢复操作的数据文件的备份的需要
RMAN> REPORT OBSOLETE; 分析哪些废弃的文件可以被删除。
RMAN> REPORT SCHEMA; 展示数据库的数据文件的信息
REPORT SCHEMA AT TIME 'SYSDATE-14'; # schema 14 days ago
REPORT SCHEMA AT SCN 1000; # schema at scn 1000
REPORT SCHEMA AT SEQUENCE 100 THREAD 1; # schema at sequence 100