Empty Backup Piece in RMAN

Yesterday I needed to do a comlete database restore since the DATA diskgroup was corrupted and could not be mounted:

SQL> alter diskgroup data mount;
alter diskgroup data mount
*
ERROR in line 1:
ORA-15096: lost disk write detected

This was due to an interruption of power supply and buffered writes that were not written to disk. So the only solution was to drop and re-create the diskgroup from scratch loosing all the data inside that DATA diskgroup.

SQL> drop diskgroup data force including contents;

Diskgroup dropped;

SQL> create diskgroup data redundancy external diks '\\.\ORCLDISKDATA0', '\\.\ORCLDISKDATA1';

Diskgroup created;

Now since every datafile was gone I needed to restore the database from scratch. Fortunately there was another diskgroup FRA which was not corrupted. And it held a copy of the controlfile. So I first started the instance with a simple pfile in order to restore the spfile afterwards.

db_name=mydb
compatible=11.1.0.0.0
control_files='+fra/mydb/controlfile.current.4711
sga_target=2g

Then go to RMAN and do the restore:

RMAN> startup mount;
RMAN> restore spfile to 'c:\temp\spfilemydb.ora';
RMAN> shutdown immediate;

Now I created a temporary pfile from that restored spfile, changed the control_files parameter to ‘+DATA’,’+FRA’ in order to get two brand-new controlfiles, and created an spfile now inside ASM which I then used to restart the instance.

Now follows the funny part. I started the database restore which took a long time but went fine.

RMAN> restore database;

Easy. Now the recovery. I checked the available backup pieces which were spread over tapes and repmovable disks. I found one backup piece which sounded like an archivelog backup but contained nothing according to the controlfile.

MAN> list backuppiece 'G:\ARC_883008933_S28127_P1';

List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
13625   12924   1   1   AVAILABLE   DISK        G:\ARC_883008933_S28127_P1                                                                                    
														  
RMAN> list backupset 12924; 

List of Backup Sets
===================
															
BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ -------------------                
12924   2.48G      DISK        00:01:49     22.06.2015 00:17:22                        

BP Key: 13625   Status: AVAILABLE  Compressed: NO  Tag: ARC                    
Piece Name: G:\ARC_883008933_S28127_P1 

The file was really there and was exactly the size RMAN mentioned. But for whatever reason no content was recorded. And I was missing some archivelogs which I really really would have liked to have in place for recovery. That’s why I tried to look into that backup piece since I was assuming that it contains my missing archivelogs. Just re-cataloging is not sufficient.

RMAN> catalog start with 'G:\';

searching for all files that match the pattern G:\
no files found to be unknown to the database

So I just renamed the file to ‘G:\TARC_883008933_S28127_P1′ and tried the catalog command again.

RMAN> catalog start with 'g:\T';
searching for all files that match the pattern g:\T

List of Files Unknown to the Database
=====================================
File Name: G:\TARC_883008933_S28127_P1

Do you really want to catalog the above files (enter YES or NO)? yes

cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: G:\TARC_883008933_S28127_P1


RMAN> list backuppiece 'G:\TARC_883008933_S28127_P1';

List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
13633   12924   1   2   AVAILABLE   DISK        G:\TARC_883008933_S28127_P1


RMAN> list backupset 12924;

List of Backup Sets                                                            
===================
BS Key  Size
------- ----------
12924   2.48G

List of Archived Logs in backup set 12924

Thrd Seq     Low SCN    Low Time            Next SCN   Next Time
---- ------- ---------- ------------------- ---------- ---------
2    68379   2830068124 21.06.2015 09:54:37 2830104357 21.06.2015 10:02:27
2    68380   2830104357 21.06.2015 10:02:27 2830156671 21.06.2015 10:10:46
2    68381   2830156671 21.06.2015 10:10:46 2830187258 21.06.2015 10:17:36
2    68382   2830187258 21.06.2015 10:17:36 2830213445 21.06.2015 10:22:01
2    68383   2830213445 21.06.2015 10:22:01 2830239509 21.06.2015 10:27:06
2    68384   2830239509 21.06.2015 10:27:06 2830257850 21.06.2015 10:30:47
2    68385   2830257850 21.06.2015 10:30:47 2830273799 21.06.2015 10:34:01
2    68386   2830273799 21.06.2015 10:34:01 2830306271 21.06.2015 10:41:34
2    68387   2830306271 21.06.2015 10:41:34 2830325027 21.06.2015 10:45:18
2    68388   2830325027 21.06.2015 10:45:18 2830352735 21.06.2015 10:51:05
2    68389   2830352735 21.06.2015 10:51:05 2830383695 21.06.2015 10:58:41
2    68390   2830383695 21.06.2015 10:58:41 2830414559 21.06.2015 11:04:32
2    68391   2830414559 21.06.2015 11:04:32 2830446480 21.06.2015 11:12:14
2    68392   2830446480 21.06.2015 11:12:14 2830471834 21.06.2015 11:18:15
2    68393   2830471834 21.06.2015 11:18:15 2830486546 21.06.2015 11:22:14
2    68394   2830486546 21.06.2015 11:22:14 2830509633 21.06.2015 11:28:05
2    68395   2830509633 21.06.2015 11:28:05 2830530886 21.06.2015 11:32:21
2    68396   2830530886 21.06.2015 11:32:21 2830576051 21.06.2015 11:39:08
2    68397   2830576051 21.06.2015 11:39:08 2830604761 21.06.2015 11:46:28
2    68398   2830604761 21.06.2015 11:46:28 2830623622 21.06.2015 11:51:07
2    68399   2830623622 21.06.2015 11:51:07 2830647907 21.06.2015 11:57:49
2    68400   2830647907 21.06.2015 11:57:49 2830669866 21.06.2015 12:01:42
2    68401   2830669866 21.06.2015 12:01:42 2830701975 21.06.2015 12:10:05
2    68402   2830701975 21.06.2015 12:10:05 2830717193 21.06.2015 12:14:11
2    68403   2830717193 21.06.2015 12:14:11 2830753093 21.06.2015 12:26:11
2    68404   2830753093 21.06.2015 12:26:11 2830791736 21.06.2015 12:34:43
2    68405   2830791736 21.06.2015 12:34:43 2830819126 21.06.2015 12:41:23
2    68406   2830819126 21.06.2015 12:41:23 2830842054 21.06.2015 12:46:41
2    68407   2830842054 21.06.2015 12:46:41 2830862566 21.06.2015 12:51:31
2    68408   2830862566 21.06.2015 12:51:31 2830880088 21.06.2015 12:55:39
2    68409   2830880088 21.06.2015 12:55:39 2830906001 21.06.2015 12:59:57
2    68410   2830906001 21.06.2015 12:59:57 2830925092 21.06.2015 13:03:40
2    68411   2830925092 21.06.2015 13:03:40 2830947332 21.06.2015 13:08:58
2    68412   2830947332 21.06.2015 13:08:58 2830969688 21.06.2015 13:15:03
2    68413   2830969688 21.06.2015 13:15:03 2830996091 21.06.2015 13:22:02
2    68414   2830996091 21.06.2015 13:22:02 2831029186 21.06.2015 13:28:27
2    68415   2831029186 21.06.2015 13:28:27 2831043107 21.06.2015 13:31:51
2    68416   2831043107 21.06.2015 13:31:51 2831066514 21.06.2015 13:36:33
2    68417   2831066514 21.06.2015 13:36:33 2831099209 21.06.2015 13:46:16
2    68418   2831099209 21.06.2015 13:46:16 2831127405 21.06.2015 13:57:43
2    68419   2831127405 21.06.2015 13:57:43 2831163498 21.06.2015 14:09:31
2    68420   2831163498 21.06.2015 14:09:31 2831200968 21.06.2015 14:25:49
2    68421   2831200968 21.06.2015 14:25:49 2831239025 21.06.2015 14:43:08
2    68422   2831239025 21.06.2015 14:43:08 2831287068 21.06.2015 15:02:15
2    68423   2831287068 21.06.2015 15:02:15 2831321905 21.06.2015 15:16:43
2    68424   2831321905 21.06.2015 15:16:43 2831376687 21.06.2015 15:38:14
2    68425   2831376687 21.06.2015 15:38:14 2831420993 21.06.2015 15:58:56
2    68426   2831420993 21.06.2015 15:58:56 2831446376 21.06.2015 16:10:36
2    68427   2831446376 21.06.2015 16:10:36 2831472168 21.06.2015 16:21:27
2    68428   2831472168 21.06.2015 16:21:27 2831499369 21.06.2015 16:31:42
2    68429   2831499369 21.06.2015 16:31:42 2831541993 21.06.2015 16:46:16
2    68430   2831541993 21.06.2015 16:46:16 2831578975 21.06.2015 17:00:32
2    68431   2831578975 21.06.2015 17:00:32 2831615358 21.06.2015 17:13:55
2    68432   2831615358 21.06.2015 17:13:55 2831645246 21.06.2015 17:28:32
2    68433   2831645246 21.06.2015 17:28:32 2831677592 21.06.2015 17:54:21
2    68434   2831677592 21.06.2015 17:54:21 2831728008 21.06.2015 18:32:20
2    68435   2831728008 21.06.2015 18:32:20 2831764928 21.06.2015 19:35:43
2    68436   2831764928 21.06.2015 19:35:43 2831803761 21.06.2015 21:06:29
2    68437   2831803761 21.06.2015 21:06:29 2831838675 21.06.2015 22:02:41
2    68438   2831838675 21.06.2015 22:02:41 2831883176 22.06.2015 00:00:45
2    68439   2831883176 22.06.2015 00:00:45 2831888127 22.06.2015 00:11:16

Backup Set Copy #1 of backup set 12924
Device Type Elapsed Time Completion Time     Compressed Tag
----------- ------------ ------------------- ---------- ---
DISK        00:01:49     22.06.2015 00:17:22 NO         ARC

List of Backup Pieces for backup set 12924 Copy #1

BP Key  Pc# Status      Piece Name
------- --- ----------- ----------
13625   1   AVAILABLE   G:\ARC_883008933_S28127_P1

Backup Set Copy #2 of backup set 12924

Device Type Elapsed Time Completion Time     Compressed Tag
----------- ------------ ------------------- ---------- ---
DISK        00:01:49     26.06.2015 10:42:47 NO         ARC

List of Backup Pieces for backup set 12924 Copy #2

BP Key  Pc# Status      Piece Name
------- --- ----------- ----------
13633   1   AVAILABLE   G:\TARC_883008933_S28127_P1

See, now I have two copies of my backup set, one containing a number of archivelogs and the other one still containing nothing. Strange behavior and I have no clue why the information was missing in the first place. But nevertheless I was now able to recover the database, still incomplete but at least consistent, and make the customer happy. Weekend saved.

Advertisements