您的位置:首页 > 运维架构

RMAN-06214: Datafile Copy

2015-11-07 11:27 246 查看
以下的报错在RMAN每次备份之后delete obsolete总会报两个controlfilecopy删除不了,所以今天决定干掉他们
直接上报错:
RMAN-06207: WARNING: 2 objects could not be deleted for DISK channel(s) due
RMAN-06208:          to mismatched status.  Use CROSSCHECK command to fix status
RMAN-06210: List of Mismatched objects
RMAN-06211: ==========================
RMAN-06212:   Object Type   Filename/Handle
RMAN-06213: --------------- ---------------------------------------------------
RMAN-06214: Datafile Copy   /home/oracle/control02.ctl
RMAN-06214: Datafile Copy   /u01/app/oracle/product/11.2.3/dbhome_1/dbs/snapcf_orcl.f

RMAN> 
[oracle@testlinux1 ~]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Sat Nov 7 10:58:53 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: ORCL (DBID=1417667740)

先对上面两个报错的controlfilecopy进行crosscheck操作
RMAN> crosscheck controlfilecopy '/home/oracle/control02.ctl';  
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=147 device type=DISK
validation failed for control file copy
control file copy file name=/home/oracle/control02.ctl RECID=2 STAMP=892338104
Crosschecked 1 objects

RMAN> crosscheck controlfilecopy '/u01/app/oracle/product/11.2.3/dbhome_1/dbs/snapcf_orcl.f';
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=147 device type=DISK
validation failed for control file copy
control file copy file name=/u01/app/oracle/product/11.2.3/dbhome_1/dbs/snapcf_orcl.f RECID=12 STAMP=892644740
Crosschecked 1 objects

尝试删除obsolete
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
Deleting the following obsolete backups and copies:
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Control File Copy     2      05-OCT-15          /home/oracle/control02.ctl
Control File Copy     12     09-OCT-15          /u01/app/oracle/product/11.2.3/dbhome_1/dbs/snapcf_orcl.f

Do you really want to delete the above objects (enter YES or NO)? yes
deleted control file copy
control file copy file name=/home/oracle/control02.ctl RECID=2 STAMP=892338104
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of delete command on ORA_DISK_1 channel at 11/07/2015 11:00:31
ORA-19606: Cannot copy or restore to snapshot control file
只是删除了一个controlfilecopy。还剩一个snapshot controlfile删除不了

[oracle@testlinux1 bak]$ rm /u01/app/oracle/product/11.2.3/dbhome_1/dbs/snapcf_orcl.f   ---物理删除controlfilecopy快照

RMAN> crosscheck controlfilecopy '/u01/app/oracle/product/11.2.3/dbhome_1/dbs/snapcf_orcl.f';
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=147 device type=DISK
validation failed for control file copy
control file copy file name=/u01/app/oracle/product/11.2.3/dbhome_1/dbs/snapcf_orcl.f RECID=12 STAMP=892644740
Crosschecked 1 objects

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
Deleting the following obsolete backups and copies:
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Control File Copy     12     09-OCT-15          /u01/app/oracle/product/11.2.3/dbhome_1/dbs/snapcf_orcl.f

Do you really want to delete the above objects (enter YES or NO)? YES
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of delete command on ORA_DISK_1 channel at 11/07/2015 11:02:21
ORA-19606: Cannot copy or restore to snapshot control file

RMAN> show all;
RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
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.3/dbhome_1/dbs/snapcf_orcl.f'; # default

RMAN> delete force controlfilecopy '/u01/app/oracle/product/11.2.3/dbhome_1/dbs/snapcf_orcl.f';
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=147 device type=DISK
List of Control File Copies
===========================
Key     S Completion Time Ckp SCN    Ckp Time       
------- - --------------- ---------- ---------------
12      X 09-OCT-15       6347203    09-OCT-15      
        Name: /u01/app/oracle/product/11.2.3/dbhome_1/dbs/snapcf_orcl.f
        Tag: TAG20151009T125219
Do you really want to delete the above objects (enter YES or NO)? YES
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of delete command on ORA_DISK_1 channel at 11/07/2015 11:06:41
ORA-19606: Cannot copy or restore to snapshot control file

RMAN> crosscheck controlfilecopy '/u01/app/oracle/product/11.2.3/dbhome_1/dbs/snapcf_orcl.f';
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=147 device type=DISK
validation failed for control file copy
control file copy file name=/u01/app/oracle/product/11.2.3/dbhome_1/dbs/snapcf_orcl.f RECID=12 STAMP=892644740
Crosschecked 1 objects

RMAN> delete expired backupset;                    --因为不是backupset,所以就算前面物理删除了也不会在这边匹配的
using channel ORA_DISK_1
specification does not match any backup in the repository

RMAN> delete expired controlfilecopy '/u01/app/oracle/product/11.2.3/dbhome_1/dbs/snapcf_orcl.f';  --本以为这样定位到controlfilecopy应该是可以当做expired删除的,哪知却没有删除
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=147 device type=DISK
List of Control File Copies
===========================
Key     S Completion Time Ckp SCN    Ckp Time       
------- - --------------- ---------- ---------------
12      X 09-OCT-15       6347203    09-OCT-15      
        Name: /u01/app/oracle/product/11.2.3/dbhome_1/dbs/snapcf_orcl.f
        Tag: TAG20151009T125219
Do you really want to delete the above objects (enter YES or NO)? yes
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of delete command on ORA_DISK_1 channel at 11/07/2015 11:10:18
ORA-19606: Cannot copy or restore to snapshot control file

RMAN> show all;
RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
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.3/dbhome_1/dbs/snapcf_orcl.f'; # default

由于这个snapshot controlfile每次在备份的时候都会默认备份到/u01/app/oracle/product/11.2.3/dbhome_1/dbs/该目录下面,也只有这一个文件,故而想会不会是类似undo tablespace一样,你要删除现有的undo tablespace必须先创建新的undo tablespace,突发奇想在此先改一下snapshot controlfile备份的位置,再来删除试试
RMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/home/oracle/bak/snapcf_orcl.f';  
new RMAN configuration parameters:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/home/oracle/bak/snapcf_orcl.f';
new RMAN configuration parameters are successfully stored

RMAN> delete expired controlfilecopy '/u01/app/oracle/product/11.2.3/dbhome_1/dbs/snapcf_orcl.f';
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=147 device type=DISK
List of Control File Copies
===========================
Key     S Completion Time Ckp SCN    Ckp Time       
------- - --------------- ---------- ---------------
12      X 09-OCT-15       6347203    09-OCT-15      
        Name: /u01/app/oracle/product/11.2.3/dbhome_1/dbs/snapcf_orcl.f
        Tag: TAG20151009T125219
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.3/dbhome_1/dbs/snapcf_orcl.f RECID=12 STAMP=892644740
Deleted 1 EXPIRED objects
以上操作果真成功了,如果不想去管这个snapshot controlfile可以将目录还原成原来的

RMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.3/dbhome_1/dbs/snapcf_orcl.f';
old RMAN configuration parameters:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/home/oracle/bak/snapcf_orcl.f';
new RMAN configuration parameters:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.3/dbhome_1/dbs/snapcf_orcl.f';
new RMAN configuration parameters are successfully stored
RMAN> 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28473562/viewspace-1825226/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/28473562/viewspace-1825226/

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: