Search
  • For Individuals
      « Back
    • Windows Data Recovery

      Recovers lost or deleted Office documents, emails, presentations & multimedia files.

      Free Standard Professional Premium

    • Mac Data Recovery

      Recovers deleted files, photos, videos etc. on Mac.

      Free Standard Professional Premium

    • Photo Recovery

      Recover photos, videos, & audio files from all cameras and storage on Windows.

      Free Standard Professional Premium

    • Video Repair
    • Photo Repair
    • iPhone Data Recovery
  • For Business
      « Back
    • Email Repair & Converter

      Repair for Exchange Converter for EDB Converter for OST Converter for NSF Converter for OST MBOX Repair for Outlook

    • Database & File Repair

      Repair for MS SQL Repair for Access Repair for QuickBooks Software Repair for Excel Extractor for Windows Backup Repair for MySQL

    • Data Recovery & Erasure

      Data Recovery Professional Data Recovery Technician Mac Recovery for Technician Virtual Machine Recovery File Erasure Software Mobile Erasure Drive Erasure File Eraser Software File Eraser Software for Mac

    • Toolkit

      Exchange Toolkit Outlook Toolkit File Repair Toolkit MS SQL Toolkit Data Recovery Toolkit

    • Forensic

      Email Forensic Exchange Auditor Log Analyzer for MySQL Log Analyzer for MS SQL

  • Store
  • Partners
  • Services
  • Offers
  • Support

 

  • For Individuals
    DIY software for anyone who works with data.

    Windows Data Recovery Recovers lost or deleted Office documents, emails, presentations & multimedia files

    Free Standard Professional Premium

    Mac Data Recovery Especially for Mac users to recover deleted documents and multimedia files from macOS

    Free Standard Professional Premium

    Video Repair Windows Mac Repair multiple corrupt videos in one go. Supports MP4, MOV & other formats.

    StandardPremium

    Photo Recovery Windows Mac Recover photos, videos, & audio files from all cameras and storage on Windows.

    Standard Professional Premium

    iPhone Data Recovery Windows Mac Recover deleted photos, videos, contacts, messages etc. directly from iPhone & iPad

    Recover Erase Toolkit

    Photo Repair Windows Mac Repair multiple corrupt photos in one go. Supports JPEG & other formats.

    Standard Professional Premium


  • For Business
    • Email Repair
    • Email Converter
    • File Repair
    • Data Recovery & Erasure
    • Toolkit
    • Forensic

    Exchange Repair Repair corrupt EDB file & export mailboxes to Live Exchange or Office 365

    Outlook PST Repair Repair corrupt PST & recover all mailbox items including deleted emails & contacts

    OLM Repair Repair Outlook for Mac (OLM) 2011 & 2016 backup files & recover all mailbox items

    Exchange Toolkit Repair EDB & Exchange backup file to restore mailboxes, convert OST to PST, & convert EDB to PST

    Active Directory Repair Repair corrupt Active Directory database (Ntds.dit file) & extract all objects in original form

    EDB to PST Convert online & offline EDB file & extract all mailbox items including Public Folders in PST

    OST to PST Convert inaccessible OST file & extract all mailbox items including deleted emails in PST

    NSF to PST Convert IBM Notes NSF file & export all mailbox items including emails & attachments to PST

    MBOX to PST Convert MBOX file of Thunderbird, Entourage & other clients, & export mailbox data to PST

    OLM to PST Convert Outlook for Mac Data File (OLM) & export all mailbox data to PST in original form

    GroupWise to PST Convert GroupWise mail & export all mailbox items - emails, attachments, etc. - to PST

    EML to PST Convert Windows Live Mail (EML) file & export mailbox data - emails, attachments, etc. - to PST

    Office 365 to PST Connect to Office 365 account & export mailbox data to PST and various other formats

    DBX to PST Convert Outlook Express (DBX) file & export all mailbox data - emails, attachments, etc. - to PST

    SQL Repair Repair corrupt .mdf & .ndf files and recover all database components in original form

    Access Repair Repair corrupt .ACCDB and .MDB files & recover all records & objects in a new database

    QuickBooks Repair Repair corrupt QuickBooks® data file & recover all file components in original form

    MySQL Repair Repair MyISAM & InnoDB tables and recover all objects - keys, views, tables, triggers, etc.

    Excel Repair Repair corrupt Excel (.XLS & .XLSX) files and recover tables, charts, chart sheet, etc.

    BKF Repair Repair corrupt backup (BKF, ZIP, VHDX and .FD) files and restore complete data

    Database Converter Interconvert MS SQL, MySQL, SQLite, and SQL Anywhere database files

    PowerPoint Repair Repair corrupt PPT files and restore tables, header, footer, & charts, etc. like new

    File Repair Toolkit Repair corrupt Excel, PowerPoint, Word & PDF files & restore data to original form

    Data Recovery Windows Mac Recover lost or deleted data from HDD, SSD, external USB drive, RAID & more.

    Technician Toolkit

    Tape Data Recovery Retrives data from all types and capacities of tape drives including LTO 1, LTO 2, LTO 3, & others.

    Virtual Machine Recovery Recover documents, multimedia files, and database files from any virtual machine

    File Erasure Permanently wipe files and folders, and erase traces of apps and Internet activity.

    Standard Corporate

    Mobile Erasure Certified and permanent data erasure software for iPhones, iPads, & Android devices

    Drive Erasure Certified and permanent data erasure software for HDD, SSD, & other storage media Windows Mac

    Exchange Toolkit 5-in-1 software toolkit to recover Exchange database, convert EDB to PST, convert OST to PST, restore Exchange backup, and reset Windows Server password.

    Outlook Toolkit Comprehensive software suite to repair PST files, merge PST files, eliminate duplicate emails, compact PST files, and recover lost or forgotten Outlook passwords.

    File Repair Toolkit Powerful file repair utility to fix corrupt Word, PowerPoint, and Excel documents created in Microsoft Office. It also repairs corrupt PDF files and recovers all objects.

    MS SQL Toolkit 5-in-1 software toolkit to repair corrupt SQL database, restore database from corrupt backup, reset database password, analyze SQL logs, & interconvert databases.

    Data Recovery Toolkit Software helps to recovers deleted data from Windows, Mac and Linux storage devices. Also supports recovery from RAIDs & Virtual Drives.

    Email Forensic Advanced email forensic solution for cyber experts to audit, analyze, or investigate emails & gather evidences.

    Exchange Auditor Exchange Server monitoring solution to automate audits, scans and generate reports ìn real-time.

    Log Analyzer for MySQL Analyze forensic details of MySQL server database log files such as Redo, General Query, and Binary Log.

    Log Analyzer for MS SQL Track & analyze MS SQL Server database transactions log files.

    STELLAR EMAIL FORENSIC

    Advanced email forensic tool to analyze and collect the mailbox data of email clients

    Learn More arrow


    All Products

    All Products

    All Products

    All Products

  • Our Partners
  • Lab Services
  • Trending Searches

    Data Recovery

    Photo Recovery

    Video Repair

    iPhone Data Recovery

    File Erasure Software

    Exchange Repair

    OST to PST

    PST Repair

    Raid Recovery

    MS SQL Repair

  • English Deutsch Français Nederlands Italiano Español 日本語 简体中文
  • Support
Database Recovery 5 minute read

How to Check Database Corruption in SQL Server?

Updated on March 22nd, 2022
Charanjeet Kaur
Written By
Charanjeet Kaur
Kuljeet Singh
Approved By
Kuljeet Singh

Summary: This blog discusses methods to check database corruption in SQL Server. It also suggests solutions you can use to fix a corrupted database manually. And, it explains how using a third-party tool, Stellar Repair for MS SQL, can help repair a corrupted database and restore it without any data loss.

How to Check Database Corruption in SQL Server?

Your database may be healthy, but it can become inaccessible or corrupted anytime due to events like server crash, an issue with your hardware or software, virus or malware attack, etc. If you’re lucky enough, you may receive an error message indicating database corruption in SQL Server. However, you might fail to identify corruption sometimes, until you can no longer access your database. That’s why, as administrators, it is crucial to detect corruption in a SQL Server database as early as possible.

Contents

  • What You Can Do to Check SQL Server Database Corruption?
  • What to do if SQL Server Database is Corrupted?
  • Conclusion

What You Can Do to Check SQL Server Database Corruption?

SQL Server has built-in mechanisms you can use to detect a corruption issue:

Method 1 – Monitor SQL Server Suspect Pages

Querying the system table (i.e., suspect_pages), residing in the msdb database of SQL Server, is the first thing you should try instead of checking an entire database for corruption.

