ORA-00257: archiver error. Connect internal only, until freed引发的血案

本文介绍了如何使用RMAN命令进行数据库备份管理,包括检查并删除过期的归档日志、理解delete obsolete与delete expired的区别,以及如何利用REPORT命令分析备份状态。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我一向都是已解决方法为目的来解决问题,导致有些概念模糊不清晰。

先写下解决方法。

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:

  1. 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
    
    
  2. 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 NEED BACKUP TABLESPACE TBS_3     需要备份的表空间

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

 

 




 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值