............ Have a nice day............
USER MENU ID IS UNDEFINED IN FINACLE MIS SERVER   Date of Implementation of "VERY GOOD" Bench Mark for MACPs effect from 25.07.2016   Expected DA from Jan 2017 – 3% or 2% ?    One minute talk time for each Rupee in Airtel Payments Bank   AICPIN for October 2016 : Chances for 5% DA from January 2017   Central Government employees retiring from January 2017 to submit online application   Pre-Budget Views of Govt. Employees for inclusion in the Budget for the Year 2017-18: Confederation i.e. Scrap NPS, Minimum Wage Rs. 26,000 & Fitment Formula etc   On Salary Week, Banks Unlikely to Meet Demand for Extra 1 Lakh Cr   82 per cent ATMs dry because government used that money to pay its own employees   National Anthem Before Movie, Rules Supreme Court. Citizens 'Duty-Bound' To Show Respect    undefined

Thursday, 3 January 2013

Repair/Recover Suspect Database in SQL 2000/2005/2008



steps to follow in repairing the suspect database if the culprit was an I/O error:

While take a backup LDF or MDF it shows error like
So follow below steps to recover MDF/LDF
  • Kill all connections and stop SQL Server


  • Perform a Checkdisk with repair option for  C:& corrupted DB drive

  • Perform a Defragmentation corrupted database drive

  • Now copy the files necessary (MDF, LDF and Backups)
  • Perform a backup
BACKUP DATABASE <dbname>TO DISK='X:\YourFolder\YourFileNameDB.bak'
  • Restore the backup
  • Repair the Database (DBCC CHECKDB)
USE [master]
GO
ALTER DATABASE <dbname> SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
ALTER DATABASE <dbname> SET SINGLE_USER
GO
DBCC CHECKDB <dbname>, REPAIR_REBUILD) WITH ALL_ERRORMSGS, NO_INFOMSGS
GO
ALTER DATABASE <dbname> SET MULTI_USER
GO
  • Backup the repaired DB
To download query for recover SQL Database:

No comments:

Post a Comment