Alexander’s Blog

September 22, 2008

How to Create or Delete a Content Database in MOSS 2007 Using STSADM

by @ 5:06 pm. Filed under SharePoint, Tips & Tricks

You can create or remove a content database either using the Central Administration in Microsoft Office SharePoint Server (MOSS) 2007 or by using the STSADM tool. In the GUI you need to go to the Application Management tab in Central Administration and then click on Content databases. There you can manage the content databases. A second option is to use the command-line STSADM tool. Frankly, I find STSADM to be quicker and much easier to use. 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, there is a space after “-databasename” in the above commands.

Leave a Reply

*

Comment spam protected by SpamBam

Spam Protection by WP-SpamFree

Contact E-mail | Terms of Use | Privacy Policy

Copyright ©2002-2013 Zubair Alexander. All rights reserved.

Internal Links

Search Blog

Categories

Archives

July 2014
M T W T F S S
« Jun    
 123456
78910111213
14151617181920
21222324252627
28293031  

RSS Feeds

TechGalaxy Visitors

29 queries. 0.811 seconds