Oracle故障处理:Rman delete obsolete报错ORA-19606解决

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Oracle故障处理:Rman delete obsolete报错ORA-19606解决相关的知识,希望对你有一定的参考价值。

在使用rman维护数据库备份记录的时候,通过delete obsolete命令删除文件的时候发生了ora-19606,具体报错如下:

RMAN> delete obsolete;

RMAN retention policy will be applied to the command

RMAN retention policy is set to redundancy 1

using channel ORA_DISK_1

using channel ORA_DISK_2

using channel ORA_DISK_3

using channel ORA_DISK_4

Deleting the following obsolete backups and copies:

Type                 Key    Completion Time    Filename/Handle

-------------------- ------ ------------------ --------------------

Control File Copy     18     26-JUN-2022 18:44:34 /u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_db1.f

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03009: failure of delete command on ORA_DISK_4 channel at 11/01/2022 13:55:45

ORA-19606: Cannot copy or restore to snapshot control file

Oracle故障处理:Rman

2、查看rman参数配置,配置如下:

RMAN> show all;

RMAN configuration parameters for database with db_unique_name db1 are:

CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default

CONFIGURE BACKUP OPTIMIZATION OFF; # default

CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default

CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default

CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO %F; # default

CONFIGURE DEVICE TYPE DISK PARALLELISM 4 BACKUP TYPE TO BACKUPSET;

CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default

CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default

CONFIGURE MAXSETSIZE TO UNLIMITED; # default

CONFIGURE ENCRYPTION FOR DATABASE OFF; # default

CONFIGURE ENCRYPTION ALGORITHM AES128; # default

CONFIGURE COMPRESSION ALGORITHM BASIC AS OF RELEASE DEFAULT OPTIMIZE FOR LOAD TRUE ; # default

CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default

CONFIGURE SNAPSHOT CONTROLFILE NAME TO /u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_db1.f; # default

Oracle故障处理:Rman

3、解决办法

3.1、重新设置SNAPSHOT CONTROLFILE路径,设置如下:

RMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO /u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_db1.f.xin;

new RMAN configuration parameters:

CONFIGURE SNAPSHOT CONTROLFILE NAME TO /u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_db1.f.xin;

new RMAN configuration parameters are successfully stored

3.2、交叉校验控制文件快照备份,如下:

RMAN> crosscheck controlfilecopy /u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_db1.f;

released channel: ORA_DISK_1

released channel: ORA_DISK_2

released channel: ORA_DISK_3

released channel: ORA_DISK_4

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=1148 instance=db1 device type=DISK

allocated channel: ORA_DISK_2

channel ORA_DISK_2: SID=2095 instance=db1 device type=DISK

allocated channel: ORA_DISK_3

channel ORA_DISK_3: SID=3044 instance=db1 device type=DISK

allocated channel: ORA_DISK_4

channel ORA_DISK_4: SID=1703 instance=db1 device type=DISK

validation failed for control file copy

control file copy file name=/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_db1.f RECID=18 STAMP=1108406674

Crosschecked 1 objects

3.3、删除过期的控制文件备份,如下:

RMAN> delete expired controlfilecopy /u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_db1.f;

released channel: ORA_DISK_1

released channel: ORA_DISK_2

released channel: ORA_DISK_3

released channel: ORA_DISK_4

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=1148 instance=db1 device type=DISK

allocated channel: ORA_DISK_2

channel ORA_DISK_2: SID=2095 instance=db1 device type=DISK

allocated channel: ORA_DISK_3

channel ORA_DISK_3: SID=3044 instance=db1 device type=DISK

allocated channel: ORA_DISK_4

channel ORA_DISK_4: SID=1703 instance=db1 device type=DISK

List of Control File Copies

===========================

Key     S Completion Time      Ckp SCN    Ckp Time            

------- - -------------------- ---------- --------------------

18      X 26-JUN-2022 18:44:34 16374875748810 26-JUN-2022 18:44:33

       Name: /u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_db1.f

       Tag: TAG20220626T184432

Do you really want to delete the above objects (enter YES or NO)? yes

deleted control file copy

control file copy file name=/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_db1.f RECID=18 STAMP=1108406674

Deleted 1 EXPIRED objects

3.4、将控制文件快照路径再设置成原来的参数值,如下:

RMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO /u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_db1.f;

old RMAN configuration parameters:

CONFIGURE SNAPSHOT CONTROLFILE NAME TO /u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_db1.f.xin;

new RMAN configuration parameters:

CONFIGURE SNAPSHOT CONTROLFILE NAME TO /u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_db1.f;

new RMAN configuration parameters are successfully stored

至此,使用rman维护删除过期的备份文件成功。

以上是关于Oracle故障处理:Rman delete obsolete报错ORA-19606解决的主要内容,如果未能解决你的问题,请参考以下文章

How to Delete Archivelog Using RMAN in Oracle

rman恢复方案和oracle异机恢复

DG环境RMAN删除归档报错RMAN-08137: archived log not deleted

RMAN备份归档日志ORA-19575

oracle 闪回区故障

利用SHELL脚本来验证Oracle数据库RMAN备份集的有效性