Major issue with SQL 2008

Something has gone wrong with the SQL Server and when the SQL Engine service starts this appears in the event log:

An error occurred while processing the log for database 'model'.  If possible, restore from backup. If a backup is not available, it might be necessary to rebuild the log.

and when I try and connect to the instance I get this:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)

What can be done?
PeterErhardAsked:
Who is Participating?
 
PeterErhardConnect With a Mentor Author Commented:
Thanks guys, I finished up just doing an un-install and re-install of SQL and re-attaching the databases.
0
 
Megan BrooksSQL Server ConsultantCommented:
The second error would result from the SQL Server Service not starting. The reason for it not starting apparently is a problem with the 'model' database. Are the model.mdf and modellog.ldf files present in the DATA directory (assuming you don't have a separate log directory)? Is that directory online?
Do you have a backup for the model database? If there isn't an obvious problem with the above two files that can be corrected easily then restoring model might be the quickest way to fix things, as long as this error isn't just one part of a larger problem.
0
 
Raja Jegan RSQL Server DBA & ArchitectCommented:
>> An error occurred while processing the log for database 'model'.  If possible, restore from backup. If a backup is not available, it might be necessary to rebuild the log

Your model database is in trouble and hence you need to restore model database either from backups ( if you have it) or need to reinstall SQL Server..
If it is a user database, you can try the approach given below but this can't be done on system databases.

http://blog.sqlauthority.com/2008/07/21/sql-server-fix-error-9004-an-error-occurred-while-processing-the-log-for-database-if-possible-restore-from-backup-if-a-backup-is-not-available-it-might-be-necessary-to-rebuild-the-log/

And for the second error, this might help fixing it:

http://blog.sqlauthority.com/2009/05/21/sql-server-fix-error-provider-named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server-microsoft-sql-server-error/
0
 
Raja Jegan RSQL Server DBA & ArchitectCommented:
Yes, that should ideally fix it since model database is a system database and would have been successfully recreated during installation..
0
All Courses

From novice to tech pro — start learning today.