liveBook · Manning

Bulk-logged recovery model

As explained in 100 SQL Server Mistakes and How to Avoid Them

The bulk-logged recovery model is a SQL Server recovery configuration that minimally logs certain bulk operations while limiting point-in-time recovery.

1. Mistake: treating BULK_LOGGED as a permanent replacement for FULL. It is a temporary SQL Server recovery configuration for heavy bulk work: selected operations are minimally logged, reducing log usage and transaction-log I/O, but point-in-time recovery is unavailable. section 9.4 section 12.6

Use the configuration cautiously:

  • Switch from FULL to BULK_LOGGED immediately before a known heavy ETL or bulk-insert operation. section 9.4 section 12.6
  • Switch back to FULL when the operation ends and take a transaction-log backup. section 9.4
  • Do not promise recovery to a time inside the bulk-logged interval; restoration reaches only the end of the relevant log backup. section 9.4 section 12.6

MarketingArchive nightly load

Before the warehouse ETL begins, configure the database with: ALTER DATABASE MarketingArchive SET RECOVERY BULK_LOGGED WITH NO_WAIT; After the bulk load, restore FULL recovery and take a transaction-log backup. This reduces pressure on the log volume while preserving the normal recovery arrangement outside the load window. section 9.4

Listing 9.10 Setting the database recovery model to bulk logged
ALTER DATABASE MarketingArchive SET RECOVERY BULK_LOGGED WITH NO_WAIT ;

Open the executable ALTER DATABASE statement for setting BULK_LOGGED recovery. section 9.4

Table 12.2 Recovery models (view table figure)

Recovery model

Full backups

Differential backups

Transaction log backups

Log truncation

Protection level provided

SIMPLE

Yes

Optional

No

At checkpoint

Transactionally consistent

BULK LOGGED

Yes

Optional

Yes

Log backup

Recovers to end of a backup

FULL

Yes

Optional

Yes

Log backup

Recovers to a specific point in time within a backup

Compare BULK_LOGGED with SIMPLE and FULL by backup requirements, log truncation, and recovery protection. section 12.6

How 100 SQL Server Mistakes and How to Avoid Them covers it

How deep it goes
Explains operational timing, minimal logging, backup follow-up, and the loss of point-in-time recovery during the interval.
Examples
Uses a MarketingArchive warehouse ETL scenario and an ALTER DATABASE command as concrete operational examples.
What it assumes
Assumes recovery-model and backup basics while contrasting BULK_LOGGED with SIMPLE and FULL.
What you can do after
Operate/configure a database around a bulk load while restoring FULL recovery and taking the required log backup afterward.
How it connects
Connects bulk operations with ETL, transaction logs, transaction-log backups, FULL recovery, and point-in-time recovery.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of 100 SQL Server Mistakes and How to Avoid Them. The section links point to the parts of the book it draws on.