Another fine evening, SCOM reported an IO issue in SQL Server box where SharePoint DBs residing. At the same time, End-users started getting errors: "Cannot complete this action. Please Try again."
Try the soft repairs first:
stsadm -o databaserepair -url http://site-coll-url -databasename "Content_Database_Name"
PowerShell equivalent to repair a SharePoint database would be:
$database = Get-SPDatabase "Content_Database_Name" $database.Repair($false); $database.Update();
If its not successfully repaired, Check the Database's consistency by disconnecting database from SharePoint:
stsadm -o Deletecontentdb -url <URL-of-my-Web-App> -databasename wss_content
Log into SQL Server, Get into SSMS. Run these commands:
ALTER DATABASE WSS_CONTENT SET SINGLE_USER
DBCC CHECKDB ('WSS_CONTENT') WITH NO_INFOMSGS
DBCC CHECKDB with "Repair_Allow_Data_Loss". O.K, Let me try this before using repair_allow_data_loss:
DBCC CHECKDB('WSS_Content', REPAIR_REBUILD)
Nope, It didn’t Help, it returned the same error.
DBCC CHECKDB('WSS_Content', REPAIR_ALLOW_DATA_LOSS)
luckily it fixed the issue.
Verified the database consistency by running
DBCC CHECKDB ('WSS_Content') WITH NO_INFOMSGS
again. This time, no issues. we are done.
Set the database mode to Multi & add it back to SharePoint:
ALTER DATABASE WSS_CONTENT SET MULTI_USER
Added the DB back to SharePoint:
stsadm -o addcontentdb -url <URL-of-my-Web-App> -databasename wss_content
Same kind of issue happened recently with PAGE error. Tried Repair, Allow data Loss, But none worked.
finally, I got to restore the database from backups and figured out the root cause: Server hardware failure :-(
You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.