SQL Backup Recommendations¶
SQL Express¶
Example:
“tvbackup.bat”:
@del /F /Q “C:\Backup\log\tvbackuplog.txt”
@del /F /Q “C:\Backup\Totalview.bak”
osql.exe /U sa /P 1234 /S NB-OEJ\OEJ /i “C:\Backup\BackupTV.sql” >> “C:\Backup\log\tvbackuplog.txt”
“backupTV.sql”:
USE master
go
EXEC sp_dropdevice ‘TotalviewBU’
EXEC sp_addumpdevice ‘disk’,’TotalviewBU’,’C:\Backup\Totalview.bak’
BACKUP DATABASE Totalview TO TotalviewBU
go

SQL Server Standard and Enterprise¶
A designated AD-user needs to be created for backup. Password should be set to “Password Never Expires”, and the user has to be a member of the “Backup Operators” group.
“Recovery Model” in databases must always be set to “Full” (Full Recovery Mode).
Start up SQL Server Management Studio and setup these 7 jobs:
Full backup of User Data databases – daily e.g. 01.00 o’clock
Full backup of System databases – daily e.g. 00.30 o’clock
Update Statistics – daily e.g. 02.00 o’clock
Cleanup of database and log – daily e.g. 05.00 o’clock
Rebuild Indexes. – each weekend (indexes are rebuilt offline)
Defragmentation of indexes – every day at 03.00 o’clock
Backup of Transaction Log – every 15 minutes during working hours (or at least once a day because of flush)
Example:

Figure 1. Full backup of System-databases. Integritycheck of database, full database backup and daily 00.30 o’clock¶

Figure 2. Full backup of User-databases. Integritycheck og databases. Daily 01.00 o’clock¶

Figure 3. Update Statistics of all databases. Daily 02.00 o’clock NB! this can take a long time. If it takes too long, the job has to be split up.¶


Figure 4: Cleaning up old backup files. Daily 05.00 o’clock¶

Figure 5: Rebuild Indexes. Recommend running weekend days (indexes are being rebuilt offline). NB! This can result in an oversized Database file, see figure 8¶

Figure 6: defragmentation of indexes, runs every day at 03.00 o’clock NB! Can result in a too large Database file, see figure 8¶

Figure 7: Backup Transaction Log – Every 15 minutes during working hours (or at least once a day because of flush) NB! “Verify backup integrity” must NOT BE CHECKED¶


Figure 8: Put Database in simple mode and back into Full Recovery¶