Force repair of Content Database using PowerShell

Problem

Your content database has corrupted and you are not able to access some pages / subsites / documents.

Solution

Try the following to see if it fixes your problem:

  1. Run SharePoint Management Shell
  2. Type Get-SpDatabase | fl name,id
  3. Locate the offending database and copy its ID
  4. Enter the following PowerShell commands to fix your content database.
$db = Get-SPDatabase (Content Database ID)
$db.Repair($false)
$db.Update()

Tags: ,

One Response to “Force repair of Content Database using PowerShell”

  1. markwillium July 14, 2014 at 12:59 pm #

    You can also repair corrupt SharePoint database by following methods:
    1. Stsadm operation – Databaserepair: It detects and removes orphaned items from content databases in Windows SharePoint Services.
    2. Stellar Phoenix SharePoint Recovery: It uses advanced algorithm to scans & repairs corrupt SharePoint database.

    Thanks,

Leave a Reply

%d bloggers like this: