Monthly Archives: January 2014

Delete un-used Shaepoint 2010/2013 database

During a Sharepoint 2013 Serach database rename I have made some mistakes and Sharepoint don’t have deleted the “old” SearchApplicationDB.
In the Event viewer I see the error : Unable to connect to the “Search_Service_ApplicationDB”. It’s correct: the database was renamed and deleted from SQL Server. Sharepoint server search work fine and use the SearchService_ApplicationDB.
Inside the Sharepoint Management Shell I run the command Get-SPDatabase and I see listed the new..and the old search server database.

How I can delete unused database?

Open powershell and run the command “Get-SPDatabase | Select Name, Id, Type” so I see the list of all my Sharepoint database
Get-SPDatabase
Choose the database to be deleted:
MarkDatabaseId
And the delete it with the two command:
$db = Get-SPDatabase
$db.Delete()
DeleteDatabase
Weel done!