Startpagina > Databases (SQL, Oracle) > MSSQL > BACKUP LOG is not allowed while the recovery model is SIMPLE

BACKUP LOG is not allowed while the recovery model is SIMPLE

OS

Windows
Microsoft SQL Server

Software

Alle

Error message

"[Microsoft][ODBC SQL Server Driver][SQL Server]The statement BACKUP LOG is not allowed while the recovery model is SIMPLE"

Cause

The SQL-backup is made up of 2 schedules: one task backups the database and the other backups the transaction logs.
The transaction logs can only be backupped when the recovery model is set to Full.

Solution

Backups can be made using only database backups, with larger databases it might be more efficient to make regular log backups and fewer database backups.
In case you do want to backup the log files using the following steps to change the model.
Option 1: Management Studio
  1. Start the SQL Server Management Studio
  2. Connect to the instance and log on
  3. Expand 'Databases'
  4. Expand 'System Databases'
  5. Right click on the database and select properties
  6. Go to the Options tab
  7. Choose the recovery model 'Full' from the drop down
Option 2: SQL
  1. Connect to the instance and log on
  2. Execute a new query:
    USE [DB name] ;
    
    ALTER DATABASE model SET RECOVERY FULL ;
After changing the recovery model a full or differential backup has to be made to start the log chain.
BENELUX GERMANY AUSTRIA / SWITZERLAND
+31 (0) 570 56 23 43 +49 (0) 800 12 22 587 +31 (0) 570 71 43 06
info@mindtimebackup.nl info@mindtimebackup.de info@mindtimebackup.de