4 TB restore to compressed files ends in SQL error 5171
epetro
Posts: 69
Anyone have any luck recoverying from a 5171 error?
Is the USB drive to blame?
I'm torn between posting on SQL Backup 6 or SQL Storage Compress 5.
After 7+ hours, my test restore of a 589GB backup from USB failed with the following SQL error:
J:\NDF\Reporting01_Compress_ChargeAudit.NDFX is not a primary database file
I am attempting to restore 22 filegroups each with 1 file as a compressed database. I believe the data has been completely pulled from the .sqb file and compressed into the correct files. However, the database is now stuck in recovery, and my experience with SQL Storage Compress proves that this may never resolve itself.
The scenario thickens...
I had to use "VirtualDiskSize=1700" in order to bypass the inevitable error regarding free disk space. The 22 files are restored across 4 drives. Some of the files were restored to non-original disk drives, but I don't believe that is an issue. Each drive involved currently has a minimum of 68GB free.
I tried to run the DIFF with RECOVERY, but it failed with errors 4319.
Here is the code used to restore:(with carriage returns for readability)
EXECUTE master..sqlbackup '-SQL "
RESTORE DATABASE [Reporting01_Compress]
FROM DISK = ''F:\DatabaseBAK\REPORTING01\FULL_(local)_REPORTING01_20110709_060001.sqb''
WITH NORECOVERY
, MOVE ''REPORTING01'' TO ''K:\MDF\Reporting01_Compress.MDFX''
, MOVE ''REPORTING01_Log'' TO ''E:\LDF\Reporting01_Compress.LDFX''
, MOVE ''REPORTING01_PKEBC'' TO ''I:\IDF\Reporting01_Compress_PKEBC.NDFX''
, MOVE ''REPORTING01_MrgChargeActive'' TO ''E:\NDF\Reporting01_Compress_MrgChargeActive.NDFX''
, MOVE ''REPORTING01_ChargeActive'' TO ''K:\NDF\Reporting01_Compress_ChargeActive.NDFX''
, MOVE ''REPORTING01_LogTapeCharge_Indexes'' TO ''K:\IDF\Reporting01_Compress_LogTapeCharge_Indexes.NDFX''
, MOVE ''REPORTING01_Transactions'' TO ''J:\NDF\Reporting01_Compress_Transactions.NDFX''
, MOVE ''REPORTING01_TapeTempDemo'' TO ''J:\NDF\Reporting01_Compress_TapeTempDemo.NDFX''
, MOVE ''REPORTING01_ChargeAudit'' TO ''J:\NDF\Reporting01_Compress_ChargeAudit.NDFX''
, MOVE ''REPORTING01_RemitPostBatches'' TO ''J:\NDF\Reporting01_Compress_RemitPostBatches.NDFX''
, MOVE ''REPORTING01_LogChargeActive'' TO ''J:\NDF\Reporting01_Compress_LogChargeActive.NDFX''
, MOVE ''REPORTING01_LogInsuranceProfile'' TO ''J:\NDF\Reporting01_Compress_LogInsuranceProfile.NDFX''
, MOVE ''REPORTING01_LogWorkfileUserActivity'' TO ''E:\NDF\Reporting01_Compress_LogWorkfileUserActivity.NDFX''
, MOVE ''REPORTING01_PKDS'' TO ''E:\IDF\Reporting01_Compress_PKDS.NDFX''
, MOVE ''REPORTING01_LogTapeCharge'' TO ''I:\NDF\Reporting01_Compress_LogTapeCharge.NDFX''
, MOVE ''REPORTING01_ClaimLog'' TO ''I:\NDF\Reporting01_Compress_ClaimLog.NDFX''
, MOVE ''REPORTING01_Indexes01'' TO ''E:\IDF\Reporting01_Compress_Indexes01.NDFX''
, MOVE ''REPORTING01_ChargeAudit_Indexes'' TO ''K:\IDF\Reporting01_Compress_ChargeAudit_Indexes.NDFX''
, MOVE ''REPORTING01_LogChargeActive_Indexes'' TO ''E:\IDF\Reporting01_Compress_LogChargeActive_Indexes.NDFX''
, MOVE ''REPORTING01_ChargeActive_Indexes'' TO ''J:\IDF\Reporting01_Compress_ChargeActive_Indexes03.NDFX''
, MOVE ''REPORTING01_Transactions_Indexes'' TO ''J:\IDF\Reporting01_Compress_Transactions_Indexes.NDFX''
, MOVE ''REPORTING01_MrgTables'' TO ''E:\NDF\Reporting01_Compress_MrgTables.NDFX''"'
Is the USB drive to blame?
I'm torn between posting on SQL Backup 6 or SQL Storage Compress 5.
After 7+ hours, my test restore of a 589GB backup from USB failed with the following SQL error:
J:\NDF\Reporting01_Compress_ChargeAudit.NDFX is not a primary database file
I am attempting to restore 22 filegroups each with 1 file as a compressed database. I believe the data has been completely pulled from the .sqb file and compressed into the correct files. However, the database is now stuck in recovery, and my experience with SQL Storage Compress proves that this may never resolve itself.
The scenario thickens...
I had to use "VirtualDiskSize=1700" in order to bypass the inevitable error regarding free disk space. The 22 files are restored across 4 drives. Some of the files were restored to non-original disk drives, but I don't believe that is an issue. Each drive involved currently has a minimum of 68GB free.
I tried to run the DIFF with RECOVERY, but it failed with errors 4319.
Here is the code used to restore:(with carriage returns for readability)
EXECUTE master..sqlbackup '-SQL "
RESTORE DATABASE [Reporting01_Compress]
FROM DISK = ''F:\DatabaseBAK\REPORTING01\FULL_(local)_REPORTING01_20110709_060001.sqb''
WITH NORECOVERY
, MOVE ''REPORTING01'' TO ''K:\MDF\Reporting01_Compress.MDFX''
, MOVE ''REPORTING01_Log'' TO ''E:\LDF\Reporting01_Compress.LDFX''
, MOVE ''REPORTING01_PKEBC'' TO ''I:\IDF\Reporting01_Compress_PKEBC.NDFX''
, MOVE ''REPORTING01_MrgChargeActive'' TO ''E:\NDF\Reporting01_Compress_MrgChargeActive.NDFX''
, MOVE ''REPORTING01_ChargeActive'' TO ''K:\NDF\Reporting01_Compress_ChargeActive.NDFX''
, MOVE ''REPORTING01_LogTapeCharge_Indexes'' TO ''K:\IDF\Reporting01_Compress_LogTapeCharge_Indexes.NDFX''
, MOVE ''REPORTING01_Transactions'' TO ''J:\NDF\Reporting01_Compress_Transactions.NDFX''
, MOVE ''REPORTING01_TapeTempDemo'' TO ''J:\NDF\Reporting01_Compress_TapeTempDemo.NDFX''
, MOVE ''REPORTING01_ChargeAudit'' TO ''J:\NDF\Reporting01_Compress_ChargeAudit.NDFX''
, MOVE ''REPORTING01_RemitPostBatches'' TO ''J:\NDF\Reporting01_Compress_RemitPostBatches.NDFX''
, MOVE ''REPORTING01_LogChargeActive'' TO ''J:\NDF\Reporting01_Compress_LogChargeActive.NDFX''
, MOVE ''REPORTING01_LogInsuranceProfile'' TO ''J:\NDF\Reporting01_Compress_LogInsuranceProfile.NDFX''
, MOVE ''REPORTING01_LogWorkfileUserActivity'' TO ''E:\NDF\Reporting01_Compress_LogWorkfileUserActivity.NDFX''
, MOVE ''REPORTING01_PKDS'' TO ''E:\IDF\Reporting01_Compress_PKDS.NDFX''
, MOVE ''REPORTING01_LogTapeCharge'' TO ''I:\NDF\Reporting01_Compress_LogTapeCharge.NDFX''
, MOVE ''REPORTING01_ClaimLog'' TO ''I:\NDF\Reporting01_Compress_ClaimLog.NDFX''
, MOVE ''REPORTING01_Indexes01'' TO ''E:\IDF\Reporting01_Compress_Indexes01.NDFX''
, MOVE ''REPORTING01_ChargeAudit_Indexes'' TO ''K:\IDF\Reporting01_Compress_ChargeAudit_Indexes.NDFX''
, MOVE ''REPORTING01_LogChargeActive_Indexes'' TO ''E:\IDF\Reporting01_Compress_LogChargeActive_Indexes.NDFX''
, MOVE ''REPORTING01_ChargeActive_Indexes'' TO ''J:\IDF\Reporting01_Compress_ChargeActive_Indexes03.NDFX''
, MOVE ''REPORTING01_Transactions_Indexes'' TO ''J:\IDF\Reporting01_Compress_Transactions_Indexes.NDFX''
, MOVE ''REPORTING01_MrgTables'' TO ''E:\NDF\Reporting01_Compress_MrgTables.NDFX''"'
Comments
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8
I have been able to run a VERIFYONLY which returned an exitcode=0 and sqlerrorcode=0. This process takes 6 hours.
I have deleted the (In Recovery)database and will make a second attempt with the same file and process.
SQL error 5171: J:\NDF\Reporting01_Compress_RemitPostBatches.NDFX is not a primary database file.
I see some ads for 3rd parth software to repair(attempt) this error.
Does RedGate offer anything that would assist?
Over the weekend I created a new backup file on a new drive. The compress restore again failed with the same erorr.
SQL error 5171: J:\NDF\Reporting01_Compress_RemitPostBatches.NDFX is not a primary database file.
It really looks like all the data is there as files, can I attach it or something?
The database cannot be recovered because the log was not restored.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
Over the weekend I developed a producer new backup document on the producer new drive. The compress restore once more failed using the identical erorr.
SQL error 5171: J:NDFReporting01_Compress_RemitPostBatches.NDFX is not really a principal databases file.
It genuinely appears like each of the details is there as files, can I attach it or something?
Perhaps the restore will play nicer with it.
Also, have you run DBCC CHECKDB on the source database at all?
Pete
Red Gate Software Ltd
+44 (0)870 160 0037 ext. 8569
1 866 RED GATE ext. 8569
I have had great success with smaller databases(Native 600GB-) They average 82% compression. (Meaning a 500GB db now has a footprint of 90GB). I think I will inquire on the Compression forum regarding large restores now that I don't believe the backup to be at fault.
The second forum is here.
I updated to 6.5.1.9 AND UPDATED SERVER COMPONENTS
The next attempt at a restore, I adjusted some file locations in the 'move to' segment.
6 hours later...Success!
Now on to load testing.
(Note: I found the server components outdated when support requested a log file. I opened it and saw a 6.3.?.? So some credit goes to support )