Skip to main content
< All Topics
Print

Database has been offline for a long time

If a database has been offline for more than a year, this alert will be thrown.

Even if databases is set to be automatically deleted, this alert can still be thrown as databases wont be deleted if they are production databases without a full backup.

To query the Performance Store database for databases that has been offline for more than a year, use:

select o.server_name, o.database_name object_name, datediff(day, o.set_offline_date, getutcdate()) days_ffline
from dbo.v_offline_databases o
where o.last_full_backup_date is null
and o.discovered = 1
and datediff(day, o.set_offline_date, getutcdate()) > 365

The alert will be visible on the Latest stats dashboard.

To exclude specific servers from this alert, see how to use the dbo.team_alert_exclude table in Alerting.

Table of Contents