To verify all databases on a SQL Server server that are using the "FULL" transaction log recovery model and have a pending full transaction log backup, you can use the following query:
SELECT name AS 'Nome do banco de dados'
FROM sys.databases
WHERE recovery_model_desc = 'FULL' AND name NOT IN ('master', 'tempdb', 'model', 'msdb')
AND database_id NOT IN (
SELECT DISTINCT database_id FROM msdb.dbo.backupset
WHERE type = 'L' AND is_copy_only = 0 AND backup_finish_date IS NULL
) order by name
SELECT name AS 'Nome do banco de dados'
FROM sys.databases
WHERE recovery_model_desc = 'SIMPLE' AND name NOT IN ('master', 'tempdb', 'model', 'msdb')
AND database_id NOT IN (
SELECT DISTINCT database_id FROM msdb.dbo.backupset
WHERE type = 'L' AND is_copy_only = 0 AND backup_finish_date IS NULL
) order by name
Comments
Post a Comment