0

I am working on SharePoint server 2013 enterprise , and i run the Health Analyzer, but i got this error "Content databases contain orphans items" :-

enter image description here

Here is the full description of the problem when i click on the above error:-

Title 
 Content databases contain orphaned items.  

Severity 
 1 - Error  

Category 
 Availability  

Explanation 

In some situations, a content database that is used by Microsoft SharePoint Foundation may become corrupted. The corrupted database may contain orphaned items. For example, a document may not have a parent document library or a list may not have a parent Microsoft SharePoint Foundation Web site.  Consequently, you may be unable to create new items with the same URL as the orphaned items, and space in the content database will be consumed unnecessarily.


Remedy 

Enabling automatic repair for this rule will delete the orphaned items. For more information about this rule, see "http://go.microsoft.com/fwlink/?LinkID=142694".


Failing Servers 


Failing Services 

SPTimerService (SPTimerV4)

so can anyone advice on how i can fix this error inside the Health Analyzer? Now from my own search on this problem i found that many links suggest to run the following command to check what are the orphans items inside the content database:-

(Get-SPContentDatabase <content database name>).Repair($false)

but not sure if running this command , have any risks ? or it will just display the orphans items without doing any modifications to the content database ?

EDIT based on the replies I received i run the following command :-

PS C:\Windows\system32> (Get-SPContentDatabaseWSS_Content_*******).Repair($false)

and i get the following result

<OrphanedObjects Count="15">
  <Orphan Type="RoleAssignments" Count="15" />
</OrphanedObjects>

so not sure what does RoleAssignments means ?

1

The command as you have it shown will list the items that would be repaired by the command, but will not perform any repair action.

Change the $false to $true to actually go ahead with the repair operations once you've analysed the output from the original command.

Andy

  • ok thanks a lot for your reply,, so i will run the command with $false, then i will analyze the results, and if i find that i do not need the orphans i will rerun the command with $true ? is this correct? second question,, should running the command with $true fix the error inside the health analyzer , or there are other commands i need to run ? – john Gu Feb 13 '16 at 23:42
  • 1
    Once the command has been run with $true, any corruption should be automatically fixed (obviously a database backup before performing the repair is very strongly recommended just in case) and eventually the health analyser rule will re-run and the error shown will go away. You can also re-evaluate the rule on command if required once the command has been run to repair the corruption, which assuming it was successful will make the error vanish from the health analyser. – Andy Dawson Feb 15 '16 at 9:28
  • thanks very much for the help, now can you check my edit to the original question, i run the Repair command with $false , and i got the following output :- <OrphanedObjects Count="15"> <Orphan Type="RoleAssignments" Count="15" /> </OrphanedObjects> .. but i am not sure about what does this mean ? – john Gu Feb 15 '16 at 12:24
  • can you advice on my comments please? – john Gu Feb 16 '16 at 12:57
  • RoleAssigments define the securable object role assignments for a user or group on the web, site, list, or list item. This could be caused by deleting users or groups that are assigned this role assignment. – Andy Dawson Feb 18 '16 at 14:53
1

Over time, the content database can accumulate objects that are corrupted. An object that should have a parent object might be orphaned; an object that should have a child object might not have one. These things can happen due to a variety of misfortunes: power failures, lost connectivity, application timeouts, software faults, or just plain bad luck.

To find out if a database contains such corruption, call the Repair method and then examine the string that the method returns. To delete the corrupted objects from the database, call the Repair method with true as the argument.

https://msdn.microsoft.com/EN-US/library/microsoft.sharepoint.administration.spcontentdatabase.repair.aspx

Running as False will not hurt as MSFT recommend it. After running the command with true, you have to run the Heath Analyzer rule to check if it fixed the error or not.

  • thanks a lot for your reply,, but how much i can trust calling the .Repair with true argument on a live DB ?,, i mean could the Repair operation delete non-orphnas things and cause exceptions? or this depend on what the .repair method will actually Repair which i can examine from running the .Repair with false argument ? second question, are there other commands that i need to run to fix the "content database contain orphans items" error ? – john Gu Feb 14 '16 at 3:58
  • 1
    i am not Microsoft guy, this is gurrantte only MSFT can give you...But what we shared her is as per our experience with good faith...their are other ways to remove it, i.e detaching and re attaching the db ( which i tried)....another thing if you are really scared then move the content db into test farm and then test it their....another way mentioned here technet.microsoft.com/en-us/library/ff805076(v=office.14).aspx – Waqas Sarwar MVP Feb 14 '16 at 4:44
  • 1
    good article netsharepoint.blogspot.com/2013/11/… – Waqas Sarwar MVP Feb 14 '16 at 4:44
  • i run the following command (Get-SPContentDatabaseWSS_Content_*******).Repair($false) and i get the following output :- <OrphanedObjects Count="15"> <Orphan Type="RoleAssignments" Count="15" /> </OrphanedObjects> .. so what are these orphans represents,, can you advice please? – john Gu Feb 15 '16 at 1:38
  • can you advice on my previous comments if possible as i did not find relevant documentation on what does <OrphanedObjects Count="15"> <Orphan Type="RoleAssignments" Count="15" /> </OrphanedObjects> mean? – john Gu Feb 16 '16 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.