Microsoft Knowledge Base Email Alertz

(926961) - Describes a scenario in which you receive an error message when you use SharePoint 3.0 Central Administration to re-add a content database.

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 926961 - Last Review: May 14, 2007 - Revision: 1.2

Error message when you use SharePoint 3.0 Central Administration to try to re-add a content database in Windows SharePoint Services 3.0

SYMPTOMS

Consider the following scenario. You deploy Microsoft Windows SharePoint Services 3.0 on a single server by using a stand-alone installation. You use SharePoint 3.0 Central Administration to remove the content database. However, when you try to re-add the content database, you receive one of the following error messages:
Database state cannot be changed while other users are using the database 'DatabaseName' ALTER DATABASE statement failed.
sp_dboption command failed.
Attaching this database requires upgrade, which could time out the browser session. You must use the STSADM command 'addcontentdb' to attach this database.
Unknown Error
Note In a stand-alone installation, the Setup program automatically installs and configures Microsoft Windows Internal Database. The Setup program uses Microsoft Windows Internal Database to create the configuration database and the content database. By default, the name of the content database is WSS_Content.

CAUSE

This issue occurs if the connection pool contains a connection to the content database that was not closed.

WORKAROUND

To work around this issue, use the Stsadm.exe command-line tool with the addcontentdb operation to re-add the content database. Then, restart the SQL Server 2005 Embedded Edition service. To do this, follow these steps:
  1. Use the Stsadm.exe command-line tool with the addcontentdb operation to re-add the content database. To do this, follow these steps:
    1. Click Start, click Run, type cmd in the Open box, and then click OK.
    2. Type the following lines at the command prompt. Press ENTER after each line:
      cd /d %commonprogramfiles%\Microsoft Shared\Web Server Extensions\12\Bin
      stsadm -o addcontentdb -url URL -databasename DatabaseName
    3. Type exit to close the command prompt.
  2. Restart the SQL Server 2005 Embedded Edition service. To do this, follow these steps:
    1. Click Start, point to Administrative Tools, and then click Services.
    2. In the list of services, right-click SQL Server 2005 Embedded Edition, and then click Stop.
    3. Right-click SQL Server 2005 Embedded Edition, and then click Start.

MORE INFORMATION

The syntax for the Stsadm.exe command-line tool with the addcontentdb operation is listed as follows:

stsadm.exe -o addcontentdb -url URL -databasename DatabaseName [-databaseserver DatabaseServerName] [-databaseuser UserName] [-databasepassword Password] [-sitewarning SiteWarning] [-sitemax SiteMaxCount]

Note The -url and -databasename parameters are required. The other parameters are optional.

APPLIES TO
  • Microsoft Windows SharePoint Services 3.0
Keywords: 
kbtshoot kberrmsg kbexpertiseinter kbprb KB926961
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

Razarr - razarr69 NOSPAM-AT-NOSPAM msn.com Report As Irrelevant  
Written: 9/5/2008 9:34 PM
I tried this with our system and got another response using stsadm -o addcontentdb "<DB name> on <servername> contains user-defined schema. Databases must be empty before they can be used. Delete all of the tables, stored procedures and other objects or use a different database." Any help would be greatly appreciated.

Andrew Report As Irrelevant  
Written: 1/25/2010 9:18 AM
Delete all of the tables, stored procedures ... this is not a workaround!