Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to fix sql server page level corruption? [closed]

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

like image 769
Aman Garg Avatar asked May 13 '17 09:05

Aman Garg


1 Answers

  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')
like image 63
Devang Garg Avatar answered Oct 12 '22 05:10

Devang Garg