How well MSSQL can survive a server hard reboot?



  • Always hears people saying that hard resetting/rebooting may result in corrupted files. If the machine is running a database server such as MSSQL, the database may be corrupted as well. Does anyone shed some light on this? How well MSSQL can survive such a catastrophic situation?



  • How well MSSQL can survive such a catastrophic situation?

    Very well. SQL Server uses Write-Ahead Logging, and forces its IO writes to be hardened to disk, and not cached in a way that wouldn't survive a reboot.

    And it uses checkpointing to try to ensure that the database files never fall so far behind the log files that crash recovery exceeds the database's https://docs.microsoft.com/en-us/sql/relational-databases/logs/change-the-target-recovery-time-of-a-database-sql-server?view=sql-server-ver15#:%7E:text=This%20topic%20describes%20how%20to%20set%20or%20change,an%20upper-bound%20on%20recovery%20time%20for%20this%20database. .

    And while people don't typically just pull the plug on their servers, SQL Server runs on lots and lots of laptops and PCs which do this all the time.

    Background: https://docs.microsoft.com/en-US/troubleshoot/sql/admin/database-engine-input-output-requirements and https://docs.microsoft.com/en-US/troubleshoot/sql/admin/logging-data-storage-algorithms .


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2