question

Mike 3 avatar image
Mike 3 asked

How do you stop a sql server 2005 database from restoring?

I have a database that is stuck in restore mode and I want to stop the restore process so I can start it over after making some updates/fixes. thanks.

I tried running "Restore database [dbname] with recovery" but this did not work and I got the following error "The database cannot be recovered because the log was not restored."

any help would be appreciated.

restore
10 |1200

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

Slick84 avatar image
Slick84 answered

Kill the SPID. Has happened with me a few times.

SP_WHO2 Active

KILL SPID

Once killed, restart your restore process and you should be able to do it without any hiccups. Hope this helps.

Thanks,
S

10 |1200

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

CirqueDeSQLeil avatar image
CirqueDeSQLeil answered

It looks like you may have some log backups that need to be restored. Is this part of log shipping or mirroring? Has there been a recent failover from primary to this server?

Did the server recently reboot during a heavy transaction?

Please provide errors from the error logs.

10 |1200

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

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.