Forcefully delete site collection

Today I found a site collection on a customer environment which gave a completely blank page when you opened it via a browser. It didn’t gave a 404 (Not Found) error, it was just a blank page. I decided to figure out what was happening and found that during the creation of the site collection, an IISRESET had taken place. Because of this, the site wasn’t completely provisioned. Well, if it wasn’t completely provisioned, I don’t need it… Nobody could have added content.

I found out that I couldn’t remove the site using Central Administration. When you navigate to the site collection using the “Delete a site collection” page, the details (right hand site of the page) where not loaded and you cannot select the site collection. So… I wanted to delete the site using PowerShell, but this gave me an error:

Apparently, the normal remove-spsite cmdlet cannot delete a site collection which is not fully provisioned, and this cmdlet doesn’t have a force flag. To forcefully delete the site collection, I used the SPContentDatabase.ForceDeleteSite method:

Hi, I have same issue, attempted the above cmdlets and I still get an error msg ‘Failed to update database “xxxxx” because the database is read only.

background info:

1> the above was initiated as we have been observing critical level errors in the event log (event id 6398) with the message :”The Execute method of job definition Microsoft.SharePoint.Administration.SPAppInstallationJobDefinition (ID xxxxxxxxx) threw an exception. More information is included below.

Failed to update database “xxxxxx” because the database is read-only.”

2> We cannot see site collection details on the right in CA

3> Checked DB on SQL server it is not in read only mode

4> the site collection has got its own database
5> I cannot view the site in the browser but is listed in CA as a site collection and also in the list of content DB’s