Today I learned something that I actually haven’t put many thoughts on before and that actually came as a surprise to me. SharePoint handles the Delete of Content Databases differently depending on from where you do it. This might not be news for you but for a second I thought I had grown old and lost my memory of what I just been doing.

I was sitting in my Moss environment and had a couple of tasks in front of me where I should recreate a web application we had been using for test purposes. We now wanted to recreate it and start all over again. So what I did was that I first went in to the Central Administration, selected the Web Application and then Content Databases. I selected the Content DB and clicked Delete.

 deletecontentdb

I then recreated the Web Application with some changes in the setup from before, applied a couple of Solution Packages and then as a last step I should create a new Root Site Collection. This I did with STSADM. Then, when running the STSADM command I got an error message saying that there were already a site collection in the specified location. I double, triple and quadruple checked the syntax of my STSADM command, it was correct written. I then tried to surf to the site and for some reason there where what I just a couple of minutes earlier had deleted. It where somewhere here I started to lose faith on my memory, what did I just do? Have I could I have…

 

But as Dana Scully always said, -”There is always a logical explanation” and it certainly was this time as well. It turned out that If you delete the database from that Content Database list it just detaches the database and does not actually delete the database from the SQL server. But if you instead select delete Content Database when you delete the Web Application it’s deleted from the SQL Server. So what happened was that I recreated the Web Application I choose the same name for the Content DB as I just had used and the, not that surprisingly all content where still there.

 deletewebapp

Well, at least I learned something new, isn’t it wonderful with Mondays?



  1. Matt on Monday 11, 2009

    Another “surprising” artifact (possible caused by same) is orphaned SQL DBs. Orphaned MOSS sites is a known and documented concern, but orphaned DBs (how to reliably detect and remove) is a challenge.

    After a couple years on MOSS, the dev DB had over 15 content databases that weren’t talking to anyone. They had been associated with test sites later deleted from MOSS.



Subscribe without commenting