Monitoring the suspect_pages table will help you quickly find any corrupted pages in your database. To check for bad pages in the ‘suspect_pages’ table, run this query:

SELECT * FROM msdb..suspect_pages

For detailed information on how to monitor SQL Server suspect_pages, read this: How to Monitor SQL Database Suspect Pages?

Method 2 – Use PAGE Verify Option

CHECKSUM, used as the ‘PAGE_VERIFY’ option on your database can help detect page level corruption caused due to I/O errors.

Although databases on SQL Server 2008 and higher versions use ‘CHECKSUM’ as page verification setting by default, this wasn’t the case with SQL Server 2005 instances. While checking databases migrated from an earlier server instance, you might find the PAGE_VERIFY option set to TORN PAGE DETECTION or NONE.

You can change the database option to CHECKSUM using SQL Server Management Studio (SSMS) or T-SQL.

Changing PAGE_VERIFY Option to CHECKSUM using SSMS

1. In SSMS, right-click on the database you need to check for corruption and click Properties.

2. On the ‘Database Properties’ window, click Options. When the ‘Options’ page opens, scroll down to Recovery. Next, click the drop-down next to Page Verify, choose CHECKSUM, and then click OK.

Set Page Verify DB Option to Checksum

Changing PAGE_VERIFY Option to CHECKSUM using T-SQL

Execute the following T-SQL commands to set ‘PAGE VERIFY CHECKSUM’ option:

ALTER DATABASE SET PAGE_VERIFY CHECKSUM WITH NO_WAIT;

Method 3 – Run DBCC CHECKDB

Running DBCC CHECKDB regularly to check for database integrity is crucial for detecting database corruption in SQL Server.

DBCC CHECKDB ‘database_name’;

If it finds corruption, it will return consistency errors along with an error message showing complete details why database corruption in SQL Server occurred.

Method 4 – Set up SQL Server Agent Alerts

While running DBCC CHECKDB commands can help check integrity of the databases, without setting up an alert, you may not notice corruption for days or even weeks. But, setting up a quick alert with SQL Server Agent can help you know of possible SQL database corruption before it’s too late to fix the problem.

Steps to Set up SQL Server Agent Alerts

  • In SSMA, right-click on SQL Server Agent, and click on Properties.
Open Sql Server Agent Properties
  • On your database properties page, click Alert System under ‘Select a page’. In the ‘Alert Systems’ page, check the Enable mail profile checkbox, and choose Database Mail from the Mail system list.
Enable Database Mail Profile
  • Click OK to configure mail for SQL Server Agent.
  • Now to create alerts for the SQL Agent, expand SQL Server Agent, right-click on Alerts folder, and then select New Alert.
Create New Alert
  • Specify the name of the alert, for instance ‘Corruption Suspected’ (or anything you like), leave the Database name as <all databases>. Next, from the Severity drop-down list, choose “023 –Fatal Error: Database Integrity Suspect”. 
Specidy Alert Name-and Severity
  • Click on the Response tab under ‘Select a page’. From the ‘Response’ page do the following:
  • Check the Notify operators checkbox.
  • Choose an existing operator or create a new one with an assigned email address.
  • Check the e-mail checkbox.
  • Click OK.
Notify Operators

After performing these steps, an alert gets created. It will send an email to the DBAs notifying them about corruption when a database integrity event happens.

Note: While you may perform checks to detect database corruption, checking database backups for corruption is equally important. Doing so will ensure that you’ve a good backup copy to restore to in case of unexpected database downtime. Here’s a detailed blog on how to identify corrupted SQL backup file: How to Identify Corrupted SQL Backup File.

What to do if SQL Server Database is Corrupted?

If you’ve detected corruption in your SQL Server, the most effective and recommended solution is to restore it from a good known backup available. If you don’t have backup, running DBCC CHECKDB with the following repair commands can help fix the corrupted database:

  • REPAIR_REBUILD

To repair a corrupted SQL database without data loss risk, you can try running “DBCC CHECKDB with Repair_REBUILD”:

DBCC CHECKDB (‘Database_name’, REPAIR_REBUILD);

The ‘REPAIR_REBUILD’ option can help fix minor corruption in a SQL database. For a severely corrupted db, you will need to use ‘REPAIR_ALLOW_DATA_LOSS’.

  • REPAIR_ALLOW_DATA_LOSS

While this repair option can fix all types of errors reported by DBCC CHECKDB, it may cause data loss. That’s why, it is recommended as the last resort to fix database consistency errors. To run “DBCC CHECKDB with REPAIR_ALLOW_DATA_LOSS”, execute the following command:

DBCC CHECKDB (‘Database_name’, REPAIR_ALLOW_DATA_LOSS);

Is There a Better Alternative to Repairing a Corrupted SQL Database?

Using a specialized SQL database repair tool is a better alternative to repair corrupt SQL database. Trusted by MVPs and administrators, Stellar Repair for MS SQL is the best solution to fix corruption and restore the database without any data loss. It repairs corrupt MDF and NDF files and recovers all the objects like tables, deleted records, stored procedures, indexes, triggers, etc.

The software can be easily downloaded and installed within a few seconds. It can run on a Windows, Ubuntu, CentOS 7, and Red Hat Enterprise Linux 7 OS.

Check out this video to understand how to repair a corrupt SQL database with Stellar Repair for MS SQL software:

Conclusion

SQL Server crash, I/O subsystem failure, virus or malware intrusion, and bugs in SQL software are some common reasons that could lead to database corruption. You may not know if a database has turned corrupt until it becomes inaccessible. Fortunately, you can detect a corrupted database by using the methods discussed in this blog.

In case, your database turns corrupt, try restoring the database from an updated backup. If backup is not available, apart from repairing the database using “REPAIR_ALLOW_DATA_LOSS”, there’s not a reliable solution to fix SQL Server database corruption. Also, it involves data loss risk. But, using a third-party SQL database repair software like Stellar Repair for MS SQL can help you restore your database and all its data with integrity and precision.

About The Author

Charanjeet

Charanjeet is a Technical Content Writer at Stellar®who specializes in writing about databases, e-mail recovery, and e-mail migration solutions. She loves researching and developing content that helps database administrators, organizations and novices to fix multiple problems related to MS SQL and MySQL databases and Microsoft Exchange.

Best Selling Products

Stellar Repair for MS SQL

Stellar Repair for MS SQL is an enterpri

Read More

Stellar Toolkit for MS SQL

3-in-1 software package, recommended by

Read More

Stellar Converter for Database

Stellar Converter for Database is an eff

Read More

Stellar Repair for Access

Powerful tool, widely trusted by users &

Read More

Leave a comment Cancel reply

Your email address will not be published. Required fields are marked *

9  +  1  =  

Table of Contents Hide

  1. What You Can Do to Check SQL Server Database Corruption?
  2. What to do if SQL Server Database is Corrupted?
  3. Conclusion

Categories

Related Posts

Database Recovery

How to Fix Error “The database cannot be recovered because the log was not restored”?

Stellar Author Charanjeet Kaur April 15, 2022 Read More
Database Recovery

How to Fix System Database Corruption in SQL Server?

Stellar Author Charanjeet Kaur April 8, 2022 Read More
Database Recovery

How to Get Data from a Corrupt SQL Table?

Stellar Author Charanjeet Kaur March 4, 2022 Read More

Stellar Official Website

Stellar Data Recovery Inc.
48 Bridge Street Metuchen,
New Jersey 08840,
United States

ALSO AVAILABLE AT

About

  • About us
  • Career
  • ISMS Policy
  • Privacy Policy
  • Terms of Use
  • License Policy
  • Refund Policy
  • End User License Agreement

RESOURCES

  • Blog
  • Articles
  • Product Videos
  • Knowledge Base
  • Case Studies
  • Whitepapers
  • Software Catalog

NEWS & EVENTS

  • News
  • Events

PARTNERS

  • Affiliates
  • Resellers
  • Distributors

Useful Links

  • Contact Us
  • Support
  • Special Offers
  • Student Discounts
  • Awards & Reviews
  • Downloads
  • Store
  • Sitemap
Follow Us

Stellar & Stellar Data Recovery are Registered Trademarks of Stellar Information Technology Pvt. Ltd. © Copyright 2022 Stellar Information Technology Pvt. Ltd. All Trademarks Acknowledged.

DMCA.com Protection Status
We use cookies on this website. By using this site, you agree that we may store and access cookies on your device Read More Got it!