PowerPivot for SharePoint – Orphaned record for PowerPivot service application database

You may see the following error in Windows Event Viewer or the SharePoint ULS logs:

Cannot open database "<Database name of PowerPivot Service application>" requested by the login. The login failed. Login failed for user '<username>'.

This is an indication of an orphaned record regarding the PowerPivot service application database in SharePoint. This may happen after deleting a PowerPivot service application. The records for the deleted PowerPivot service application database are sometimes not removed from the the SharePoint configuration database, so SharePoint  throws an error when it cannot open the PowerPivot service application database since it no longer exists.

The solution to this is to remove these orphaned records. Open the SharePoint Management Shell on a SharePoint server and run the following command:

Get-SPDatabase | where {$_.exists -eq $false}

This will display a list of the databases that no longer exist on the SharePoint database server. The PowerPivot database referenced in the error above should show up in this list. After confirming this, you may remove the orphaned record by running this command:

Get-SPDatabase | where {$_.exists -eq $false} | foreach {$_.delete()}

At this point, the orphaned record pointing to the old PowerPivot service application database will be removed, and the error that you noticed earlier will stop occurring.

Skip to main content