Solved

Problem starting SQL Server Database (urgent)

Posted on 2002-07-24
8
638 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
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
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
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:
http://dbforums.com/t389015.html

good luck

0
 
LVL 9

Expert Comment

by:miron
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
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Expert Comment

by:bsnyder
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.
0
 
LVL 4

Expert Comment

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

Expert Comment

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

Expert Comment

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

regards,

CyberWizard
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sql Stored Procedure field variable 17 30
Sql Stored Procedure 65 26
MS SQL with ODBC 5 35
SSRS 2013 - Overlapping reports 2 19
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
I have a large data set and a SSIS package. How can I load this file in multi threading?
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.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

786 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