Para melhor visualização, recomendo resolução de no mínimo 1280 x 800 e navegador Mozilla Firefox


terça-feira, 13 de novembro de 2018

Erro RMAN-06214 ao deletar snapshot de controlfile (snapcf_SID.f)

Por Eduardo Legatti

Olá,

Pode acontecer em alguns casos do RMAN detectar que existe um arquivo de backup obsoleto, ou seja, que não é necessário para a janela de recuperação em vigor, mas o mesmo não consegue ser removido ao apresentar o erro RMAN-06214. Geralmente é apresentado o erro RMAN-06207 que identifica que um arquivo de backup não pode ser removido devido ao status do arquivo não estar atualizado. Na maioria das vezes o comando CROSSCHECK resolve o problema, mas quando o arquivo é um snapshot de controlfile, deveremos realizar outra operação conforme demonstrado a seguir.

RMAN> report obsolete device type disk;

RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 4 days
Report of obsolete backups and copies
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Control File Copy     3     25/09/2013 15:17:09 /u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_BD01.f
Backup Set           14533  03/11/2018 00:17:17
  Backup Piece       14533  03/11/2018 00:17:17 /backup/flash_recovery_area/BD01/autobackup/2018_11_03/o1_mf_s_989972236_fwo7kx28_.bkp
Backup Set           14535  05/11/2018 00:15:54
  Backup Piece       14535  05/11/2018 00:15:54 /backup/flash_recovery_area/BD01/backupset/2018_11_05/o1_mf_ncnn1_LEVEL_1_DIARIO_fwtdptjw_.bkp
Backup Set           14536  05/11/2018 00:15:57
  Backup Piece       14536  05/11/2018 00:15:57 /backup/flash_recovery_area/BD01/autobackup/2018_11_05/o1_mf_s_990144957_fwtdpxgs_.bkp
Backup Set           14538  05/11/2018 00:17:04
  Backup Piece       14538  05/11/2018 00:17:04 /backup/flash_recovery_area/BD01/autobackup/2018_11_05/o1_mf_s_990145023_fwtdrzv3_.bkp
Backup Set           14540  05/11/2018 00:17:10
  Backup Piece       14540  05/11/2018 00:17:10 /backup/flash_recovery_area/BD01/autobackup/2018_11_05/o1_mf_s_990145030_fwtds6gw_.bkp
Backup Set           14541  05/11/2018 00:17:27
  Backup Piece       14541  05/11/2018 00:17:27 /backup/flash_recovery_area/BD01/backupset/2018_11_05/o1_mf_ncnnf_CONTROLFILE_fwtdsptf_.bkp
Backup Set           14577  06/11/2018 02:16:20
  Backup Piece       14577  06/11/2018 02:16:20 /backup/flash_recovery_area/BD01/backupset/2018_11_06/o1_mf_nnsnf_SPFILE_fx559mtp_.bkp


RMAN> delete noprompt obsolete device type disk;

RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 7 days
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=8 device type=DISK
Deleting the following obsolete backups and copies:

Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Control File Copy     3     25/09/2013 15:17:09 /u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_BD01.f
Backup Set           14533  03/11/2018 00:17:17
  Backup Piece       14533  03/11/2018 00:17:17 /backup/flash_recovery_area/BD01/autobackup/2018_11_03/o1_mf_s_989972236_fwo7kx28_.bkp
Backup Set           14535  05/11/2018 00:15:54
  Backup Piece       14535  05/11/2018 00:15:54 /backup/flash_recovery_area/BD01/backupset/2018_11_05/o1_mf_ncnn1_LEVEL_1_DIARIO_fwtdptjw_.bkp
Backup Set           14536  05/11/2018 00:15:57
  Backup Piece       14536  05/11/2018 00:15:57 /backup/flash_recovery_area/BD01/autobackup/2018_11_05/o1_mf_s_990144957_fwtdpxgs_.bkp
Backup Set           14538  05/11/2018 00:17:04
  Backup Piece       14538  05/11/2018 00:17:04 /backup/flash_recovery_area/BD01/autobackup/2018_11_05/o1_mf_s_990145023_fwtdrzv3_.bkp
Backup Set           14540  05/11/2018 00:17:10
  Backup Piece       14540  05/11/2018 00:17:10 /backup/flash_recovery_area/BD01/autobackup/2018_11_05/o1_mf_s_990145030_fwtds6gw_.bkp
Backup Set           14541  05/11/2018 00:17:27
  Backup Piece       14541  05/11/2018 00:17:27 /backup/flash_recovery_area/BD01/backupset/2018_11_05/o1_mf_ncnnf_CONTROLFILE_fwtdsptf_.bkp
Backup Set           14577  06/11/2018 02:16:20
  Backup Piece       14577  06/11/2018 02:16:20 /backup/flash_recovery_area/BD01/backupset/2018_11_06/o1_mf_nnsnf_SPFILE_fx559mtp_.bkp
deleted backup piece
backup piece handle=/backup/flash_recovery_area/BD01/autobackup/2018_11_03/o1_mf_s_989972236_fwo7kx28_.bkp RECID=14533 STAMP=989972237
deleted backup piece
backup piece handle=/backup/flash_recovery_area/BD01/backupset/2018_11_05/o1_mf_ncnn1_LEVEL_1_DIARIO_fwtdptjw_.bkp RECID=14535 STAMP=990144954
deleted backup piece
backup piece handle=/backup/flash_recovery_area/BD01/autobackup/2018_11_05/o1_mf_s_990144957_fwtdpxgs_.bkp RECID=14536 STAMP=990144957
deleted backup piece
backup piece handle=/backup/flash_recovery_area/BD01/autobackup/2018_11_05/o1_mf_s_990145023_fwtdrzv3_.bkp RECID=14538 STAMP=990145023
deleted backup piece
backup piece handle=/backup/flash_recovery_area/BD01/autobackup/2018_11_05/o1_mf_s_990145030_fwtds6gw_.bkp RECID=14540 STAMP=990145030
deleted backup piece
backup piece handle=/backup/flash_recovery_area/BD01/backupset/2018_11_05/o1_mf_ncnnf_CONTROLFILE_fwtdsptf_.bkp RECID=14541 STAMP=990145046
deleted backup piece
backup piece handle=/backup/flash_recovery_area/BD01/backupset/2018_11_06/o1_mf_nnsnf_SPFILE_fx559mtp_.bkp RECID=14577 STAMP=990497780
Deleted 7 objects

RMAN-06207: WARNING: 1 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   /u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_BD01.f


Após a tentativa de remoção dos arquivos obsoletos, ocorreu o erro RMAN-06207 acompanhado do erro RMAN-06214 indicando que o datafile copy snapcf_BD01.f não pode ser removido devido a um problema no status do arquivo. Para resolver o problema precisaremos atualizar o status do arquivo de forma que o mesmo se torne expirado.

RMAN> crosscheck copy;

using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=232 device type=DISK
specification does not match any datafile copy in the repository
validation failed for control file copy
control file copy file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_BD01.f RECID=3 STAMP=827075829
validation succeeded for archived log
archived log file name=/backup/flash_recovery_area/BD01/archivelog/2018_11_06/o1_mf_1_70882_fx4xmpkg_.arc RECID=88108 STAMP=990489943
validation succeeded for archived log
archived log file name=/backup/flash_recovery_area/BD01/archivelog/2018_11_06/o1_mf_1_70883_fx558m8z_.arc RECID=88109 STAMP=990497778
validation succeeded for archived log
archived log file name=/backup/flash_recovery_area/BD01/archivelog/2018_11_06/o1_mf_1_70884_fx558n5j_.arc RECID=88110 STAMP=990497778
validation succeeded for archived log
archived log file name=/backup/flash_recovery_area/BD01/archivelog/2018_11_06/o1_mf_1_70885_fx5h01op_.arc RECID=88111 STAMP=990507749
validation succeeded for archived log
archived log file name=/backup/flash_recovery_area/BD01/archivelog/2018_11_06/o1_mf_1_70886_fx5v4xnd_.arc RECID=88112 STAMP=990520190
validation succeeded for archived log
archived log file name=/backup/flash_recovery_area/BD01/archivelog/2018_11_06/o1_mf_1_70887_fx5v56tr_.arc RECID=88113 STAMP=990520199
Crosschecked 7 objects


Pronto. Agora basta remover o arquivo expirado conforme demonstrado abaixo.

RMAN> delete expired copy;

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=232 device type=DISK
specification does not match any datafile copy in the repository
specification does not match any archived log in the repository
List of Control File Copies
===========================

Key     S Completion Time Ckp SCN    Ckp Time
------- - --------------- ---------- ---------------
3       X 25/09/2013      7840543439301 25/09/2013
        Name: /u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_BD01.f
        Tag: TAG20130925T151707

Do you really want to delete the above objects (enter YES or NO)? y
deleted control file copy
control file copy file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_BD01.f RECID=3 STAMP=827075829
Deleted 1 EXPIRED objects

Google+

Nenhum comentário:

Postagens populares