| |
 |
What
You have a database that you have been restoring transaction logs
to, perhaps as part of a log shipping setup, and you now want to
bring it online.
How
If your database is in recovery mode, run a command similar to the
following to bring it online (replace AdventureWorks with the name
of your database):
| RESTORE DATABASE AdventureWorks WITH RECOVERY |
If your database is in read-only mode, you will need to first
disconnect all connections to that database before you can bring it
online. You can kill the active connections one by one, or just run
a command similar to the following (replace AdventureWorks with the
name of your database):
USE master
ALTER DATABASE AdventureWorks SET OFFLINE WITH ROLLBACK
IMMEDIATE
ALTER DATABASE AdventureWorks SET ONLINE
RESTORE DATABASE AdventureWorks WITH RECOVERY |
Discuss or comment on this article on our Facebook group.
Document history
| 7/24/2008 | Initial release. |
|