Solved

Problem starting SQL Server Database (urgent)

Posted on 2002-07-24
8
632 Views
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.
0
Comment
Question by:almond_uk
8 Comments
 
LVL 32

Expert Comment

by:bhess1
Comment Utility
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
DISTRIBUTOR:
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.

0
 
LVL 4

Accepted Solution

by:
CyberWizard earned 400 total points
Comment Utility
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:
http://dbforums.com/t389015.html

good luck

0
 
LVL 9

Expert Comment

by:miron
Comment Utility
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
or
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.

Cheers
0
 

Expert Comment

by:bsnyder
Comment Utility
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.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 4

Expert Comment

by:CyberWizard
Comment Utility
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.
http://dbforums.com/t389015.html

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?
0
 
LVL 4

Expert Comment

by:CyberWizard
Comment Utility
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.
0
 
LVL 4

Expert Comment

by:TheSpirit
Comment Utility
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,
0
 
LVL 4

Expert Comment

by:CyberWizard
Comment Utility
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.

regards,

CyberWizard
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now