Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Error trying to Start Server

Author  Topic 

savior faire
Posting Yak Master

194 Posts

Posted - 2008-07-01 : 07:52:58
Good morning,
I am new to SQL Server 2005, and diligently studying it. This morning I run SSMS to look to verify something I was reading.
I try to connect to the server(with Windows Auth) I have installed on my home PC that runs Vista and I get the message below, that I cut/pasted from Event Viewer Log.
It says to run DBCC Checkdb on the server, but I cannot get the server started(in SSCM) it to run? Any suggestions?
I also have a second named instance installed and that one runs fine.
Thanks...


The operating system returned error 38(Reached the end of the file.) to SQL Server during a read at offset 0000000000000000 in file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\modellog.ldf'. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.

Talk sense to a fool and he calls you foolish.

mcrowley
Aged Yak Warrior

771 Posts

Posted - 2008-07-01 : 11:55:51
Well, something is wrong with your model database. Have a look in that folder (C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\), and see if you have model.mdf and modellog.ldf.
Go to Top of Page

savior faire
Posting Yak Master

194 Posts

Posted - 2008-07-01 : 12:05:13
Thanks for the response!
I indeed did look in that folder for both of those files. The modellog.ldf was zero length.

I read some sql books online doc about the DAC, but the server instance must be running in order to connect via DAC to run commands such as DBCC CHECKDB.

This server instance(and the other named instance) are on my home pc and I'm training myself on SS 2005. I imagine I can un-install the default instance, then re-install it. But if this situation can be remedied I'd like to solve the problem that way rather than going through a re-install.

Talk sense to a fool and he calls you foolish.
Go to Top of Page

mcrowley
Aged Yak Warrior

771 Posts

Posted - 2008-07-01 : 12:50:42
Can you start the server with the -m switch?

open a command prompt, and change directories to C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn.
type in sqlservr.exe -m

You should see a bunch of messages go by, which are the messages that would normally be in SQL Server's errorlog. If you can get the server started this way, you can restore the model database from a backup. If not, then you will have to get a copy of a model database from an identical SQL Server installation.
Go to Top of Page

savior faire
Posting Yak Master

194 Posts

Posted - 2008-07-01 : 13:23:56
I shall attempt this when I arrive home this evening.
And yes, I have a backup laying around that would have a suitable "model" database.

I appreciate your suggestions! I just did a search on the books online I have installed here in the office for "sqlservr.exe", and see a lot of hits. I see the "-m" flag places the instance in single user mode.

I'll try this and report back!

Thanks.

Talk sense to a fool and he calls you foolish.
Go to Top of Page

savior faire
Posting Yak Master

194 Posts

Posted - 2008-07-01 : 19:04:21
You should see a bunch of messages go by, which are the messages that would normally be in SQL Server's errorlog. If you can get the server started this way, you can restore the model database from a backup. If not, then you will have to get a copy of a model database from an identical SQL Server installation
---------------------------------------------------------------------------------------------

Hi MCrowley,
Arrived home and tried running sqlserver.exe -m... received the similar error message as this morning.
How would I restore a "model database" if I cannot connect to the server? I do have a suitable copy of a model database that is sitting on a named instance that I also have installed on my pc.

Talk sense to a fool and he calls you foolish.
Go to Top of Page

maninder
Posting Yak Master

100 Posts

Posted - 2008-07-02 : 14:13:43
Pl can you Post the results of this:

select name,dbid from sysdatabases
where dbid<=4

My Guess the DBid are all messed up.. there is a sequence of system DBID's.

If the DBID's are correct.. Well then there is another issue here..

Right Click on SQLServer and click Properties and Goto Startup parameters. and include the -T3608 in the startup options..Stop and Restart the SQL Server.

RUN this Script
sp_detach_db 'msdb'
sp_attach_db 'model',
'C:\path\Data\model.mdf',
'C:\path\Data\modellog.ldf'

sp_attach_db 'msdb',
'C:\Path\Data\msdbdata.mdf',
'C:\Path\Data\msdblog.ldf'

Now Run this again to verify...

select name,dbid from sysdatabases
where dbid<=4


Maninder
Go to Top of Page

savior faire
Posting Yak Master

194 Posts

Posted - 2008-07-02 : 14:29:42
Thanks for the reply Manider.

I cannot connect to the server at all, so I cannot run any queries or SPs, etc..

I have a friend from the internet who is a tech guru and knows SQL 2005. I emailed him. He said there was a way to fix this, by running the "setup.exe" program from the command prompt, with "start / wait" before the program name, followed by the "/qn" flag, some other stuff, the server name, and I believe "REBUILD=1". I believe that was it. If you search on "setup.exe" in books online the exact syntax is there.

Anyway, I did run that and lo and behold, it worked. I was able to start the Server from SSCM, the only problem was, when I went to connect to the server in SSMS, my login was rejected. Note that I am running this on my home pc under Vista, etc.

I was tired of messing around with this and it was cutting into my studying time. I am diligently studying SS 2005 to take the first exam. Anyway, this morning, I uninstalled the software, then did a reinstall. All is right with the world now.

Thanks for all the replies, I do appreciate the suggestions and help!!

Talk sense to a fool and he calls you foolish.
Go to Top of Page

maninder
Posting Yak Master

100 Posts

Posted - 2008-07-02 : 14:42:08
Thanks for the INPUT. Today i learned one more solution to a Problem.

Maninder
Database Painter.. Leaving strokes, that amaze! and inreturn, put value to your Work. I am a Database Architect / Administrator
Go to Top of Page
   

- Advertisement -