• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 222
  • Last Modified:

Can't Restore Staging Version of Database (from production backup) on Same Server 2012

I'm having a heck of a time.  I made a backup of my production DB in the hopes of refreshing my staging copy that lives on the same server.  No matter what I do I keep getting an error that the DB is in use (the one I'm restoring to).  I've tried deleting the staging DB, recreating an "empty" one and then doing the restore.  I've tried changing the name of the files it's getting restored to.  I tried NOT deleting it first.  Further, it's only something I've started to encounter on 2012 server.  Previously I never had this issue.

I know I'm doing something simple and quite stupid wrong but I just don't know what.

Please HELP!!!
0
cat4larry
Asked:
cat4larry
  • 2
1 Solution
 
Aaron ShiloChief Database ArchitectCommented:
hi

1. restart the sql server service.
2. delete the staging db
3. restore the db, make sure that the file your about to restore dont already exist in the destination.
0
 
Surendra NathTechnology LeadCommented:
if you are using SQL Server 2012... and using the restore wizard...

you have option in the wizard (in the options tab), to close the existing connections to the database checkbox, tick this checkbox and click ok.

I faced this issue once and it got resolved by doing this.
0
 
cat4larryAuthor Commented:
Actually, it turned out to be the "take tail log backup before restore" option.  As soon as I flipped that off, it worked no problem.

Thanks for the feedback though.
0
 
cat4larryAuthor Commented:
I solved the problem myself.  I had to turn the "take tail-log backup before restore" option off and then the DB restored without issue.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now