Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Microsoft SQL

Posted on 2010-11-25
6
Medium Priority
?
483 Views
Last Modified: 2012-05-10
Hello

i have a terrible problem with my MS SQL Database. All of the sudden, while working in the application that is using the database it has stopped working and closed (with no error message). Restarting the application, it could not connect back to the database... restart, reboot, reload MS SQL service and still nothing. That was the time i loaded MS SQL Management Studio Express 2005 (v9.00). There i've noticed that my database was marked with Suspect status. I did a lot of research on the net and on this portal trying to find a solution... none of the steps explained in different posts were good for me. Can anyone describe a step by step tutorial to try repairing my database?

My server is:Microsoft SQL Server 2000 - 8.00.760 (Intel X86), Dec 17 2002 14:22:05, Desktop Engine on Windows NT 5.1 (Build 2600: Service Pack 3) and has been running for three years with no flaws. Also i don't have a recent backup only made a copy of the mdf and ldf files after the crash.

I'm not interested into buing 400$ or more worth of software just to repair a database (i've already paid for the SQL license... ) as i saw some providers offer.

Regards,
Cosmin
0
Comment
Question by:Cosmin Curticapean
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 34213637
try to take  that db offline and then online ..
if that doesnt work, detach it and attach it
0
 
LVL 32

Expert Comment

by:Ephraim Wangoya
ID: 34214174

Before attempting to take it offline or detach, run DBCC CHECKDB to see if you have some kind of corruption that can be repaired
From there you can choose your next step
0
 
LVL 3

Expert Comment

by:expert_dharam
ID: 34214899
According to me, following might be the possibilities:

1. Account running the MSSQLSERVER service is not locked/disabled/expired.
2. .mdf file's 'Read-Only' attribute is true/checked in the properties window.
0
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 

Author Comment

by:Cosmin Curticapean
ID: 34215659
so, from what i have read untill today, i should never detach a suspect database because of the risk of not being able to attach it back... even so, i did detach and got this message when trying to attach again.

TITLE: Microsoft SQL Server Management Studio Express
------------------------------

Attach database failed for Server 'CIEMPONTAJ'.  (Microsoft.SqlServer.Express.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo)

------------------------------

 
Error while undoing logged operation in database 'Keypont'. Error at log record ID (53403:16:205).
An error occurred while processing the log for database 'Keypont'.
Could not open new database 'Keypont'. CREATE DATABASE is aborted.
Location:       recbase.cpp:1378

Expression:       m_offBeginVar < m_SizeRec
SPID:             52
Process ID:       2484
Location:       logscan.cpp:3063
Expression:       (m_lastLSN == NullLSN) || (m_lastLSN > m_curLSN)
SPID:             52
Process ID:       2484
Location:       logscan.cpp:3282
Expression:       m_lastLSN == NullLSN || startLSN < m_lastLSN
SPID:             52
Process ID:       2484 (Microsoft SQL Server, Error: 3624)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=3624&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------


Also i've put the attached log file with some errors.
ERRORLOG
0
 

Accepted Solution

by:
Cosmin Curticapean earned 0 total points
ID: 34216521
--- SOLVED ---

after reading another dozen articles about MS SQL repair from SUSPECT mode i've managed to do this:

-without detach-ing the DB ( as i've read, this is not recommended) i've executed this scripts:

1) UPDATE sysdatabases SET status = 32768 WHERE name = 'problematic_database'
GO

2) ALTER DATABASE problematic_databaseSET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB ('problematic_database', REPAIR_ALLOW_DATA_LOSS)

3) DBCC traceon(3604)
DBCC rebuild_log('problematic_database','c:\Program Files\Microsoft SQL Server\MSSQL\Data\problematic_database.ldf')

4) ALTER DATABASE problematic_database SET MULTI_USER

this did put the database in single mode, check-ed for errors, rebuild-ed the ldf file and change back to multiuser mode. After this i could access the DB oncemore.

As remarks to your posts:
-detach is not recomended in SUSPECT mode, as you might not be able to reattach it back
-DBCC checkdb is only a part of the solution
-no accounts were expired, and no read-only mode was set.

Thanks all for the support,
Cosmin
0
 

Author Closing Comment

by:Cosmin Curticapean
ID: 34246201
the solution worked in a private case, might not work for other cases.
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

722 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