Remote Tech Support

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Monday, 13 September 2010

Suspect SQL Server 2000 Database

Posted on 08:26 by Unknown
Problem
I have a SQL Server 2000 database that has the wrong database status.  For some reason it is in the 'Suspect/Offline' mode.  I just need to correct the problem quickly and get my database back online.  How can I do so?   Once the status is correct, do I need to take any further steps? 

Solution
To cut to the chase, the script below can be used to correct the SQL Server 2000 database status, but in reality this is only a third of the equation.  We also need to correct any sort of corruption and understand why this occurred in the first place. 

Database Status Correction Script
The script below will change the database to be in simple recovery mode, which may or may not be the needed configuration for your database.  As such, it is necessary to review your database configurations once this script has been executed.  In addition, it is necessary to change the 'YourDatabaseName' to your database name in single quotes.

USE Master
GO

-- Determine the original database status
SELECT [Name], DBID, Status
FROM master.dbo.sysdatabases
 
GO

-- Enable system changes
sp_configure 'allow updates',1
GO
RECONFIGURE WITH OVERRIDE
GO

-- Update the database status
UPDATE master.dbo.sysdatabases
 
SET Status = 24
 
WHERE [Name] = 'YourDatabaseName'
GO

-- Disable system changes
sp_configure 'allow updates',0
GO
RECONFIGURE WITH OVERRIDE
GO

-- Determine the final database status
SELECT [Name], DBID, Status
FROM master.dbo.sysdatabases
 
GO

Check for Corruption
The next step in this process is very key.  It is necessary to determine if the database has any corruption and ensure that the database will be able to support the users.  If the database has corruption, you may be exposing yourself to more issues by just changing the database status without correcting the underlying issue.  To identify the underlying issue, execute the following commands:
  • DBCC CHECKDB - Validate the overall database integrity
  • DBCC CHECKCATALOG - Validate the system catalog integrity
  • DBCC CHECKTABLE - Validate the integrity for a single table
To resolve the issue, you may need to do one or more of the following:
  • Drop and Recreate Index(es)
  • Move the recoverable data from an existing table to a new table
  • Update statistics
  • DBCC UPDATEUSAGE
  • sp_recompile
To ensure the issue is corrected, it is a good idea to re-run the identification commands listed above and validate that they do not have any issues.

Determine the Root Cause
In the long term, it is imperative to understand what caused the suspect/offline database.  At a minimum the following questions should be addressed:
  • What has recently changed in your environment?
  • Review your SQL Server logs to see if you can determine when the error occurred.
  • Talk to your team members to ask them what changes have been made.
  • Review your change management and auditing processes to see what has changed in SQL Server or at a systems level.
  • See if the issue has occurred on any other databases in your environment.
Next Steps
  • Although the script from this tip can be easily run, it is necessary to understand why the issue occurred and be sure not to have any corruption moving forward.
  • Heed caution and truly understand the situation before running this script and make sure you do not cause any further issues.

Email ThisBlogThis!Share to XShare to Facebook
Posted in SQL | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Windows Server 2008 Core Command Guide
    Windows Server 2008 Core Command Guide What Command Set DNS IP Netsh int ipv4 set dns “local area connection” stat...
  • USB Disk Security 5.4.0.12
    USB Disk Security -  Download 100% protection against any threats via USB storage USB Disk Security is a top-rated antivirus utility that pr...
  • GDS COMMITTEE IMPLEMENTATION ORDERS RELEASED BY DIRECTORATE TODAY
    GDS COMMITTEE IMPLEMENTATION ORDERS RELEASED BY DIRECTORATE TODAY POSTAL DIRECTORATE ISSUED ORDERS TODAY FOR IMPLEMENTING THE GDS COMMITTEE ...
  • (no title)
    POSTAL RATES INDEX Letters / Book Post Registered Articl...
  • Most Useful Websites
           The list primarily highlights the lesser-known or undiscovered websites and misses out all-time favorites like Google Docs, Wikipedia...
  • Commands in Windows Vista
    Windows Vista Command Line List and Reference The list of commands available in the command line shell for Windows Vista is similar to that ...
  • Save queries in Windows Server 2003's Active Directory Users and Computers tool
    Windows Server 2003 administrators can’t live without the Active Directory Users and Computers tool. Here’s a quick look at the saved querie...
  • PDF into Word ( Document) converter
    PDF into Word ( Document) Converter         PDF2Word(pdf to word) software enable export the text, images and other contents from pdf docume...
  • THIRUKKURAL PDF DOWNLOAD (தமிழ் )
    CLICK HERE TO DOWNLOAD THIRUKKURAL (தமிழ்)    or CLICK HERE TO DOWNLOAD THIRUKKURAL (TAMIL & ENGLISH)    or CLICK HERE TO DOWNLOAD THIR...
  • How to shutdown computer automatically at a specific time
    Trick 1: Start > Run Type ' shutdown -s -t 1800 ' without quotes Click OK A dialog will appear showing the countdown t...

Categories

  • Computer Guidelines
  • Customer Care
  • DB Tools
  • Drivers
  • Entertainments
  • FAQ
  • For System Administrators
  • FTP
  • General Informations
  • General Knowledge
  • Guidelines
  • Hardwares
  • Health Tips
  • Internet Tips
  • Latest Software Updates
  • Network Trouble shooting
  • Printer Trouble shooting
  • Printing Tips
  • Recovery Tips
  • Registry Tips
  • Registry Tools
  • Security Guidelines
  • Security Tips
  • Software Tips
  • Softwares
  • SQL
  • Technology
  • Tips and Tricks
  • Tools
  • Trouble shooting
  • Useful Softwares
  • Utilities
  • Virus Solutions
  • Websites
  • windows 7
  • Windows Server
  • Windows Tips
  • Windows Vista
  • Windows XP FAQ

Blog Archive

  • ►  2011 (138)
    • ►  May (32)
    • ►  April (24)
    • ►  March (29)
    • ►  February (15)
    • ►  January (38)
  • ▼  2010 (241)
    • ►  December (55)
    • ►  November (40)
    • ►  October (21)
    • ▼  September (35)
      • HP LJ 1007 Laser Printer - Driver
      • How to print to a network printer from an MS-DOS-b...
      • DISCUSSIONS ON VARIOUS ISSUES TAKEN UP BY THE STAF...
      • Tips to Prevent Computer Fraud
      • Disabling or enabling Windows XP System Restore
      • History, Facts and Information about Roman Numerals
      • Recruitment Processing Software
      • Hirens BootCD 11.0 + Multilingual Keyboard Patch
      • Actice Directory FAQ with Answers
      • Windows Server 2008 Core Command Guide
      • NIC Guide for DOP People
      • General Network Connectivity Problems
      • How to troubleshoot network connectivity problems
      • Windows Registry Editor, Task Manager Problem
      • Windows Adminstrator Password Recovery
      • Computer Vision 101: Simple Tips Your Eyes Will Ap...
      • Health Tips for Computer Users
      • ADMINISTRATOR ACCOUNTS AND VIRUSES
      • Health Tips - Heart Attack
      • Suspect SQL Server 2000 Database
      • REPORT OF THE COMMITTEE OF EXPERTS ON DISCIPLINARY...
      • How to create a "Restore Point" and how to get our...
      • Troubleshoot printer problems
      • Scientific meaning of Gaytri Manthra
      • How to Improve Printing Quality
      • How to use Remote Desktop Utility
      • How to Share Files and Printer in the Local Area N...
      • Administrator and User Passwords in Windows XP
      • Enable Vista's Built-in Administrator Account
      • How to Set Password to Protect Files or Folders in...
      • Save queries in Windows Server 2003's Active Direc...
      • How to Create Active Directory ( In Windows Server...
      • How to Join a Domain in Windows 7
      • Delete IE7 History From the Command Line
      • Changing the default SQL Server backup folder
    • ►  August (39)
    • ►  July (23)
    • ►  June (5)
    • ►  May (2)
    • ►  April (12)
    • ►  March (4)
    • ►  February (2)
    • ►  January (3)
  • ►  2009 (26)
    • ►  December (5)
    • ►  November (3)
    • ►  October (4)
    • ►  September (5)
    • ►  August (3)
    • ►  July (5)
    • ►  June (1)
Powered by Blogger.

About Me

Unknown
View my complete profile