Sharepoint 2010 Service Application Database Trying To Connect To Different Database ID – Cannot complete this action as the Secure Store Shared Service is not responding
By peter.stilgoe
Had a strange problem when creating a new Secure Store Service Application, the wizard would complete but when you click ‘manage’ you would get an error saying –
‘Cannot complete this action as the Secure Store Shared Service is not responding. Please contact your administrator’
After looking at the event logs it was failing with an error:
Cannot open database “Secure_Store_Service_DB_edb5686a-ff41-4457-903a-4ff09xxxxxx” requested by the login. The login failed. Login failed for user ‘XXXXXXX\FarmAcct’.
After lots of head scratching I notice that the db the Secure Store Service App wizard was creating in Central Admin was a different database to the one giving the connection error in my event viewer.
I tried to create a new service app & renamed the DB to the name that it was trying to connect to but I would then get an error message saying this database already existed, even though it didnt exist in SQL Management Studio.
It was trying to connect to an orphaned secure store service DB which must have been created at an earlier time, which I verified by looking here:
http://CentralAdminURL/_admin/DatabaseStatus.aspx
To cut a long story short you can use this powershell script to remove any orphaned Sharepoint 2010 Service Application databases
$snapin = Get-PSSnapin | Where-Object {$_.Name -eq
'Microsoft.SharePoint.Powershell'}
if ($snapin -eq $null) {
Write-Host "Loading SharePoint Powershell Snapin"
Add-PSSnapin "Microsoft.SharePoint.Powershell"
}
Get-SPDatabase | Where{$_.Exists -eq $false} | ForEach {$_.Delete()}
I found the script at http://www.sharepointusecases.com/index.php/2010/12/how-to-remove-renamed-sharepoint-2010-service-app-databases/
More From pstilgoe
Powershell , Secure Store Service , Sharepoint 2010 , Sharepoint Service Applications 


January 20th, 2011

Hi.
Thanks for the tip – however, when I try to delete an orphand database, I get an error that the object could not be deleted because other objects depend on it…. It gives me a GUID, but I can’t refer this GUID to anything usefull. Would you have any hints or direction on where I could find help on this?
Thanks!
[Reply]
peter.stilgoe Reply:
August 9th, 2011 at 5:59 pm
Hi,
Try this post http://www.zimmergren.net/archive/2010/09/03/sp-2010-find-error-messages-with-a-correlation-id-token-in-sharepoint-2010.aspx
[Reply]
Peter,
Thanks for this post. Following the steps and the script worked great!
[Reply]
Thanks! Worked exactly as described!
[Reply]