Pcornel
Databases · Microsoft SQL Server

SQL Server Recovery Models

Cheat sheet · https://pcornel.dk/topic.php?topic=6182

Back to the Topic

Answer

SQL Server recovery models: Simple (log truncates at checkpoint, no PITR), Full (log backups needed, PITR possible), Bulk-logged (minimal logging for bulk operations).

Remember

Full recovery without log backups makes the log grow until the disk fills. Check log_reuse_wait_desc for why the log cannot truncate.

First checks

  • SELECT name,recovery_model_desc,log_reuse_wait_desc FROM sys.databases; — first check for this topic
  • psql -c "SELECT now(), version();" — PostgreSQL reachable and version
  • mysql -e "SELECT NOW(), VERSION();" — MariaDB/MySQL reachable and version
  • sqlcmd -S <server> -Q "SELECT @@VERSION" — SQL Server reachable and version

Verify in this order

recovery model → log truncation rule → backups → restore options

Where it usually breaks

FULL recovery without log backups fills the disk.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6182

Confirmation

Confirm action

Continue?