Loading Transaction Logs

If a situation arises that requires you to recover from database and transaction log dumps, the load procedure needs to be completed in one continuous step. That is, the database should first be loaded, followed by each of the transaction logs, with no activity taking place in between each load. However, users can be actively doing updates in other databases. If any updates take place in the target database before all the logs have been loaded, when the next log load is attempted, SQL Server will raise error 4306, stating:

There was activity on database since last load, unable to load. Must restart load sequence with the load database to continue.

As the error indicates, you must start back at the beginning by loading the database dump, followed by all the log dumps. For this reason, it is often advisable to start SQL Server in single-user mode when loading a database. In single-user mode, only one user at a time is allowed access to SQL Server, and this should be the person loading the database.

Alternatively, SQL Server could be started normally, but SQL Enterprise Manager or sp_dboption could be used to turn on the single user option for the database being loaded. This allows users to freely access other databases on the server but allows only one person to access the database being loaded (this should be the person performing the load).

Caution Shutting down and restarting SQL Server during a load sequence can lead to error 4306, because the SHUTDOWN statement puts a checkpoint record in each database, and each database is checkpointed when SQL Server is restarted.