Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

errror in restore the database

Posted on 2012-08-21
11
Medium Priority
?
476 Views
Last Modified: 2012-08-21
Hi,
Please help.
This is the error when I tried to restore the database sql2005
Database name is TEST

System.Data.SqlClient.SqlError: The operating system returned the error '32(error not found)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\TEST.mdf'. (Microsoft.SqlServer.Smo)

Many thanks

ll
0
Comment
Question by:lylyvn
  • 5
  • 5
11 Comments
 
LVL 12

Expert Comment

by:Tony303
ID: 38318871
Should you not be restoring from a .bak file?

If the TEST.mdf file is properly detatched (ie not in use still) then you need to re-attatch it.

https://www.zipsupport.com/support/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=1109
0
 

Author Comment

by:lylyvn
ID: 38318895
Hello,

Thanks for your reply.

Yes, I have select the *.bak file (not the database file)

Thanks
0
 
LVL 12

Expert Comment

by:Tony303
ID: 38318898
Is the server where the backup was created the same as the server you are restoring to?
IE is it a 32 vs 64 bit problem?

http://social.msdn.microsoft.com/Forums/en-US/sqldatabaseengine/thread/532f5380-3d8f-4c8c-9288-acf1eb284ecd/
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:lylyvn
ID: 38318906
Hi,
Both databases on the same server (2 instances) with the same platform is NT INTEL X86
Many thanks.
LL
0
 
LVL 12

Accepted Solution

by:
Tony303 earned 2000 total points
ID: 38318924
OK,

So let me get this straight.
You backed up a DB, now you are restoring it to the other intstance.

What are the 4 paths being used?
IE the .ldf and the .mdf file path for the source and destination DB's
0
 

Author Comment

by:lylyvn
ID: 38318948
I did not restore by sql statement, but from MS SQL Server Management Studio, right click on Databases /Restore Database.....

Thanks.
0
 
LVL 12

Expert Comment

by:Tony303
ID: 38318968
Yip,

I think the .mdf you are trying to restore to is already in use.
In the Options tab of the Restore Wizard....make sure the path to your mdf and ldf IS NOT THE PATH of the place where the backup was from.

You need to make a new path and filename for the .mdf or .ldf file.

Just check it is different.

T
0
 
LVL 8

Expert Comment

by:piyushranusri
ID: 38318990
seems issue with backup file.
please take another backup and then check.
i face same issue..
0
 

Author Comment

by:lylyvn
ID: 38319050
Dear all,

I have executed the following statements and it worked:

RESTORE DATABASE AdventureWorks
   FROM DISK= 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\adventureworks.BAK'
   WITH MOVE 'AdventureWorks_Data' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.3\MSSQL\Data\AdventureWorks_Data.mdf',
   MOVE 'AdventureWorks_Log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.3\MSSQL\Data\AdventureWorks_Log.ldf'

Thanks all for your help especially Tony303.

Many thanks
0
 
LVL 12

Expert Comment

by:Tony303
ID: 38319116
Great,

So the original problem was it was trying to restore the file to a name and path that was already active?

Tony.
0
 

Author Comment

by:lylyvn
ID: 38319129
I did not check but I thought that was the reason.
Thanks Tony.
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question