Version of the script
SELECT @Version = '8.19', @VersionDate = '20240222';
What is the current behavior?
Right now to get the Azure SQL DB startup time, we're using an average of several idle wait types:
SELECT wait_type, wait_time_ms,
NTILE(3) OVER(ORDER BY wait_time_ms) AS grouper
FROM sys.dm_os_wait_stats w
WHERE wait_type IN ('DIRTY_PAGE_POLL','HADR_FILESTREAM_IOMGR_IOCOMPLETION','LAZYWRITER_SLEEP',
'LOGMGR_QUEUE','REQUEST_FOR_DEADLOCK_SEARCH','XE_TIMER_EVENT')
When it's available, I'd rather use the more accurate sys.dm_cloud_database_epoch DMV, the last_role_transition_time column.
Version of the script SELECT @Version = '8.19', @VersionDate = '20240222';
What is the current behavior? Right now to get the Azure SQL DB startup time, we're using an average of several idle wait types:
When it's available, I'd rather use the more accurate sys.dm_cloud_database_epoch DMV, the last_role_transition_time column.