--part1
with cte1 as(
SELECT ROW_NUMBER() OVER(ORDER BY (SELECT NULL)) as rn, Fridays = DATEADD(yy, DATEDIFF(yy, 0, GETDATE()), n.num)
FROM (SELECT TOP 366 num = ROW_NUMBER() OVER(ORDER BY https://t.co/Cjeu9RfZXY)-1 FROM dbo.syscolumns a, dbo.syscolumns b) n
SELECT Fridays = DATEADD(yy, DATEDIFF(yy, 0, GETDATE()), n.num) FROM (SELECT TOP 366 num = ROW_NUMBER() OVER(ORDER BY https://t.co/Cjeu9RfZXY)-1 FROM dbo.syscolumns a, dbo.syscolumns b) n WHERE DATENAME(weekday, DATEADD(yy, DATEDIFF(yy, 0, GETDATE()), n.num)) = 'Friday'
@kevchant it says its working on:
Processed 130299320 pages for database 'VLdb', file 'PrdDt1' on file 1....
and it has to do a few of these files but because it's a 26TB DB it takes sometimes hours to complete this part after it has already reported Restore 100% complete
I track 26TB restore when it gets to 100% completed it keeps PROCESSING files and that takes hours to complete.
100 percent processed.
Processed 130299320 pages for database 'VLdb', file 'PrdDt1' on file 1......
How to track the second part? #sqlhelp#sqlfamily
Script only tracks 1st part:
SELECT session_id as SPID, command, a.text AS Query, start_time, percent_completeFROM https://t.co/zNI16bxIL2_exec_requests r CROSS APPLY https://t.co/zNI16bxIL2_exec_sql_text(r.sql_handle) a
WHERE r.command in ('BACKUP DATABASE','RESTORE DATABASE')
#sqlhelp I have created many alerts for long running query > 1 hr. in TSQL but I am having a hard time figuring out how to do it using #SentryOne. Any Blog posts or articles out there on how to do it? My Google-Fu is failing me on this one. Thanks in advance @SQLFamily.
@SQLsensei@SQLFamily The problem am having is that it's not responding to my threshold when I customize it to duration >= 30 minutes. It's still going by the default (I believe 1 hr. or 250%).
Top SQL: Duration Threshold Max
and [Event https://t.co/SAWE71teVG Minutes] Is greater than or equal to 30