Skip to main content

SharePoint 2010 Foundation Event Viewer errors refer to old GUID database names

After going through the steps of removing GUIDs from the default SharePoint 2010 databases, I noticed a whole lot of Event Log critical errors listed against the SharePoint Foundation source column. Specifically, these errors would refer to the old database name of the Content DB for Central Admin.



The Event log errors would look something like this:

SQL Database 'SharePoint_AdminContent_28d23664-bca8-4408-99dc-12fe65cd3f96' on SQL Server instance 'xxx' not found. Additional error information from SQL Server is included below.


Cannot open database "SharePoint_AdminContent_28d23664-bca8-4408-99dc-12fe65cd3f96" requested by the login. The login failed.

Login failed for user 'yyy'.


After performing the steps (e.g. what's listed in this blog post by Dirk Van den Berghe) to change the Central Admin's content db name (aka. SharePoint_AdminContent_[guid]), there seems to be a missing step. After moving the content around and perhaps (if you're brave) deleting the original guid-laden database from your SQL server, there remains references to the original guid-laden name in SharePoint 2010's configuration.



I did some digging around in the Config database itself - I know from previous experience and various articles and blog posts around the web that its a very bad idea to start modifying data in the DB itself, however there is no harm in having a peek inside, to see if we can make sense of the environment.



The most obvious table in the Config db is named [Objects]. Performing a SQL query against this table can show whether there's a reference to the original "AdminContent" db there:



SELECT * FROM [Objects] WHERE Name LIKE '%SharePoint_AdminContent_28d23664-bca8-4408-99dc-12fe65cd3f96%'


And - indeed there is.



To resolve this issue, you can run the Remove-SPContentDatabase Powershell command. In order to run it, you need the internal SharePoint GUID reference for the ContentDatabase. Luckily, this is the same GUID found in the Id column of the [Objects] table in your config db.



The Remove-SPContentDatabase powershell command works even if the database no longer exists or is accessible from the SQL server - it simply plows on through the removal of the reference.



It's worth noting that other blog posts that discuss the removal of GUIDs from the AdminContent DB's name actually do specify that you should perform the Remove-SPContentDatabase powershell command. For example, this post by Todd Klindt. The difference is subtle, but important, particular if like me you like your SharePoint environment to be as clean as possible.

Comments

  1. Further to the above, it seems the method to rename DBs as blogged about in so many places, and even documented by Microsoft itself, actually leaves a number of orphaned databases in the SharePoint Config.

    After performing all that DB renaming work, it's a good idea to run the following powershell script to remove these orphaned DB entries:

    Get-SPDatabase | Where{$_.Exists -eq $false} | ForEach {$_.Delete()}

    You can also check for orphaned DB names via Central Admin, at the following web address:

    http://[centraladminhost]/_admin/DatabaseStatus.aspx

    ReplyDelete

Post a Comment

Popular posts from this blog

Thoughts, shortcomings, gotchas on SPFx Dynamic Data capabilities

It's the festive break, and I thought I'd try the new Dynamic Data capabilities that recently went to General Availability in SharePoint Framework 1.7.

I've been building a lot of React components lately, and all the SPFx web parts and application customisers with visual elements we create at Engage Squared, are built on React.  Dynamic Data in SPFx introduces a whole new world of modularity that we haven't had before. We can now split up the page elements into multiple web parts that, in the past, have been combined as one web part so state can be passed between them.  Doing this gives control back to the page author, with the ability to position components how they wish.

Breaking components up in to individual web parts also changes the way the components are designed, and forces the developer to leverage the responsive capabilities of modern pages.  Modern pages are designed from the ground up to work on many different screen sizes, and as long as each individual co…

Apps for SharePoint 2013 - Client and Server-side code

It's about time I blew the dust off this blog. Tonight I did a presentation at the Melbourne SharePoint User Group entitled Apps For SharePoint (2013). It included two demos based on the App For SharePoint 2013 solution template in Visual Studio 2012.

The two demos illustrated how you can create a separate ASP.Net Web Application. Demo 1 showed how easy it is to hook in to SharePoint to obtain List properties via server-side code (populating an ASP.Net Repeater Control). Demo 2 showed what you can do with SharePoint 2013's Javascript hooks. Specifically, using SP.UI.Controls.js from the /_layouts/15/ SharePoint folder to pull chrome elements out of SharePoint, and render them in your ASP.Net web app.

No animals were harmed in the making of these demos, but a few articles kindly provided on the Microsoft MSDN site helped put it together:
How to: Set up an on-premises development environment for apps for SharePointHow to: Create high-trust apps for SharePoint 2013 using the se…

SharePoint "Like" button

Ever wondered what the users of your Intranet really like or don't like? Ever wanted your SharePoint 2007 site to be more "web 2.0"-ey? Well I've published this quick and dirty codeplex project that allows the addition of a "Like" button the any SharePoint List item page.
The project is available as a WSP, and source code.
It consists of two things - a Web Part that is the button that users click to "Like" or "Unlike" something, and a List Template that can be used to create a list to store who "Likes" an item.
The button has two ways of operating. If it finds a list that was built on the List Template included in the WSP, it allows each user to Like or Unlike an item as they see fit. The button uses the List it found to keep track of who likes a given item, and queries the list when it renders to determine which option should be presented. Along with the button, the web part also displays a brief message explaining how many pe…