Home All Groups Group Topic Archive Search About

How do I restore a database that is in use?



Author
17 Nov 2006 6:39 PM
apf
I have a massive transaction currently rolling back (I killed the spid.)  The
estimation is that it will take this transaction many hours to roll back. 
I've decided it will be faster to just restore a previous backup of the
database.

How do I initiate the restore?  I can't restore it now, because it says the
database is in use - the rolling back transaction is the only "user"
accessing the database.

Thanks in advance!!

Author
17 Nov 2006 7:21 PM
Tibor Karaszi
I guess one option is to stop SQL Server, delete the database files, start SQL Server, DROP the
database and then restore.

Show quoteHide quote
"apf" <a**@discussions.microsoft.com> wrote in message
news:16678A2E-5C94-4178-9D78-340CF4BD99D5@microsoft.com...
>I have a massive transaction currently rolling back (I killed the spid.)  The
> estimation is that it will take this transaction many hours to roll back.
> I've decided it will be faster to just restore a previous backup of the
> database.
>
> How do I initiate the restore?  I can't restore it now, because it says the
> database is in use - the rolling back transaction is the only "user"
> accessing the database.
>
> Thanks in advance!!
Are all your drivers up to date? click for free checkup

Author
17 Nov 2006 7:22 PM
Kevin3NF
If you are 100% certain this is what you want to do, you can stop SQL
Server, move the mdf/ldf files off and re-start.  The db will come up in
suspect mode.  Drop it and restore the backup.  SQL 2000.  I assume  similar
or identical process for SQL 2005

--
Kevin Hill
3NF Consulting
http://www.3nf-inc.com/NewsGroups.htm

Real-world stuff I run across with SQL Server:
http://kevin3nf.blogspot.com


Show quoteHide quote
"apf" <a**@discussions.microsoft.com> wrote in message
news:16678A2E-5C94-4178-9D78-340CF4BD99D5@microsoft.com...
>I have a massive transaction currently rolling back (I killed the spid.)
>The
> estimation is that it will take this transaction many hours to roll back.
> I've decided it will be faster to just restore a previous backup of the
> database.
>
> How do I initiate the restore?  I can't restore it now, because it says
> the
> database is in use - the rolling back transaction is the only "user"
> accessing the database.
>
> Thanks in advance!!
Author
17 Nov 2006 7:32 PM
Tibor Karaszi
Same applies for 2005, but the database isn't suspect. The GUI tools will not let you "expand" the
database.

This is, sort of, a soft suspect, so it can go back to normal if you stop SQL Server, slide the
files back in and start SQL Server again.

Show quoteHide quote
"Kevin3NF" <kevin@SPAMTRAP.3nf-inc.com> wrote in message
news:uQD%23B3nCHHA.992@TK2MSFTNGP03.phx.gbl...
> If you are 100% certain this is what you want to do, you can stop SQL Server, move the mdf/ldf
> files off and re-start.  The db will come up in suspect mode.  Drop it and restore the backup.
> SQL 2000.  I assume  similar or identical process for SQL 2005
>
> --
> Kevin Hill
> 3NF Consulting
> http://www.3nf-inc.com/NewsGroups.htm
>
> Real-world stuff I run across with SQL Server:
> http://kevin3nf.blogspot.com
>
>
> "apf" <a**@discussions.microsoft.com> wrote in message
> news:16678A2E-5C94-4178-9D78-340CF4BD99D5@microsoft.com...
>>I have a massive transaction currently rolling back (I killed the spid.) The
>> estimation is that it will take this transaction many hours to roll back.
>> I've decided it will be faster to just restore a previous backup of the
>> database.
>>
>> How do I initiate the restore?  I can't restore it now, because it says the
>> database is in use - the rolling back transaction is the only "user"
>> accessing the database.
>>
>> Thanks in advance!!
>
>
Author
17 Nov 2006 7:41 PM
apf
Thanks for the help!

I was hoping there was a way to do it without stopping SQL Server, but I
suspected that I would have to.

I'll take this as verification that I'm going to have to stop SQL Server.
Author
17 Nov 2006 9:03 PM
Tibor Karaszi
> I'll take this as verification that I'm going to have to stop SQL Server.

I'd wait out the rollback process if I were you...

Show quoteHide quote
"apf" <a**@discussions.microsoft.com> wrote in message
news:BA964863-8113-41B1-BBA2-8FA6E5183205@microsoft.com...
> Thanks for the help!
>
> I was hoping there was a way to do it without stopping SQL Server, but I
> suspected that I would have to.
>
> I'll take this as verification that I'm going to have to stop SQL Server.
>

Bookmark and Share