question

SSGC avatar image
SSGC asked

restore sql 2012 database get stuck

Hi expert, I have a issue when I restore database on sql server 2012 sometime. There is a database in server, I want to copy this database to same server by different name use SSMS GUI to do so. For Example: AdventureWorks2012 -> AdventureWorks2016. I changed destination database name and data file name. When I hit ok button to run, it restored new database but original database restoring and get stuck. I need use backup to replace the original database. I am not sure how it happen. Did anyone see same issue? Thanks.
backupssmsrestoregui
5 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

JohnM avatar image JohnM commented ·
Can you clarify a little? You are able to successfully restore the backup to the new database name (and renaming the logical data/log files) and the original database goes into a restoring state?
0 Likes 0 ·
SSGC avatar image SSGC commented ·
Hi John, you are right. New database restored fine. But original database start restoring and never finished. It is happen on our production server SQL 2012 only.
0 Likes 0 ·
JohnM avatar image JohnM commented ·
I'm curious to know why the original database even entered into a restoring state. Were you trying to restore to that database? If you are just attempting to restore the backup to another database and changed the DB name and logical files, the original database shouldn't be touched.
0 Likes 0 ·
SSGC avatar image SSGC commented ·
John, right, i am not sure why it happen. If I forgot to change destination database name, it will restore original database. If I changed destination database name and forgot to change logical data/log files name, it will give me the error message. But SSMS restore GUI didn't give any message and start new database and original database restoring.
0 Likes 0 ·
JohnM avatar image JohnM commented ·
Can you post a screen shot of the GUI? Or even put in all of the variables/values that you did and then just script it out and post that.
0 Likes 0 ·

1 Answer

·
jason_clark03 avatar image
jason_clark03 answered
use this RESTORE DATABASE NameofDatabase WITH RECOVERY
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

SSGC avatar image SSGC commented ·
use code to restore database looks safe, i just wonder how the issue happen.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.