Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does full backup work with simple recovery mode? [closed]

I have a database that is getting to be huge. The mdf file is about 150 GB and I just saw that the log file is nearing 1.5 TB! I do not care about the log file at all. So based on this, I plan on switching the recovery mode to simple.

However, I am concerned that I won't be able to do a full restore in the future if I have a simple recovery mode set. Is this true?

Here is the code I use to backup my database nightly. Would I be able to do a full restore in the future if my hard drive crashes or something gets corrupted?

BACKUP DATABASE MyDatabase
TO DISK = 'F:\SQL Server Backup\MyDatabase.bak'
WITH INIT
like image 794
eek Avatar asked Nov 18 '25 20:11

eek


2 Answers

In the Simple Recovery Model you will be able to take Full and Differential backups. If you have a full backup, you will be able to restore the database in full at the time of the full backup.

A full backup in the simple recovery model has no less data than a full backup in the full recovery model.

If you do this:

backup database MySimpleRecoveryDatabase
to disk = 'F:\SQL Server Backup\MyDatabase.bak'
go

And then at a later date perform a RESTORE:

restore database MySimpleRecoveryDatabase
from disk = 'F:\SQL Server Backup\MyDatabase.bak'
go

Provided that .bak file was untouched between the backup and restore, you will have a full database restore that is equivalent to when you did the backup. (Note, that RESTORE DATABASE command may not be all-inclusive depending on NTFS structure, existing files, etc.)

No, that is not true. But in simple recovery mode, you won't be able to take log backups, so you will only be able to restore to the last full backup (or last full + diff).

like image 32
Aaron Bertrand Avatar answered Nov 20 '25 12:11

Aaron Bertrand



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!