I ran into an issue where some databases that were deleted out of SQL were still showing up in SharePoint. You can find them in http://[Central Admin URL]/_admin/DatabaseStatus.aspx.
These were causing errors in the SQL logs because SharePoint was trying to open databases that didn't exist
To delete these orphaned databases, I ran two commands.
List the orphaned databases:
Get-SPDatabase | Where{$_.Exists -eq $false}
Delete the orphaned databases:
Get-SPDatabase | Where{$_.Exists -eq $false} | ForEach{$_.Delete()}
When I was done, I ran the list orphaned databases powershell command again to ensure that the databases were deleted.
When I refreshed the Database Upgrade status window in Central Admin, the databases were gone.
- Home
- Identity, Security, Access
- _Active Directory
- _BitLocker
- _Group Policy
- _SSL Certificates
- Endpoint Management
- _DNS
- _SCCM
- _SCSM
- _Windows
- _Windows Server
- Data, Messaging
- _Exchange
- _SQL Server
- _DocLink
- M365
- _Bookings
- _ClipChamp
- _Engage
- _Forms
- _Lists
- _Loop
- _M365
- _OneDrive
- _OneNote
- _Outlook
- _SharePoint
- _Teams
- _To Do
- _Visio
- _Viva
- _Whiteboard
- Development
- _Javascript
- _Power Apps
- _Power Automate
- _Power BI
- _PowerShell
- Artificial Intelligence
- _AI
- _Copilot

