1

I'm trying to restore a database from a validated backup (through RESTORE VERIFYONLY).

The command I've used :

RESTORE DATABASE [RESTORE] FILE = N'SharePoint_Config_3c0993c1866f419e9f8e906a920a6ae8' 
FROM  DISK = N'0000008B.bak' 
WITH  
    FILE = 1,  
    MOVE N'SharePoint_Config_3c0993c1866f419e9f8e906a920a6ae8' TO N'F:\RESTORE.mdf',  
    MOVE N'SharePoint_Config_3c0993c1866f419e9f8e906a920a6ae8_log' TO N'F:\RESTORE_log.ldf',  
    NOUNLOAD,  
    REPLACE,  
    STATS = 10
GO

At the end of the restore operation, I got this error :

...
100 percent processed.
Processed 16888 pages for database 'RESTORE', file 'SharePoint_Config_3c0993c1866f419e9f8e906a920a6ae8' on file 1.
Processed 1707474 pages for database 'RESTORE', file 'SharePoint_Config_3c0993c1866f419e9f8e906a920a6ae8_log' on file 1.
Msg 9004, Level 16, State 3, Line 1
An error occurred while processing the log for database 'RESTORE'.  If possible, restore from backup. If a backup is not available, it might be necessary to rebuild the log.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.

Then the database is stuck in RESTORING status. The error message suggest to rebuild the log, BUT in RESTORING state I can't do anything : the database can't be accessed for repair with DBCC CHECKDB.

I've tried :

RESTORE DATABASE [RESTORE] WITH RECOVERY
GO

Result :

Msg 4333, Level 16, State 1, Line 1
The database cannot be recovered because the log was not restored.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.

I've googled It many times, searching on this forum, but can't find a solution to apply suggested procedure "it might be necessary to rebuild the log."

My question is : how to get rid of this status, ie make the database status to be EMERGENCY so I can try to run repair tools on it ?

Hope somebody can help me. Regards.

Update 1

I've managed to get our database in "SUSPECT" status, with Sahnky's tweak. From there, and with some external help, I have run DDBCC CHECKDB with REPAIR_ALLOW_DATALOSS and got our database out of SUSPECT status.

I've omitted to mention that I've tried to RESTORE without the FILE option to perform a full restore, but it hangs with errors (I can't remember which ones).

  • @ypercube I've done the request at same time I've posted here, now accounts are merged :) – cJu Jul 11 '14 at 5:48
  • Nice, thank you. Deleting the obsolete comments. – ypercubeᵀᴹ Jul 11 '14 at 8:57
0

Please note that restore 'verifyonly' does not checks consistency of backup completely only a successful restore will guarantee that you backup is in consistent state. There is a option to use Continue_after_error can you please use that in your restore script.

RESTORE DATABASE [RESTORE] FILE = N'SharePoint_Config_3c0993c1866f419e9f8e906a920a6ae8' FROM DISK = N'0000008B.bak' WITH
FILE = 1,
MOVE N'SharePoint_Config_3c0993c1866f419e9f8e906a920a6ae8' TO N'F:\RESTORE.mdf',
MOVE N'SharePoint_Config_3c0993c1866f419e9f8e906a920a6ae8_log' TO N'F:\RESTORE_log.ldf',
NOUNLOAD,
REPLACE,
STATS = 10, CONTINUE_AFTER_ERROR

Please note that this is a temporary workaround if it works. You should get a fresh backup from production again. Also I highly recommend you to run dbcc checkdb on production database

| improve this answer | |
0

The RESTORE statement you supplied is a file restore, not a full restore of the database. You are restoring only the file specified in the FILE clause, in this case the logical file named 'SharePoint_Config_3c0993c1866f419e9f8e906a920a6ae8', and the database cannot be recovered because the transaction log file has not been restored.

You can peruse the Books On-Line page for File Restores for more detail, and how that differs from a Complete Database Restore.

I would suggest removing the FILE clause to perform a full restore of the entire database contained in the backup file, i.e.:

RESTORE DATABASE [RESTORE]
FROM DISK = N'0000008B.bak' 
WITH
  FILE = 1
  , MOVE N'SharePoint_Config_3c0993c1866f419e9f8e906a920a6ae8' TO N'F:\RESTORE.mdf'
  , MOVE N'SharePoint_Config_3c0993c1866f419e9f8e906a920a6ae8_log' TO N'F:\RESTORE_log.ldf'
  , REPLACE
  , STATS = 10
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.