How do I match database GUID's to the site they belong to?
-
Friday, August 03, 2012 2:38 PM
We have this problem where we have one database serving multiple SP 2010 sites and servers. When these sites were setup, the default naming convention produced database names with GUID's, like this.
Search_Service_Application_CrawlStoreDB_2cffb28cc2bc48d2b3a91d70e94da5c0
I now need to somehow match all of these DB's to which SP site they belong.
Although I've found several commands to get other information like..
Get-SPServiceApplicationPool | select Id, Name
and
appcmd list wp
I'm not having any luck matching the DB to the site.
Any help is greatly appreciated
All Replies
-
Friday, August 03, 2012 3:04 PM
hello,
An easier and quicker option would be to run the http://spsfarmreport.codeplex.com . this will give you a list of which all content databases are linked/attached to which web applications and how many site collections are present in it along with much more details in an easy to understand and interpret format. it is a simple executable that creates s simple html file report with all this data. If using powershell is a must then I would say use the get-spcontentdatabase cmdlet. (http://technet.microsoft.com/en-us/library/ff607828.aspx)
- Proposed As Answer by Chetan Shedge Friday, August 03, 2012 3:04 PM
-
Friday, August 03, 2012 3:52 PM
If you want to know which database belongs to wich farm you can use Powershell.
You can use the following cmdlet to get all database related to a farm and save the output in text file
(Get-SPDatabase).Name | Out-File C:\temp\database.txt
If you want to know which content database belongs to each web application you can use the following:
Get-SPWebApplication -IncludeCentralAdministration | Get-SPSite -Limit All | ForEach-Object{ $site = $_.url $db = Get-SPContentDatabase -Site $site Write-Host $site $db }Cheers
Riccardo -
Friday, August 03, 2012 6:35 PMActually, i've been able to match the DB's with which server is using them. I need to be able to match each to to each application (site) that's using it. Will either of these get me that?
-
Monday, August 06, 2012 7:59 AM
With the second script you'll get a list of each site collection and their corresponding content database.
Cheers
Riccardo- Marked As Answer by Rock Wang– MSFT Friday, August 10, 2012 7:39 AM

