Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Problem starting SQL Server Database (urgent)

Posted on 2002-07-24
Medium Priority
Last Modified: 2007-11-27
Can anyone help?

We are trying to start our SQL Server db and getting the message:-

"Error 9003, severity: 20, state: 1

The LSN (4:120:1) passed to logscan in database 'model' is invalid".

Big points available.
Question by:almond_uk
LVL 32

Expert Comment

by:Brendt Hess
ID: 7174968
Is this a replicated database?  If so, then the problem appears that the distributor has got itself ahead of the publisher.  This is possible when you have restored the publisher from old backup or there is some sort of bug or fatal error on the publisher causing the sql server to shutdown prior to this error.

You can check the min xact_seqno on the distributor for given publisher with
select min(xact_seqno) from MSrepl_transactions where publisher_database_id in (select id from MSpublisher_databases where publisher_id IN (select srvid from master..sysservers) and publisher_db='dbname') and compare this with

PUBLISHER distendlsn:
dbcc traceon(3604)
dbcc dbtable (publisher)

If this is not a distributed DB:

The error message is indicating a potential data integrity issue with your log and/or database.  Please contact Microsoft SQL Server Support (1-800-936-4900) for assistance with this issue.


Accepted Solution

CyberWizard earned 1600 total points
ID: 7175990
this problem occurs more often, some info I've found on it:

Message 9003 is "The LSN %S_LSN passed to log scan in database '%.*ls' is invalid."
which indeed is a serious error. If it prevents SQL Server from starting it must be
one of the system databases that are it.

You find more information in the errorlog about which database that is corrupt. (Look
in C:\program files\Microsoft SQL Server\MSSQL\Log).

or in your case your sql server may be installed in d:\
you'll probably find in the log files that the model log is expected in a different location than it now is.

I suggest you move it to the location where sql wants it and try to start the sql server again.

just curious, are you running sql server 2k evaluation version?

additional info
you probably have somtehing like this in your log file:

2002-05-25 10:58:20.44 server3 Using 'SSNETLIB.DLL' version '8.0.194'. 2002-05-25
10:58:20.51 spid5 Starting up database 'model'.

2002-05-25 10:58:20.51 spid5 udopen: Operating system error 3(error not found) during
the creation/opening of physical device C:\Program Files\Microsoft SQL
Server\MSSQL\data\model.mdf. 2002-05-25 10:58:20.51 spid5 FCB::Open failed: Could not
open device
C:\Program Files\Microsoft SQL Server\MSSQL\data\model.mdf for virtual device number
(VDN) 1. 2002-05-25 10:58:20.51 spid5 Device activation error. The physical file
name 'C:\Program Files\Microsoft SQL Server\MSSQL\data\model.mdf' may be incorrect.

2002-05-25 10:58:20.51 spid3 Server name is 'SERVER3'. 2002-05-25 10:58:20.52 spid5
Device activation error. The physical file name 'C:\Program Files\Microsoft SQL
Server\MSSQL\data\modellog.ldf' may be incorrect. 2002-05-25 10:58:20.56 spid5
Database 'model' cannot be opened due to inaccessible files or insufficient memory or
disk space. See the SQL Server errorlog for details.

2002-05-25 10:58:20.51 spid5 Device activation error. The physical file name
'C:\Program Files\Microsoft SQL Server\MSSQL\data\model.mdf' may be incorrect.

and answer:

The path you are having problem with at is in master..sysdatabases.

How this may all at a sudden may have changed to C:\, I don't have a clue.

Possibly the easiest solution is to copy the files to the location where SQL Server wants them.

you can find this information and discussion on the following forum:

good luck


Expert Comment

ID: 7176208
unless wizart is correct you have a corrupted model database.

If model database is corrupted you can try to

1 make sure sql server is stopped
2 delete log file for model database and expect sql server to rebuild it
reinstall sql server, which will re-build all system databases, including model, msdb, and master databases.

then copy existing master and msdb physical files into the location where new instalation expects those. Obviously if this path is taken the first thing need to be done is to store a copy of master and msdb databases in a safe location.

The good thing is that model database is only used as a blueprint to create databases user need in the future. As such, it is important that when sql server is re-installed its installation settings 100% match those of original install.

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 7177645
Just an add-on to miron's comment; you can use the 'rebuildm' utility to recreate the system tables without re-installing.  Then restore master from a backup, or re-attach the existing databases.

Expert Comment

ID: 7177733
yes that's possible, you would have to rebuild master but than you would also have to recreate any user accounts.
this is already in the link I have provided above.

quote from the forum:

Even though the SQL Server is installed on D: the default location of the databases
seems to be set to C:, so its looking in 'C:\Program Files\Microsoft SQL
Server\MSSQL\data\ folder for model.mdf' and modellog.ldf. You would have to make
sure that these are in the right location for the server to start.

Otherwise you can start the server from command prompt by

sqlservr -c -T3608

This will prevent recovery of all databases except model.

Usually the resolution is to rebuild the master databases

To rebuild the master database 1. Shutdown SQL Server; then run Rebuildm.exe in the
Program Files\Microsoft SQL Server\ MSSQL\ Binn directory. 2. Click Browse. 3. Select
the \Data folder on the Microsoft® SQL Server? compact disc or in the shared network
directory from which SQL Server was installed; then click OK. 4. Click Settings.
Verify or change the character set, sort order, and Unicode collation used for the
master database and all other databases. 5. The default character set, sort order,
and Unicode collation are shown initially, which may not be the values selected
during SQL Server Setup. You can select the same combination used earlier or select a
new combination; then click OK. 6. Click Rebuild. The Rebuild Master utility
reinstalls the master database.

In the process you can make sure the data folder is set to D

Later , after rebuilding master you will have to re-attach all the user databases
using sp_attach_db

You also will lose all the logins and will have to recreate them , and then relink
the database users using sp_change_users_login

so have you had any luck trying to solve the problem?

Expert Comment

ID: 7177742
but that's when all else fails.

solution was followed by this warning:

This posting is provided "AS IS" with no warranties, and confers no rights.

Expert Comment

ID: 7178637
You could try backing up a model database from another server  and restoring it to this server (does assume that there is nothing unusual in model database on either machine). To do this you would probably need to start up with a parameter -T3608,

Expert Comment

ID: 7189161
hello, you specified the help was urgent so I expect you have already tried some or all of the suggestions given.

so can you respond to this and specify if the problem has been resolved or if not what the results were of the suggestions given?
this way we can help you further to find a solution.

if the problem has been resolved by one of the suggestions please feel free to accept a comment as an answer and award the promised points for the help you received.



Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question