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
LVL 1
misermiceAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Raja Jegan RSQL Server DBA & Architect, EE Solution GuideCommented:
>> 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.
0
cyberkiwiCommented:
You need to go to the next tab in the restore wizard and change the location for the .mdf and .ldf files.
Basically when you backup a file, it remembers where the original .mdf and .ldf files are.
So when you backup from IST1 to IST2, it is still trying to restore the .mdf file from the backup to the old location - therefore clashing the the existing file from the other instance!
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
misermiceAuthor Commented:
Awesome
That was my exact problem
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.