If you’re like me you’ve setup numerous SharePoint 2010 test boxes in order to get comfortable with all the great new features. Because I’m running in a test environment I hadn’t been paying too much attention to the SQL server I was using. Yesterday I logged in and found a staggering number of similarly named databases which were no longer being used because the test boxes were done.

So how do you figure out which databases are which? There’s a great SharePoint Powershell cmdlet you can run on your SharePoint server that will give you a list of all the databases your server is using:

Get-SPDatabase | Sort-Object disksizerequired -desc | Format-Table Name

When you run the command, you’ll get a list of all the databases similar to the following:

Now that you have your list, log into SQL Server Management Studio and delete the corresponding databases:
Get-SPDatabase | Sort-Object disksizerequired -desc | Format-Table Name | out-file c:databases.txt

 

You can get the same information from Central Administration > Upgrade and Migration > Review database status.

 

http://imperfectit.blogspot.com/2010/05/list-all-sharepoint-2010-databases.html

Tags

Comments are closed