title: SQL - DB stuck (in recovery)
body: <p>I have SQL Server 2017 with a huge size database. While long running transaction the database got stuck (in recovery) mode after SQL Server restarted.</p>
  
  <p>I tried <code>RESTORE DATABASE [MainDB] WITH RECOVERY</code> but I get these error messages</p>
  
  <blockquote>
    <p>Msg 3153, Level 16, State 2, Line 1<br>
    The database is already fully recovered.</p>
    
    <p>Msg 3013, Level 16, State 1, Line 1<br>
    RESTORE DATABASE is terminating abnormally.</p>
  </blockquote>
  
  <p>Here is the <code>ERRORLOG</code> file (end of it):</p>
  
  <pre><code>2019-11-06 22:23:02.70 spid19s     Recovery of database 'MainDB' (5) is 96% complete (approximately 669 seconds remain). Phase 3 of 3. This is an informational message only. No user action is required.
  2019-11-06 22:23:22.71 spid19s     Recovery of database 'MainDB' (5) is 96% complete (approximately 654 seconds remain). Phase 3 of 3. This is an informational message only. No user action is required.
  2019-11-06 22:23:42.71 spid19s     Recovery of database 'MainDB' (5) is 97% complete (approximately 635 seconds remain). Phase 3 of 3. This is an informational message only. No user action is required.
  2019-11-06 22:24:02.73 spid19s     Recovery of database 'MainDB' (5) is 97% complete (approximately 611 seconds remain). Phase 3 of 3. This is an informational message only. No user action is required.
  2019-11-06 22:24:22.73 spid19s     Recovery of database 'MainDB' (5) is 97% complete (approximately 600 seconds remain). Phase 3 of 3. This is an informational message only. No user action is required.
  2019-11-06 22:24:42.73 spid19s     Recovery of database 'MainDB' (5) is 97% complete (approximately 577 seconds remain). Phase 3 of 3. This is an informational message only. No user action is required.
  2019-11-06 22:25:02.73 spid19s     Recovery of database 'MainDB' (5) is 97% complete (approximately 554 seconds remain). Phase 3 of 3. This is an informational message only. No user action is required.
  2019-11-06 22:25:22.74 spid19s     Recovery of database 'MainDB' (5) is 97% complete (approximately 544 seconds remain). Phase 3 of 3. This is an informational message only. No user action is required.
  2019-11-06 22:25:42.74 spid19s     Recovery of database 'MainDB' (5) is 97% complete (approximately 520 seconds remain). Phase 3 of 3. This is an informational message only. No user action is required.
  2019-11-06 22:26:02.75 spid19s     Recovery of database 'MainDB' (5) is 97% complete (approximately 499 seconds remain). Phase 3 of 3. This is an informational message only. No user action is required.
  2019-11-06 22:26:22.75 spid19s     Recovery of database 'MainDB' (5) is 97% complete (approximately 478 seconds remain). Phase 3 of 3. This is an informational message only. No user action is required.
  2019-11-06 22:26:36.82 spid19s     1 transactions rolled back in database 'MainDB' (5:0). This is an informational message only. No user action is required.
  2019-11-06 22:26:36.82 spid19s     Recovery is writing a checkpoint in database 'MainDB' (5). This is an informational message only. No user action is required.
  2019-11-06 22:26:37.88 spid19s     Recovery completed for database MainDB (database ID 5) in 20854 second(s) (analysis 61049 ms, redo 4253644 ms, undo 16537205 ms.) This is an informational message only. No user action is required.
  2019-11-06 22:26:37.89 spid19s     Parallel redo is shutdown for database 'MainDB' with worker pool size [8].
  2019-11-06 22:26:38.57 spid5s      Recovery is complete. This is an informational message only. No user action is required.
  2019-11-07 00:00:40.39 spid41s     This instance of SQL Server has been using a process ID of 2856 since 06/11/2019 16:34:33 (local) 06/11/2019 14:34:33 (UTC). This is an informational message only; no user action is required.
  2019-11-07 19:06:03.57 spid21s     SQL Server has encountered 1 occurrence(s) of I/O requests taking longer than 15 seconds to complete on file [C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\DATA\TestDB.mdf] in database id 6.  The OS file handle is 0x0000000000000DB0.  The offset of the latest long I/O is: 0x00002328eda000
  2019-11-08 00:00:03.61 spid39s     This instance of SQL Server has been using a process ID of 2856 since 06/11/2019 16:34:33 (local) 06/11/2019 14:34:33 (UTC). This is an informational message only; no user action is required.
  2019-11-09 00:00:29.95 spid42s     This instance of SQL Server has been using a process ID of 2856 since 06/11/2019 16:34:33 (local) 06/11/2019 14:34:33 (UTC). This is an informational message only; no user action is required.
  2019-11-10 00:00:56.17 spid45s     This instance of SQL Server has been using a process ID of 2856 since 06/11/2019 16:34:33 (local) 06/11/2019 14:34:33 (UTC). This is an informational message only; no user action is required.
  2019-11-11 00:00:22.95 spid16s     This instance of SQL Server has been using a process ID of 2856 since 06/11/2019 16:34:33 (local) 06/11/2019 14:34:33 (UTC). This is an informational message only; no user action is required.
  2019-11-12 00:00:50.57 spid43s     This instance of SQL Server has been using a process ID of 2856 since 06/11/2019 16:34:33 (local) 06/11/2019 14:34:33 (UTC). This is an informational message only; no user action is required.
  2019-11-13 00:00:18.02 spid38s     This instance of SQL Server has been using a process ID of 2856 since 06/11/2019 16:34:33 (local) 06/11/2019 14:34:33 (UTC). This is an informational message only; no user action is required.
  2019-11-14 00:00:44.09 spid34s     This instance of SQL Server has been using a process ID of 2856 since 06/11/2019 16:34:33 (local) 06/11/2019 14:34:33 (UTC). This is an informational message only; no user action is required.
  2019-11-14 17:10:23.88 spid21s     SQL Server has encountered 1 occurrence(s) of I/O requests taking longer than 15 seconds to complete on file [C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\DATA\secondDB_log.ldf] in database id 7.  The OS file handle is 0x0000000000000E30.  The offset of the latest long I/O is: 0x0000000242cc00
  2019-11-14 18:07:16.98 spid21s     SQL Server has encountered 1 occurrence(s) of I/O requests taking longer than 15 seconds to complete on file [C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\DATA\TestDB.mdf] in database id 6.  The OS file handle is 0x0000000000000DB0.  The offset of the latest long I/O is: 0x0000235c1d6000
  </code></pre>