question

Danny D avatar image
Danny D asked

SQL 2008: Fail to Restore database from a BAK file

I just built a test sql2008 server and try to bring a DB from sql2008 svr to the test server by restoring a DB using a bak file from sql2008 production server. The task failed with error:

" Restore failed for server 'XXX\yyy'. (Microsoft.sqlServer.SmoExtended) Additional information: System.Data.sqlclient.sqlError: The operating system returned the error '32(failed to retrieve text for this error. Reason: 15100)' while attempting 'restoreContainer::ValidateTargetForCreation' on 'w:\data\xxx.mdf' (Microsoft.sqlserver.smo)

Thanks for any help

sql-server-2008restore
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Håkan Winther avatar image
Håkan Winther answered

You can use RESTORE FILELISTONLY to return a result set containing a list of the database and log files contained in the backup set, and you need to use MOVE as sp_lock answered for every file that cannot use the original file path.

RESTORE FILELISTONLY FROM AdventureWorksBackups

If you suspect that the backup is corrupt you should use

RESTORE VERIFYONLY 
FROM AdventureWorksBackups
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sp_lock avatar image
sp_lock answered

Have you tried using the "move" parameter?

RESTORE DATABASE xxx
FROM DISK = 'd:\xxx_20091201.bak'
WITH RECOVERY,
  MOVE 'xxx_data' TO 'w:\data\xxx.mdf',
  MOVE 'xxx_Log' TO 'w:\data\xxx_log.ldf'
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ray Herring avatar image
Ray Herring answered

I have the same problem and it is not "corrupt" backups. I am working with a 300GB SQL 2000 database. I use Redgate backup 6.0 and the backups restore just fine to SQL 2000 and SQL 2005. On SQL 2008 I routinely see this error (Operating System error 32). Redgate shows the actual restore completes then the recovery starts and this error occurs.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

davegeeit001 avatar image
davegeeit001 answered
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.