Restoring Transaction Log

  • Is there a way to switch a db to recovery mode in order to load transaction logs?

    I am creating a report server where I will send logs over to the server every couple of hours during the day so I need to have the db itself go into recovery mode and what is a best practice for removing the current connections to restore the log. Thanks in advance

  • If you restore with the RECOVERY option then you can not restore additional logs. But if you specify NORECOVERY or STANDBY you will be able to restore more logs. When using NORECOVERY you will not be able to access the database but if you use the STANDBY option you will be able to access the database in read only mode. This is usualy perfect for a report server. So look into the STANDBY option when restoring the log backups.

    To remove current users in a clean way you could execute the following (SQL 2000 only):

    ALTER DATABASE MyDatabase

    SET SINGLE_USER WITH ROLLBACK IMMEDIATE

    In SQL 7 I think you need to kill the connections with the kill command.

    In any case if you use the STANDBY option you don't need to kill the existing connections as I understand it. Just keep restoring your logs with the STANDBY option.

  • Thank you that was very informative. IF STANDBY option works the way you say it, its exactly what I need. Thanks again!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply