Link to home
Start Free TrialLog in
Avatar of itagent007
itagent007

asked on

Suspect database on SQL Server cluster

How do I recover a database that is marked as suspect on a SQL Server cluster? I don't know how to unmark the database and restart the service on the primary cluster (active/passive) without failing it over. The error that I see in the logs is:

Error while redoing logged operation in database 'LIVEDB'. Error at log record ID (483:395:139)


Can someone help right away?!?
Avatar of itagent007
itagent007

ASKER

One more thing to add, I don't have backup of this database, which makes this worse.
Did you try restarting the server?
No I have not. I'm new to clusters and have a general idea of how they work. If I restart the server, will it failover to the second node?
try
===
EXEC sp_resetstatus 'databasename'

This will reset the suspect flag. However, if it was marked suspect for a reason, SQL Server may just mark it as suspect again
In reading about the sp_resetstatus command, it says I need to restart the SQL Service. How do I do that in cluster administrator without failing over the service to the second node?
if the above does not work then

there is a useful trick

1.Detach Your Database.
2.Rename your log file.
3.Create a  blank text document  and rename it as your Log file
4.Then attach the database, point the log as new log file we just created.
If I detach the database and it won't reattach, what other options do I have?
>>it says I need to restart the SQL Service

You need to restart sql service not the node it self.

simply go to the services and in control panel administrator tool on the active node and on MSSQLSERVER right click and restart.

>>If I detach the database and it won't reattach

why won't?
I was always told never to stop and start services through computer management or sql enterprise manager in a clustered environment, but to do things in cluster administrator. But I've never restarted a service through there before.
Thanks, I'll give all these things a try and let you know what happens.
Here is how you can restart SQL Server on the same machine.

1. If you have installed Windows cluster admin, Go to start-> Run on any of the two nodes.
2. Type 'Cluadmin' and click Ok. This happens the cluster administrator.
3. Type the name of your windows cluster in the box that will come up (or just type the '.'(period) symbol to enter the cluster adminstrator.
4. Under groups, you will find you SQL group and all the resources.
5. Right click on SQL Server resource on the right pane->Choose Take Offline.
{The database went into suspect mode because it was not able to recover. You generally are in trouble if your database is in suspect and you do not have a previous good back up(Unfortunately this might be true in your case in which case you have corruption and your hopes of getting the database back is simmered).}
6. Now once the SQL Server and SQL agent resource are offline on the cluster, you need to start SQL in a single user mode. (Check SQL Books online on how to start SQL in single user mode)
7. Open the command prompt, navigate to your binn directory in the SQL Server installation folder on your local drive.
8. Run the command SQLSERVR.EXE -c. (This will start SQL in single user mode.)
9. You can check if SQL Server tries to recover the user database which is in suspect mode. If it doesnt, you might as well forget using that database ever.
10. Once the recovery completes, you can exit from the command prompt by typing CTRL+C.
11. Go to the cluster admin -> Right click on SQL and Click Bring Online. This has the same effect as restarting SQL Server on the local Node.


Alternatively, If you wish to start SQL Server from the Enterprise manager or Service manager on the same Node here is what you can do inorder to avoid it from failing over to the second node.

1. Go to cluster admin->Right click on SQL Server resource in the SQL group.
2. Choose properties ->Go to Advanced tab-> Choose the radio button "Do not restart".
3. Once you do that if you start SQL Server using services or EM, it will restart on its own node and not fail over to the second node.

The next you post a question, copy and paste the output  of the SQL error log which contains information about the database in suspect. We can tell you if at all you can recover that database.


ASKER CERTIFIED SOLUTION
Avatar of lokeshgm7
lokeshgm7

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial