Solved

Microsoft SQL

Posted on 2010-11-25
6
465 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
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:ewangoya
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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

929 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

11 Experts available now in Live!

Get 1:1 Help Now