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.
- Blogger Comment
Subscribe to:
Post Comments
(
Atom
)
Category
- Active Directory ( 8 )
- App Packaging ( 6 )
- BitLocker ( 9 )
- CrashPlan ( 7 )
- DNS ( 1 )
- DocLink ( 2 )
- Excel ( 3 )
- Exchange ( 7 )
- Group Policy ( 2 )
- Javascript ( 1 )
- M365 ( 5 )
- OneDrive ( 1 )
- OneNote ( 1 )
- Power Apps ( 1 )
- Power Automate ( 1 )
- Power BI ( 11 )
- PowerShell ( 54 )
- SCCM ( 28 )
- SCCM Device Collections ( 12 )
- SCCM Reports ( 12 )
- SCCM User Collection ( 2 )
- SCSM ( 4 )
- SharePoint ( 52 )
- SharePoint Design ( 20 )
- Skype for Business ( 1 )
- SQL Server ( 3 )
- SSL Certificates ( 3 )
- Teams ( 6 )
- Windows 10 ( 3 )
- Windows 7 ( 4 )
- Windows Server ( 5 )
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.