Link to home
Start Free TrialLog in
Avatar of misermice
misermice

asked on

Restore DB fails

I created two named instances on my machine
SYED
DEVDB

Backed up AdventureWorks to C:Backup/bkp1

tried to restore onto DEVDB ????

It fails.. it says


 TITLE: Microsoft SQL Server Management Studio------------------------------Restore failed for Server 'ZAFAR-PC\DEVDB'. (Microsoft.SqlServer.SmoExtended)For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.0.2531.0+((Katmai_PCU_Main).090329-1045+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476------------------------------ADDITIONAL INFORMATION:System.Data.SqlClient.SqlError: The operating system returned the error '32(The process cannot access the file because it is being used by another process.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER2\MSSQL\DATA\AdventureWorks.mdf'. (Microsoft.SqlServer.Smo)For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.0.2531.0+((Katmai_PCU_Main).090329-1045+)&LinkId=20476------------------------------BUTTONS:OK------------------------------ - did not match any documents.


After several tries I tried the following

1. Disconnected the first Instance completely... NO USE
2. Restarted SSMS............................................. NO USE

just now while I am typing this question in EE i tried again..
very carelessly ..so i gave DB name as 1234

...and it worked..

So When i restore DB on to another Instance do i have to change the DB name ?

My SS Config Manager Screen shot is attached

Please Help
error1.PNG
Avatar of Raja Jegan R
Raja Jegan R
Flag of India image

>> So When i restore DB on to another Instance do i have to change the DB name ?

Seems like you tried to restore it in the same instance where you took the backup from and hence it would have failed..
Changing DB Name is required if any database is already present with that name.
ASKER CERTIFIED SOLUTION
Avatar of cyberkiwi
cyberkiwi
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 misermice
misermice

ASKER

Awesome
That was my exact problem