Link to home
Start Free TrialLog in
Avatar of lylyvn
lylyvn

asked on

errror in restore the database

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
Avatar of Tony303
Tony303
Flag of New Zealand image

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
Avatar of lylyvn
lylyvn

ASKER

Hello,

Thanks for your reply.

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

Thanks
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/
Avatar of lylyvn

ASKER

Hi,
Both databases on the same server (2 instances) with the same platform is NT INTEL X86
Many thanks.
LL
ASKER CERTIFIED SOLUTION
Avatar of Tony303
Tony303
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lylyvn

ASKER

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

Thanks.
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
seems issue with backup file.
please take another backup and then check.
i face same issue..
Avatar of lylyvn

ASKER

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
Great,

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

Tony.
Avatar of lylyvn

ASKER

I did not check but I thought that was the reason.
Thanks Tony.