Orphaned Objects are items that do not have any parent or child relationship and
remain in the content database uncleaned. When you perform the Test-SPContentDatabase to validate a content database you might receive errors which provides information about orphans in the content database
These orphaned objects
need to be removed on the below situations:
1. Before applying
service packs or cumulative updates to the SharePoint servers
2. Before performing a
migration from a older version of SharePoint to a newer version.
3. Before reapplying
templates or performing any updates to the database.(certain powershell
commands would not work when running update scripts on the database. ex.
Applying modification to a Custom Master Page that is already deployed to the
sites). The execution of powershell scripts will fail when iterating the tables
for fetching or applying update to the data in SharePoint content databases
There are 2 types of
Orphan Objects
1. Config
Orphans (Orphan Site exist in Configuration Database but does not have
any child item in Content Database). Central Admin ->View All Site
Collections shows the site info, but the actual site cannot be accessed via
browser.
2. Content
Orphans (Orphans include Lists without Parent sites, Documents with no
parent document library, Web Parts that does not have an assembly, Web Pages with no Parent Site E.t.c..). Site Collections that are
available in content database but not in config db (Will not show in Central
Admin -> View All Site Collections page)
A.
Config Orphan Object Removal:
Cleaning the config orphan is the easiest one.
Simply detach the content database that has the
orphan site from your farm and attach it back. This will refresh and remove the
stale entries.
B.
Content Orphan Object Removal
There are 2 ways to
remove content orphans from the content database
1. Use SharePoint Health Analyzer
2. Use STSADM or PowerShell Commands
1.
SharePoint Health Analyzer
(Note : Not recommended in a Production farm as
it sometimes might cause SQL Blocking if there are very large content
databases)
Go to Central Admin - > Monitoring >
Health Analyzer Section > Review Problems and Solutions > Content
Database Contain Orphaned Items - Click on the Ribbon Command "Repair
Automatically".
2.
Using STSADM Commands
I have provided two scripts to first log the
orphans in text file.(STSADM Method)
When you execute the first script, this will
list out the orphaned objects in text file
The second one will delete the orphans.
This method will delete only when you have
orphan sites in one content database.
Modify the site collection name and database name
related to the STSADM command line.
To Check Orphans (Store the below content in a
.Bat file)
echo on
rem *** set local environment variables
setlocal
set LogFile="D:\LogOrphans.txt"
c:
cd "\Program Files\Common Files\Microsoft
Shared\Web Server Extensions\14\BIN" >> %LogFile%
Echo "List Orphans ...." >>
%LogFile%
stsadm.exe -o databaserepair -url
https://contoso.com/sites/sitecollection -databasename Content10_ContentDB
>> %LogFile%
Echo "************** E N D*********"
>> %LogFile%
pause
PowerShell Command to
check orphans:
$contentdb =
Get-SPContentDatabase | Where-Object {$_.Name –match "Content_Contentdb"}
test-spcontentdatabase
$contentdb -showrowcounts | Format-Table -Wrap | Out-File -FilePath c:\testcontent.txt
To Delete Orphans(Store the below content in a
.Bat file):
echo on
rem *** set local environment variables
setlocal
set LogFile="D:\LogOrphans.txt"
c:
cd "\Program Files\Common Files\Microsoft
Shared\Web Server Extensions\14\BIN" >> %LogFile%
Echo "List Orphans ...." >>
%LogFile%
stsadm.exe -o databaserepair -url
https://contoso.com/sites/sitecollection -databasename Content10_ContentDB
-deletecorruption >> %LogFile%
Echo "************** E N D*********"
>> %LogFile%
pause
The Ouput in log File below:
"List Orphans ...."
<OrphanedObjects Count="43">
<Orphan Type="SPWeb" Name="Contoso Sub Site0" Id="{B779C412-8AE4-4D3B-877C-BFB41F94E735}" Deleted="Yes" />
<Orphan Type="SPWeb" Name="Contoso Sub Site1" Id="{46F35180-7758-4ED5-8C51-3E7E3D1D5441}" Deleted="Yes" />
<Orphan Type="SPWeb" Name="Contoso Sub Site10" Id="{252EAB85-7535-4141-8BFB-2982BCACE095}" Deleted="Yes" />
<Orphan Type="SPWeb" Name="Contoso Sub Site11 (en)" Id="{9F5B2BCA-2B4E-4E01-B3C4-401A9C078C25}" Deleted="Yes" />
<Orphan Type="SPWeb" Name="Contoso Sub Site12 (fr)" Id="{5E9342E3-2BF1-4692-ACB8-A900307992F2}" Deleted="Yes" />
<Orphan Type="SPWeb" Name="Contoso Sub Site0" Id="{B779C412-8AE4-4D3B-877C-BFB41F94E735}" Deleted="Yes" />
<Orphan Type="SPWeb" Name="Contoso Sub Site1" Id="{46F35180-7758-4ED5-8C51-3E7E3D1D5441}" Deleted="Yes" />
<Orphan Type="SPWeb" Name="Contoso Sub Site10" Id="{252EAB85-7535-4141-8BFB-2982BCACE095}" Deleted="Yes" />
<Orphan Type="SPWeb" Name="Contoso Sub Site11 (en)" Id="{9F5B2BCA-2B4E-4E01-B3C4-401A9C078C25}" Deleted="Yes" />
<Orphan Type="SPWeb" Name="Contoso Sub Site12 (fr)" Id="{5E9342E3-2BF1-4692-ACB8-A900307992F2}" Deleted="Yes" />
<Orphan
Type="SPList" Id="{1F90BF81-1965-460E-8F46-85655BEFB306}"
SiteId="{5E9342E3-2BF1-4692-ACB8-A900307992F2}" />
</OrphanedObjects>
"************** E N D*********"
Note:
In some scenarios certain orphan object might
not get removed, but still show that it is removed and will remain in the
database.
To validate this, run the below command to list
the objects in the content database and cross verify with the log files
stsadm -o enumallwebs -databasename Content10_ContentDB
Output of the above Stsadm command
<Sites Count="2">
<Site
Id="9F5B2BCA-2B4E-4E01-B3C4-401A9C078C25"
OwnerLogin="Domain\username" InSiteMap="False">
<Webs Count="1">
<Web Id="064d8e7b-b349-4693-bd67-dcefed3bf466"
Url="/sites/contososubsite11" LanguageId="1033"
TemplateName="STS#0" TemplateId="1" />
</Webs>
</Site>
<Site
Id="f440114b8-79d9-32f6-87bf-4geddf2ad9b6"
OwnerLogin="Domain\username" InSiteMap="True"
HostHeader="www.contoso.com">
<Webs Count="1">
<Web Id="12348e7b-c456-4693-bd67-efdegd3bf466"
Url="/" LanguageId="1033" TemplateName="STS#0"
TemplateId="1" />
</Webs>
</Site>
</Sites>
If the property InSiteMap=False then the
site collection is an orphan.
Final Validation:
If you still have the orphaned objects listed,
then try the below options and then validate again with the log file
1. Disconnect the database and reconnect the
database so that the references will be removed.
2. Try removing the corrupted list or item using
the sharepoint designer tool.
3. Try deleting the site using below Stsadm
commands
stsadm -o deletesite -force -url
http://contoso.com/sites/contososubsite11 -databaseserver ds -databasename
contentdb1
(or)
stsadm -o deletesite -force -siteid e2a114b8-80c9-41f6-87bf-3feddf2ad9b6 -databaseserver ds -databasename
contentdb1
4. Try running the below Powershell
commands
(Get-SPContentDatabase <DB
Name>).Repair($true)
Ex:
(Get-SPContentDatabase
Collab_ContentDB).Repair($true)
This blog is so nice to me. I will keep on coming here again and again. Visit my link as well..
ReplyDeletedelete cheaterland.com complaint
I really like the dear information you offer in your articles. I’m able to bookmark your site and show the kids check out up here generally. Im fairly positive theyre likely to be informed a great deal of new stuff here than anyone
ReplyDeletepython training in tambaram
python training in chennai
python training in annanagar
python training in chennai
Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here.
ReplyDeleteData science training in tambaram
Data Science training in anna nagar
Data Science training in chennai
Data science training in Bangalore
Data Science training in marathahalli
Data Science training in btm
Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here.
ReplyDeleteData science training in tambaram
Data Science training in anna nagar
Data Science training in chennai
Data science training in Bangalore
Data Science training in marathahalli
Data Science training in btm
This is the best article on recent technology. Thanks for taking your own time to share your knowledge,
ReplyDeleteSelenium training in Chennai
Selenium Courses in Chennai
ios developer training in chennai
Best ios Training institute in Chennai
iOS Course Chennai
JAVA Training Institutes in Chennai
Java Courses in Chennai
Appreciating the persistence you put into your blog and detailed information you provide
ReplyDeleteMicrosoft Azure online training
Selenium online training
Java online training
Java Script online training
Share Point online training
Hey, would you mind if I share your blog with my twitter group? There’s a lot of folks that I think would enjoy your content. Please let me know. Thank you.
ReplyDeleteBest RPA Training in Chennai
Digital Marketing Training in Chennai
Matlab Training in Chennai
Best AWS Course Training in Chennai
ReplyDeleteYou might comment on the order system of the blog. You should chat it's splendid. Your blog audit would swell up your visitors. I was very pleased to find this site.I wanted to thank you for this great read!!
www.excelr.com/digital-marketing-training
digital marketing course
I always enjoyed by reading your blogs. The information which your blog consist outstanding I couldn't found it anywhere else. Please keep posting the blogs. Even I had started writing blogs since I am a fresher I have no much idea about it. u can suggest me any good blogger who can help .
ReplyDeleteThanks and Regards,
Digital Marketing Course
Your very own commitment to getting the message throughout came to be rather powerful and have consistently enabled employees just like me to arrive at their desired goals.
ReplyDeleteAws training chennai | AWS course in chennai
Rpa training in chennai | RPA training course chennai
very nice blog keep on doing...
ReplyDeletehttps://www.acte.in/angular-js-training-in-chennai
https://www.acte.in/angular-js-training-in-annanagar
https://www.acte.in/angular-js-training-in-omr
https://www.acte.in/angular-js-training-in-porur
https://www.acte.in/angular-js-training-in-tambaram
https://www.acte.in/angular-js-training-in-velachery
My spouse and I love your blog and find almost all of your post’s to be just what I’m looking for. Can you offer guest writers to write content for you? I wouldn’t mind producing a post or elaborating on some the subjects you write concerning here. Again, awesome weblog!
ReplyDeleteAWS training in chennai | AWS training in anna nagar | AWS training in omr | AWS training in porur | AWS training in tambaram | AWS training in velachery
This is the best article on recent technology.
ReplyDeleteAngularJS training in chennai | AngularJS training in anna nagar | AngularJS training in omr | AngularJS training in porur | AngularJS training in tambaram | AngularJS training in velachery
I really appreciating for your effort.seriously informative blog. Java training in Chennai | Certification | Online Course Training | Java training in Bangalore | Certification | Online Course Training | Java training in Hyderabad | Certification | Online Course Training | Java training in Coimbatore | Certification | Online Course Training | Java training in Online | Certification | Online Course Training
ReplyDeleteThis was an excellent post and very good information provided, Thanks for sharing.
ReplyDeleteAngular js Training in Chennai
Angular js Training in Velachery
Angular js Training in Tambaram
Angular js Training in Porur
Angular js Training in Omr
Angular js Training in Annanagar
This was an excellent post and very good information provided, Thanks for sharing.
ReplyDeleteamazon web services aws training in chennai
microsoft azure training in chennai
workday training in chennai
android-training-in chennai
ios training in chennai
This information is impressive; I am inspired with your post writing style & how continuously you describe this topic. After reading your post, thanks for taking the time to discuss this, I feel happy about it and I love learning more about this topic.
ReplyDeleteDevOps Training in Chennai
DevOps Course in Chennai
Worth reading! Our experts also have given detailed inputs about these trainings & courses! Presenting here for your reference. Do checkout Data Science Training in Chennai & enjoy learning more about it.
ReplyDeleteInformation was good,i like your post.Looking forward for more on this topic.
ReplyDeleteSharepoint Admin training in bangalore
If AWS is a job that you're dreaming of, then we, Infycle are with you to make your dream into reality. Infycle Technologies offers the best AWS Course Chennai, with various levels of highly demanded software courses such as Oracle, Java, Python, Hadoop, Big Data, etc., in 100% hands-on practical training with specialized tutors in the field. Along with that, the pre-interviews will be given for the candidates, so that, they can face the interviews with complete knowledge. To know more, dial 7502633633 for more.Best AWS Training in Chennai
ReplyDeleteBrilliant post! We are connecting to this extraordinary post on our site. Keep up the extraordinary composition. best interiors
ReplyDeleteinstagram takipçi satın al
ReplyDeleteinstagram takipçi satın al
instagram takipçi satın al
instagram takipçi satın al
instagram takipçi satın al
instagram takipçi satın al
instagram takipçi satın al
nice post.tableau online training hyderabad
ReplyDeleteWe are added much functionality in this Remove object from photo and Remove BG from photo app like remover, clone stamp, background eraser, quick remover, transparent background and cloth remover.
ReplyDeleteVery Informative blog thank you for sharing. Keep sharing.
ReplyDeleteBest software training institute in Chennai. Make your career development the best by learning software courses.
best devops training in chennai
best msbi training institute in chennai
Docker Training institute in Chennai
android course in chennai
ios course in chennai
Xamarin Training Course in Chennai
informatica training in chennai
Existing without the answers to the difficulties you’ve sorted out
ReplyDeletethrough this guide is a critical case, as well as the kind which could
have badly affected my entire career if I had not discovered your
website.
mysql dba training in chennai
unix course in chennai
top software training institute in Chennai
Nice blog thank you .For your Sharing It's a pleasure to read your post.It's full of information I'm looking for and I'd like to express that "The content of your post is awesome"
ReplyDeleteDotnet Training in Chennai
Core java Training in Chennai
Web design Training in Chennai
1xbet korean Sports Betting - Bet with 1xbet Limited
ReplyDelete1xbet korean Sports Betting. Bet with 1xbet Limited. Get up to 1xbet 1xbet deposit.
mmorpg oyunlar
ReplyDeleteİnstagram Takipçi Satin Al
tiktok jeton hilesi
TİKTOK JETON HİLESİ
antalya saç ekimi
İNSTAGRAM TAKİPÇİ
İnstagram takipçi satın al
metin2 pvp serverlar
instagram takipçi satın al
perde modelleri
ReplyDeletesms onay
Turkcell Mobil Ödeme Bozdurma
nftnasilalinir.com
Ankara Evden Eve Nakliyat
Trafik Sigortası
dedektor
Web sitesi kurmak
Aşk Kitapları
Eimple Labs born to prepare an industry ready workforce. As a product based company Eimple Labs ensures to inculcate the end to end live product development and management skills. We work in a university-industry partnership and implement a holistic knowledge-imparting model to prepare students for new-collar jobs in emerging industries.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeletedigital marketing at kochi
ReplyDeleteassessing the possibility of digital marketing
ReplyDeletethe institution offers a range of course,including certified digital marketing professional
ReplyDelete