locked
re-attach wss_content_longhash contentdb for Sharepoint 3.0 application on Windows server 2003 RRS feed

  • Question

  • Hello,

    Could someone please outline a simple methodology to re-attach a content database to my web application.

     

    I am experiencing a problem with a Windows 2003 Server running Sharepoint 3.0 which I installed some months ago.

    The system partition has become fragmented and windows is unable to defragment a 1.4GB sharepoint log  file which is over 1400 fragments.

    There are two small applications set up on the site, a calendar list that users primarily connect to from outlook ( about 5 people do this) and an IT Helpdesk application installed from the free online template and which has some very moderate use (just me, about 20 or so entries).

     

    Yesterday I managed to move some of the mdf's and ldf's and re-attach them in the new location, a separate partition. Hurray! Unfortunately I couldn't do this with the biggest one as there is always something connected to it when I connect using Microsoft SQL Management Studio Express.

    Today because I couldn't detach the SharePoint_Config_decaf_longhash_log.ldf file I followed this instruction "On the Manage Content Database Settings page, in the Remove Content Database section, select the Remove content database check box, and then click OK.

    Note: Removing the content database does not delete the database; it only removes the association of the database with the Web application."

    Well, this will be easy I think to myself.   HOWEVER

    On adding it back, I don't have the option to add the original content db back again, only create a new one. This appears to be an omission of functionality from the Central Administration.

    I find it very difficult to believe I now have to create a new web application and then somehow swap the newly created db with the one I was using.

    There is just about enough information out there as this seems to have been encountered before for me to create a new web application and attach the original database back - I just need confirmation that that is what needs to be done.

    Thanks

     

     

     

     


    • Edited by Thegus541 Tuesday, October 11, 2011 11:55 AM
    Tuesday, October 11, 2011 11:52 AM

Answers

  • You have two options:

    1. reattach by specifying the existing content database name - sharepoint will detect this and attach the existing one rather than creating a new one
    2. use STSADM -o addcontentdb ... to reattach

    Cheers,
    Stefan


    Stefan Goßner
    Senior Escalation Engineer - Microsoft CSS
    This post is provided "AS IS" with no warrenties and confers no rights.
    • Marked as answer by Thegus541 Tuesday, October 11, 2011 2:55 PM
    Tuesday, October 11, 2011 1:02 PM

All replies

  • You have two options:

    1. reattach by specifying the existing content database name - sharepoint will detect this and attach the existing one rather than creating a new one
    2. use STSADM -o addcontentdb ... to reattach

    Cheers,
    Stefan


    Stefan Goßner
    Senior Escalation Engineer - Microsoft CSS
    This post is provided "AS IS" with no warrenties and confers no rights.
    • Marked as answer by Thegus541 Tuesday, October 11, 2011 2:55 PM
    Tuesday, October 11, 2011 1:02 PM
  • Thanks for the reply.

    I will try and unpick the sites, match the urls and try and addcontentdb to the correct ones.

    SQL studio is helpful in letting me see some of the contents of the sites e.g.

    SELECT DirName,TimeCreated FROM dbo.docs;

    It shows the importance of keeping all the details of the sites carefully documented.

    regards for now

     

    Tuesday, October 11, 2011 1:25 PM
  • phew! massive relief, the site came back up.

    There were actually 3 WSS_Content* databases, and I used the above sql to identify the one with the calendar and Ithelpdesk I didn't want to lose... turned out the ones with the long hash were sites I never completed, though they were valid sites and therefore still attached to the database and site.

    sites/sharepoint/Lists/Team Discussion  <date>

    sites/sharepoint/Lists/Tasks <date>

    sites/sharepoint/Lists/managersleave <date>

    sites/sharepoint/ithelpdesk/Lists/servicerequests <date>

    stsadm -o addcontentdb -url http://servername -databasename WSS_Content

    Operation completed successfully - there was an error saying it could timeout if I used Central Administration  so used the stsadm method. Not that scary after all.

    Cheers

    Thegus

    Tuesday, October 11, 2011 2:55 PM