Advertisements

SharePoint Site Collection backup failed–site left locked.

Ran into an issue the other day. Was running a site collection backup from Central Administration, when it just flat out failed with a generic error. Didn’t think much of it, until a user could not add any data, nor see the Site Actions menu within a site under that site collection.

image

I started to investigate – all signs pointed to the content database being locked, but no matter where I looked, I was unable to find just where it was locked up.

First, in Central Administration, I checked to see the status of the site collection. This can be found under Application Management > Site Collections > Configure quotas and locks

image

The site collection was showing as "Not locked”.

Then, while in Central Admin, I checked to see if the database itself was locked. Under Application Management > Manage content databases
image

As you can see above – it was not Read-Only.

I then took a look at the database, seeing if it was set to single user, read-only, or if the database was not in ‘NORMAL’ state.

image

Everything looked fine here. I did some troubleshooting, and could not find the source of the problem. So, I threw out an #SPHelp request on twitter, and sure enough, twitter saves the day again. Sean McDonough (@spmcdonough) replied with the following suggestion.

image

This is the STSADM equivalent of setting the site collection lock status under Application Management > Site Collections > Configure quotas and locks which we first looked at. I set the database read-only. And then set it back to none, and everything was back and working again! Thanks Sean!

image

So, in closing, this post has two objectives to it. Number 1 is to show you where you can check/set lock statuses for site collections and content databases. And number 2, if you encounter the same issue I did, how to resolve it, so hopefully after a bit of searching if you run into this error, you can save some sweat and hair, and get your site collection back up and functional.

And then plan to perform the site collection backup off-hours, just in case 🙂

Microsoft.BusinessData.Runtime.ExceededLimitException: Database Connector has throttled the response.

If you’ve created a BCS list before (such as defined by the excellent tutorial put together by Laura Rogers for connecting to a SQL data source using a SQL account – http://www.sharepoint911.com/blogs/laura/Lists/Posts/Post.aspx?ID=90), and received this error on your Read List view page:

Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the problem persists, contact your Web server administrator.

Correlation ID:117e242f-0985-42e9-9972-b1a879ce7e3b

After investigating the ULS Logs, located in %SYSTEM DIR%\Program Files\Common Files\Microsoft Shared\web server extensions\14\LOGS, and searching for the correlation id mentioned above. You may find the following error:

Error while executing web part: Microsoft.BusinessData.Runtime.ExceededLimitException: Database Connector has throttled the response. The response from database contains more than ‘2000’ rows. The maximum number of rows that can be read through Database Connector is ‘2000’. The limit can be changed via the ‘Set-SPBusinessDataCatalogThrottleConfig’ cmdlet.     at Microsoft.SharePoint.BusinessData.SystemSpecific.Db.ThrottledIDataReader.Read()     at Microsoft.SharePoint.BusinessData.SystemSpecific.Db.DbEntityInstanceEnumerator.MoveNext()     at Microsoft.SharePoint.BusinessData.Runtime.EntityInstanceEnumeratorBase.MoveNext()     at Microsoft.SharePoint.SPListDataSource.GetFilteredEntityInstancesInternal(XmlDocument xdQueryView, Boolean fFormatDates, Boolean fUTCToLocal, String firstRowId, Bo…

Thanks to the wonders of the interwebs, the solution to this is fairly simple, and the error explanation is extremely helpful. Do a search for this: Set-SPBusinessDataCatalogThrottleConfig, which will lead you to a great article on the Microsoft Business Connectivity Services Team Blog by Adam Outcalt here: http://blogs.msdn.com/b/bcs/archive/2010/02/16/bcs-powershell-introduction-and-throttle-management.aspx which will give you very great instructions on modifying the BCS throttling configuration.

Be careful with this however, the throttling is there for a reason. Not just to give you another option to configure.

Using PowerShell (and SQL) to Copy Users from SharePoint 2007 to 2010

imagePowerShell is a neat tool. There. I said it. What, you already knew that? Oh well… I still think it’s cool. You may have guessed, that due to recent posts (and a few yet to be posted), focused around PowerShell, I’ve been using it quite a bit. Today’s post is on how to get users out of your 2007 environment, and into 2010, specifically around FBA users.

I’ve been working with a new client recently, and we are migrating a 2007 based internet site to a 2010 based internet site, which has lots of FBA users. Now, I will not name the tool directly, but, with a certain migration tool, I spent the past week jumping through a lot of hoops to migrate the users over to 2010. A LOT of hoops. And no matter what we attempted to do, we just couldn’t get the users populated into the new 2010 site.

So, I rolled up my sleeves today and managed to complete the task in a short while… here’s what I did.

First, on the 2007 server, let’s call it SQL07.company.com, I went into SQL, and performed the following query to get the list of site collections within the content database of the web application in question. Luckily, there was only one site collection, so there was not much of a list here, but, I did need to get the GUID of the site collection, so, I did this:

image

Now that I had the site collection GUID, it was time to extract the users so we could add them to our 2010 server, which was some simple SQL code to build up the strings necessary. Now, I could have written more complex code, but, this just needed to get done (the select query is wrapped to display it all here).

   1: SELECT 'New-SPUser -UserAlias "' 

   2:     + REPLACE(tp_Login, 'acaspnetsqlmembershipprovider:', 'i:0#.f|sql-membershipprovider|') 

   3:     + '" -Web http://internet -DisplayName "' 

   4:     + tp_Title + '" -Email "' 

   5:     + tp_Email + '"'

   6: FROM UserInfo 

   7: WHERE tp_SiteID = 'CB14D956-9DE3-4A32-BD0A-155E93A663AA'

   8: AND tp_Login LIKE 'acaspnetsqlmembershipprovider%'

More information on the New-SPUser cmdlet in SharePoint 2010 can be found here: http://technet.microsoft.com/en-us/library/ff607868.aspx

And I switched the results view to Text in the query window in SQL, copied and pasted that into a text file, with a .ps1 extension, and called it from my SharePoint 2010 Administration Console (PowerShell), and off went the quick addition of thousands of FBA users into our new environment!

Now, what you will see here is a simple replace mechanism as well, for swapping all acaspnetsqlmembershipprovider: prefixed FBA users, to the new claims based format in 2010, i:0#.f|sql-membershipprovider|. The AND clause in the above SQL statement also only searches for FBA users, and not users out of the AD domain.

If you need to figure out what your prefix should be, add an FBA user to your site, and have a look at their profile page, it should list a funky username, that looks like the above: i:0#.f|membershipprovidername|.

Simple. Easy. And extremely effective.

Calculating Site Collection Usage via SQL

I have been slow on the informational posts lately, sorry about that! Have had lots happening in the work world over the past few months, and have not been able to get much done in that arena, between SharePoint Saturday Boston, The SharePoint Technology Conference, Best Practices Conference, business development, the SharePoint Saturday Boston Webinar Series, the Boston Area SharePoint Users Group, writing chapters for a book, as well as client work (last, but certainly not least), my blog entries have become few and far between.

I also need to get my feedburner redirected from live spaces, and oh so much more…

However, I thought I would write a quick post! I use this quick SQL statement from time to time, and used it again today, and wanted to share it quickly with the few souls that actually read this blog 🙂

   1: SELECT FullUrl AS URL,(DiskUsed/1024) AS SiteCollectionUsedKB from Sites

 

Simple, but, it gets the job done. From your content database, running this query will return the URL of the site collection, as well as its storage allocation. Handy, and useful!

%d bloggers like this: