Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sureshprabhu
Starting Member
32 Posts |
Posted - 2007-11-03 : 06:24:38
|
Hi,I have one backup file of one database, I want to restore the database to server using that backup file. But when I tried to restore the database using that backup file, the query executed successfully, but in management studio at the database it is showing the message like 'Restoring the database'. The database i am trying to restore is about 2.71gb memory. I executed the query 4hrs back but still it is showing same message that it is getting restored. Why it is showing like this. Please help me to solve this problem.The query i used to restore the database is -'RESTORE DATABASE [Everydayonline] FROM DISK = N'D:\BOOKS\EverydayBackUp' WITH NORECOVERY, NOUNLOAD, STATS = 10,MOVE 'ASPNETDB_983ed943e1fe49e3ae7fa189b823b238_DAT' TO 'D:\SQL\EverydayOnline.mdf',MOVE 'ASPNETDB_TMP_log' TO 'D:\SQL\EverydayOnline_log.ldf'GO' |
|
snSQL
Master Smack Fu Yak Hacker
1837 Posts |
Posted - 2007-11-03 : 14:10:58
|
If you use the NORECOVERY option then the database stays in recovery mode so that you could for example restore transaction logs to it before bringing it online. So if you want it be be online after that restore, change NORECOVERY to RECOVERY. |
|
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2007-11-03 : 20:32:26
|
Just run 'RESTORE DATABASE [Everydayonline] WITH RECOVERY', it'll put db online. |
|
|
snSQL
Master Smack Fu Yak Hacker
1837 Posts |
Posted - 2007-11-04 : 02:11:41
|
Isn't that what I said? |
|
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2007-11-04 : 02:29:25
|
Maybe, just make it more clear. |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-11-04 : 02:30:19
|
I think what rmiao was meaning is that you can restore a backup (and subsequent TLogs etc.) with NORECOVERY and then realise that you have NO MORE FILES to restore, and then you can just use his RESTORE command - with NO files listed - to change the database to "available". So the OP can do that, without having to re-restore from the BAK file(s)Kristen |
|
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2007-11-04 : 02:32:36
|
You got it Kristen, thank you. |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-11-04 : 02:43:48
|
I think that "not a lot of people know that" and assume RESTORE needs files |
|
|
|
|
|
|
|