I cannot schrink database log

Disk full on log file disk is a bad thing. Often it helps when schrinking then database log file. It is only a problem when database is in Full recovery model.

A reason why schrinking isn’t possible could be that backup is missing. So I needed a script to tell me when last backup is finished

SELECT d.name, b.type,
MAX(b.backup_finish_date) AS backup_finish_date
FROM master.sys.sysdatabases d
LEFT JOIN msdb..backupset b ON b.database_name = d.name
GROUP BY d.name, b.type
ORDER BY backup_finish_date DESC

Skriv kommentar

Din e-mailadresse vil ikke blive publiceret. Krævede felter er markeret med *