i have a sql 2012 cluster setup on server 2012 with 2 nodes
today our iscsi storage went tits up and caused the db's to go offline and then into recovery
also, one of the DB's had an 84Gb log file (which has since been sorted).
It took in total about 2 hours for the database to recover, which isnt bad - but for most of that period how can I check what it is doing.
I was using this query
DECLARE @DBName VARCHAR(64) = 'databasename'
DECLARE @ErrorLog AS TABLE([LogDate] CHAR(24), [ProcessInfo] VARCHAR(64), [TEXT] VARCHAR(MAX))
INSERT INTO @ErrorLog EXEC master..sp_readerrorlog 0, 1, 'Recovery of database', @DBName
SELECT TOP 5 [LogDate] ,SUBSTRING([TEXT], CHARINDEX(') is ', [TEXT]) + 4,CHARINDEX(' complete (', [TEXT]) - CHARINDEX(') is ', [TEXT]) - 4) AS PercentComplete ,CAST(SUBSTRING([TEXT], CHARINDEX('approximately', [TEXT]) + 13,CHARINDEX(' seconds remain', [TEXT]) - CHARINDEX('approximately', [TEXT]) - 13) AS FLOAT)/60.0 AS MinutesRemaining ,CAST(SUBSTRING([TEXT], CHARINDEX('approximately', [TEXT]) + 13,CHARINDEX(' seconds remain', [TEXT]) - CHARINDEX('approximately', [TEXT]) - 13) AS FLOAT)/60.0/60.0 AS HoursRemaining ,[TEXT]
FROM @ErrorLog ORDER BY [LogDate] DESC
but for the first 100 mins or so, nothing was displayed then a few messages for the last few minutes came up.
So how can i tell what was happening for the first 100 mins, the server was doing practically no work (no cpu, no memory, no disk usage)
i am presuming it was going through the log finding stuff to recover, but im there wetting myself in case it has hung
So any advice on how to check recovery status on such large log files?
Thanks