If you keep really valuable data, the loss of which between full backups will upset you - then you should reconsider the approach to backups.
What is a "full backup"? This is a complete copy of the database at a particular point in time. If you make only full backups, then in case of which you will lose all data from the moment of full backup. And doing full backups often will not give you the size of your base.
Fortunately, SQL Server works with the data not only at the "write to database" level. It also has a feature called "transaction log" and "full recovery mode".
The transaction log is a .ldf file, which by default lies next to .mdf.
If you look closely, then when you write any changes to the database, the following happens:
- a request comes from an
INSERT что-то там
client INSERT что-то там
- SQL Server changes the data in memory and quickly records the fact of inserting transactions into the log (ldf), simply appending it to the end of the log.
- SQL Server reports to the client "everything is OK, the record is inserted."
- Once a minute, SQL Server makes a checkpoint - writes modified data to disk (mdf).
- SQL Server appends changes for such transactions to the log to disk.
In Full Recovery Mode, the log file stores all changes made since the creation of the database. In the order in which they were made.
The log file is automatically clipped at the moment of the backup of the log - i.e. when SQL Server is sure that you have saved the transaction data. At the same time, the backup of the log contains only changes made since the previous backup of the log. Those. its size is usually much smaller than the size of a full backup.
(By the way, the fact that you are not backing up the log most likely means that your base and your full backup now weighs 2 times more than it should be).
The essence of all this - having a full backup of a week-old database + backup logs, taken 5 minutes ago, you can restore the state of the database at any time during this week.
Your backup scheme should look like this:
- Full backup database once a week.
- Backup logs every 5-15 minutes / hour, depending on the allowable loss.
This scheme is easily configured through the standard Maintenance Plan mechanism (if you do not have Express). Or your third-party utility - it certainly knows how to maintain backup logs.
In addition, if you have SQL Server Standard or higher, then it has a built-in Managed Backup , which automatically configures this scheme, selecting intervals based on the amount of data + enables compression of backups + pours backups into Azure Storage. Those. solves the problem of maintaining backups with minimal expenses for their organization :)