Database not found error / Remove reference to unused database in SharePoint


When you create new service applications (Example Search application) to fix issues or for some other reasons , SharePoint has a tendency to retain list of  old databases reference in configuration database . These databases are no longer in use or are available on your database server but you will see errors in event logs which refer to database which no longer exist

Example of error message

Event ID: 3760

Event Description: SQL Database ‘Search_Application_AnalyticsReportingStoreDB_56910d48c8754b409912657ac35181fa’ on SQL Server instance “server.xyz.com” not found. Additional error information from SQL Server is included below.

 Cannot open database “Search_Application_AnalyticsReportingStoreDB_56910d48c8754b409912657ac35181fa” requested by the login. The login failed.

Login failed for user “xyz\farmaccount”.

 

Resolution :

To get rid of these errors , we need to remove the reference of the databases from configuration database by running below commands in SharePoint management shell from any server in the farm:

Get-SPDatabase | fl name,id

This will give you list of all the databases and their IDs. Note the ID of the database which you need to remove and run below command to delete it:

$db = Get-SPDatabase ID

$db.Delete()

 

 

Advertisements

About amritatalreja
I am working as a SharePoint Consultant in HCL America INC, Cary,NC.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: