Advertisement
jn2guru

Corrupt Model DB Fix - Microsoft Support

Apr 8th, 2013
3,454
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.32 KB | None | 0 0
  1. Problem Description:
  2. =============================
  3. You Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (X64) default instance on SERVERNAME server and you were trying to start the SQL SERVER service which was failing to start.
  4.  
  5.  
  6. Analysis\Troubleshooting:
  7. =============================
  8.  
  9. We checked the SQLS SERVER ERRORLOG
  10.  
  11. ===========================
  12. 2012-06-20 19:33:41.48 Server Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (X64)
  13. Apr 2 2010 15:48:46
  14. Copyright (c) Microsoft Corporation
  15. Enterprise Edition (64-bit) on Windows NT 6.0 <X64> (Build 6001: Service Pack 1)
  16.  
  17. 2012-06-20 19:33:41.50 Server (c) Microsoft Corporation.
  18. 2012-06-20 19:33:41.50 Server All rights reserved.
  19. 2012-06-20 19:33:41.50 Server Server process ID is 2596.
  20. 2012-06-20 19:33:41.51 Server System Manufacturer: 'HP', System Model: 'ProLiant DL360 G5'.
  21. 2012-06-20 19:33:41.51 Server Authentication mode is MIXED.
  22. 2012-06-20 19:33:41.51 Server Logging SQL Server messages in file 'D:\Mssql\Data\MSSQL10_50.MSSQLSERVER\MSSQL\Log\ERRORLOG'.
  23. 2012-06-20 19:33:41.51 Server This instance of SQL Server last reported using a process ID of 2816 at 6/20/2012 6:10:15 PM (local) 6/20/2012 10:10:15 PM (UTC). This is an informational message only; no user action is required.
  24. 2012-06-20 19:33:41.51 Server Registry startup parameters:
  25. -d D:\Mssql\Data\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\master.mdf
  26. -e D:\Mssql\Data\MSSQL10_50.MSSQLSERVER\MSSQL\Log\ERRORLOG
  27. -l D:\Mssql\Data\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\mastlog.ldf
  28. 2012-06-20 19:33:41.56 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
  29. 2012-06-20 19:33:41.56 Server Detected 4 CPUs. This is an informational message; no user action is required.
  30. 2012-06-20 19:33:41.65 Server Using locked pages for buffer pool.
  31. 2012-06-20 19:33:41.88 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.
  32. 2012-06-20 19:33:42.33 Server Node configuration: node 0: CPU mask: 0x000000000000000f:0 Active CPU mask: 0x000000000000000f:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.
  33. 2012-06-20 19:33:42.49 spid7s Starting up database 'master'.
  34. 2012-06-20 19:33:42.86 spid7s Resource governor reconfiguration succeeded.
  35. 2012-06-20 19:33:42.86 spid7s SQL Server Audit is starting the audits. This is an informational message. No user action is required.
  36. 2012-06-20 19:33:42.87 spid7s SQL Server Audit has started the audits. This is an informational message. No user action is required.
  37. 2012-06-20 19:33:42.87 spid7s FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'MSSQLSERVER'.
  38. 2012-06-20 19:33:43.02 spid7s SQL Trace ID 1 was started by login "sa".
  39. 2012-06-20 19:33:43.03 spid7s Starting up database 'mssqlsystemresource'.
  40. 2012-06-20 19:33:43.05 spid7s The resource database build version is 10.50.1600. This is an informational message only. No user action is required.
  41. 2012-06-20 19:33:43.24 spid10s Starting up database 'model'.
  42. 2012-06-20 19:33:43.24 spid7s Server name is 'SERVERNAME'. This is an informational message only. No user action is required.
  43. 2012-06-20 19:33:43.27 spid10s The database 'model' is marked RESTORING and is in a state that does not allow recovery to be run.
  44. 2012-06-20 19:33:43.28 spid10s Error: 927, Severity: 14, State: 2.
  45. 2012-06-20 19:33:43.28 spid10s Database 'model' cannot be opened. It is in the middle of a restore.
  46. 2012-06-20 19:33:43.36 spid10s Could not create tempdb. You may not have enough disk space available. Free additional disk space by deleting other files on the tempdb drive and then restart SQL Server. Check for additional errors in the event log that may indicate why the tempdb files could not be initialized.
  47. 2012-06-20 19:33:43.36 spid10s SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.
  48. ===========================
  49.  
  50. From ERRORLOG we can see that SQL SERVER trying to bring model database online but since model database in recovery state hence we were unable to run database recovery.
  51.  
  52. We also know that whenever SQL SERVER start we recreate TEMPDB database by coping the content from model database.
  53.  
  54. Now since model database didn’t started hence TEMPDB startup also failed which is one of critical system database and this caused SQL SERVER service to failed
  55.  
  56.  
  57. Solution:
  58. =====================================
  59. · To fix this issue we started SQL SERVER EXE with following parameter from command prompt
  60.  
  61.  
  62. SQLSERVR.EXE -c -T3608
  63.  
  64. · Then after we detached model database using following T-SQL
  65.  
  66.  
  67. sp_detach_db model
  68.  
  69. · Then after we attach the model database using following T-SQL
  70.  
  71.  
  72. ================================
  73. USE MASTER
  74. GO
  75. CREATE DATABASE MODEL
  76. ON (FILENAME = 'C:\PROGRAM FILES\MICROSOFT SQL SERVER\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\MODEL.MDF')
  77. FOR ATTACH ;
  78. ================================
  79.  
  80. · After that SQL SERVER service came online successfully
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement