Search code examples
sqlsql-serverdatabasedatabase-administration

how to fix sql server page level corruption?


How can i fix the page level corruption in sql database. I am facing a big issue related to this. Can anyone help me.


Solution

    1. Go to SQL Server Management Studio

      • Select the DB

      • Right Click the DB

      • Go to Properties

      • Select Options

      • Under Other Option select the Page Verify

      • Select as NONE.

    2. Run this Query to Change DB into Single User Mode

      • ALTER DATABASE corrupted_db SET SINGLE_USER WITH ROLLBACK IMMEDIATE
    3. Run this Query to Recover the Table/DB.

      • DBCC CheckTable ('corrupted_table', REPAIR_ALLOW_DATA_LOSS)

    (OR)

    • DBCC CheckDB ('corrupted_db', REPAIR_ALLOW_DATA_LOSS)

      1. Once this Execution Completed Sql returns “Errors are Corrected”

      2. Run this Query to Change the DB into Multi-User Mode

    • ALTER DATABASE Application Manager SET MULTI_USER

      1. Go to SQL Server Management Studio
    • Select the DB

    • Right Click the DB

    • Go to Properties

    • Select Options

    • Under Other Option select the Page Verify

    • Select the Option CHECKSUM.

      1. Now Run DBCC CHECKDB('Your DB')