Column
Weeding Out a Content Database in MOSS
How can I delete a content database in Microsoft Office SharePoint Server (MOSS) 2007?
by Zubair Alexander
10/27/2009 -- If you delete a Web application that has an associated content database, and you only deleted the Web application and not the associated database, you won't be able to reuse that name for the content database if you create a new Web application -- unless, that is, you first delete the content database.
You can create or remove a content database by either using the Central Administration in MOSS 2007 or by using the STSADM tool. For the former, in the GUI, go to the Application Management tab in Central Administration and then click on Content databases. There you can manage the content databases.
The second option -- which frankly I find quicker and much easier to use is to use -- is the command-line STSADM tool. Sometimes the GUI will prompt you to use the STSADM tool to delete the content database, in which case you have no option but to use STSADM. Here's how you can use STSADM to create or delete a content database in MOSS 2007.
When you go to the command prompt, by default STSADM will not be on your path. You might want to add the location of STSADM to your path to make things easier. The file is located in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN. Go to the Environment Variables and edit the path under System variables. If you already have a command prompt open, you need to close the window and open it again to make the new path take effect.
Let's assume you want to create a database called "WSS_Content_Intranet" and the SharePoint site is http://intranet:80. To create the database at the command prompt, use the following command:
stsadm.exe -o addcontentdb -url http://intranet:80 -databasename WSS_Content_Intranet
If you want to delete a content database, simply use the switch -deletecontentdb.
stsadm.exe -o deletecontentdb -url http://intranet:80 -databasename WSS_Content_Intranet
(By the way, note the space after "-databasename" in the above commands.)
Zubair Alexander, MCSE, MCT, MCSA and Microsoft MVP is the founder of SeattlePro Enterprises, an IT training and consulting business. His experience covers a wide range of spectrum: trainer, consultant, systems administrator, security architect, network engineer, author, technical editor, college instructor and public speaker. Zubair holds more than 25 technical certifications and Bachelor of Science degrees in Aeronautics & Astronautics Engineering, Mathematics and Computer Information Systems. His Web site, www.techgalaxy.net, is dedicated to technical resources for IT professionals. Zubair may be reached at .
|