CalSPUG Meeting – November 17, 2011
Another month means another CalSPUG meeting! (Web site should be up soon... sorry for the dead link.)
This meeting should be a good one - and a non-developer topic as well. However... most developers should be interested in this!
Title
Keep Your Portal Governance Simple!
Start Time
Doors open at 5:00pm. Presentation starts at 5:30pm.
*Note: Elevators up will lock at 6:00pm if you arrive late.
Presenter
Dan McCleary (@DanMcCleary)
Topic
Many people seem to dread the word governance. Dread of the amount of work involved. Dread of not knowing how to proceed. Dread of unnecessary bureaucracy. Unfortunately, this hesitance is what kills a lot of good portal governance planning. Yet, if some basic elements are put in place, a model can be built that can be understood by all portal users and is relatively easy to maintain.
Speaker Bio
Dan McCleary has worked in the internet industry for over 15 years holding many positions including designer, developer, project manager and instructor. Between 2006 and 2010 Dan held the position of Consulting Director at Ideaca, one of Canada's leading IT and Management Consulting companies, in charge of the consulting staff for their largest office. He has recently ventured back into the consulting world, focusing his efforts on portals, collaboration and social media. A goal of his management consulting approach is to provide clarity by striving for simplicity.
Food and drinks provided. SharePint location TBD.
Location & Registration
http://www.eventbrite.com/event/2484015758
Controlling Database Growth in SharePoint 2007
One of the many problems when developing for SharePoint 2007 is database growth. This can be especially troublesome when your production environment has caching and auditing enabled. Here are some tricks to dealing with the growth.
- Disable Auditing when restoring your production environment in a development environment. This is highly important as the content database can very quickly grow far beyond the capacity of your development server. This does have to be done on a per site collection basis and can be found at _layouts/AuditSettings.aspx in each.
- Dump the tempdb. This is most easily achieved by restarting the offending SQL service in SQL Management Studio.
- Convert the offending database recover mode to Simple.
- Set up a detail maintenance plan and make sure that a Shrink Databases operation is in that plan.
- Trim the audit log. This is done with the trimauditlog stsadm command. An example for its use is "stsadm -o trimauditlog -date 20110930 -url http://locahost:8080" Depending on how out of control the growth is, you may have to run this in small date ranges and then restart SQL after to dump the tempdb (suggestion 2).
- Dump the eventcache history. This suggestion deals directly with the DB which is a no-no in the Microsoft SharePoint world, however this is a development server and if things go sideways a new restore is a very valid option. Here are some queries to help out:
- Use this to figure out which tables are the largest (in terns of number of rows):
- Use this to figure out which event types in the eventcache table have the most occurrences:
- Use this to clear the offending event types from the eventcache table (source):
- Shrink the database files themselves. This can be done in SQL Management Stuido. Often it's best to set the space just slightly above the suggestion Management Studio gives you.
- Create a batch file that restarts the offending SQL service nightly. This will help manage the growth of your tempdb.
GO SELECT OBJECT_NAME(OBJECT_ID) TableName, st.row_count FROM sys.dm_db_partition_stats st WHERE index_id > 2 ORDER BY st.row_count DESC GO |
GO SELECT EventType, COUNT(*) as Total FROM [databasename].[dbo].[EventCache] GROUP BY EventType ORDER BY Total DESC GO |
GO While exists (SELECT TOP 1 * FROM eventcache where eventtype In(8192,8194,1048576) AND EventTime < DATEADD(day, -5, GETUTCDATE())) BEGIN DELETE eventcache FROM (SELECT TOP 100000 * FROM eventcache where eventtype In(8192,8194,1048576) AND EventTime < DATEADD(day, -5, GETUTCDATE()) ) AS e1 WHERE eventcache.id = e1.id End GO |
Hiding the ‘Category’ Text in a List View with a Group By
I recently had a request of me to hide the 'Category:' text on a List View web part in a MOSS 2007 farm. As I have now had this request a few times and each time have to go figure out how to do it again, I thought that meant it was time for a quick blog post! I found the original source here. It's a great write up, but there are a few enhancements mentioned in the comments that were never incorporated into the script code of the article. So here is the code with the changes incorporated:
<script type="text/javascript" language="javascript"> _spBodyOnLoadFunctionNames.push("HideHeaders"); function HideHeaders() { var elements = getElementsByClassName(document, "td", "ms-gb"); var elem; for(var i=0;i<elements.length;i++) { elem = elements[i]; elem.childNodes[3].style.display = "none"; elem.childNodes[4].nodeValue = elem.childNodes[4].nodeValue.replace(':', ''); } elements = getElementsByClassName(document, "td", "ms-gb2"); for(var i=0;i<elements.length;i++) { elem = elements[i]; elem.childNodes[3].style.display = "none"; elem.removeChild(elem.childNodes[4]); } elements = getElementsByClassName(document, "tr", "ms-viewheadertr"); for(var i=0;i<elements.length;i++) { elem = elements[i]; elem.style.display = "none"; } } /* Written by Jonathan Snook, http://www.snook.ca/jonathan Add-ons by Robert Nyman, http://www.robertnyman.com */ function getElementsByClassName(oElm, strTagName, strClassName) { var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName); var arrReturnElements = new Array(); strClassName = strClassName.replace(/\-/g, "\\-"); var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)"); var oElement; for(var i=0; i<arrElements.length; i++) { oElement = arrElements[i]; if(oRegExp.test(oElement.className)){ arrReturnElements.push(oElement); } } return (arrReturnElements) } </script> |
The site collection could not be restored…sufficient free space
Recently I came across the dreaded error below while restoring a production backup into a development / test environment using stsadm.exe -o restore.
"The site collection could not be restored. If this problem persists, please make sure the content databases are available and have sufficient free space."
First a bit of background on the backup package: it was a measly 1.34GB in total size. Not even what I would consider to be medium when it comes to SharePoint site collections. The target environment was 3 servers with one dedicated SQL server (running SQL Server 2008 R2), an app server and WFE (MOSS 2007 build 12.0.0.6529). Database storage volume on the SQL server was 100GB with 80GB free. I thought this should be plenty.
So, when I first ran across the above error I did the simple things:
- Checked the hard disk space on the SQL server - all volumes
- Verified that the target content database was available
- Checked the hard disk space on the remainder of the farm servers
When none of those proved fruitful I did what all SharePoint folks do - consulted Google! I found many interesting suggestions, some of which probably work(ed) in other situations, but failed for me:
- I found stopping / restarting Windows SharePoint Services Timer service & iisreset here
- The not-so-helpful KB926061 article
- Monitoring various disks for growth during the restore from here and this prompted me to look into disk I/O which was ultimately the cause
After watching all my disks (on db, app, and wfe), I decided to start looking into disk I/O on the SQL box. I noted that it was high, with an average disk queue length running around 70, I decided to flip on SQL profiler to watch for errors. Low and behold: Error: 1222, Severity: 16, State: 18 - Database Deadlocks!! And lots of them right before stsadm threw that dreaded error.
Solving the problem was a bit more tricky. My SQL server is virtualized - definitely not recommended for production, but this also wasn't production with a quarterly user load of about 10. Very difficult to justify a physical box. So, I started shutting down services that would be accessing the DB server during the restore - in particular: search! After that and consolidating the mdb files (there were three because of how production is set up) I was able to complete a restore for the first time in months!
Now on to handing this environment to a db admin to do some performance tuning and to the virtual server team to see if we can find a faster disk for the database drive!
Unable to Compact a VHD Due to a File System Limitation
While trying to compact a vhd that had been (unbeknownst to me) generating huge quantities of log files I recently ran across the rather strange "Unable to Compact a VHD Due to a File System Limitation" error:
I found a couple things to try thanks to Google:
- vssadmin delete shadows /all
- KB982210
CalSPUG Meeting – April 22, 2010
Once again - a long time since I have posted. Perhaps I should just end trying to post at a pre-defined frequency and aim for something a bit more natural?
At lot has changed for me of the last several months, especially since starting this blog. One of those things in particular was my decision to move to Calgary, Alberta, Canada. I was previously living in Toronto, Ontario, Canada - and had been for 4 years - but decided it was time to try out a new city. So, I transferred with Ideaca and have taken up residence in the heart of Calgary.
With some of the time I have saved commuting around the Toronto area, I have joined CalSPUG (Calgary SharePoint User Group - www.calspug.org). I must admit, it's very rewarding becoming more involved with the SharePoint community as a whole - but especially on the eve of the release of SharePoint 2010. As such, I would like to highlight, for those in the Calgary area, that we're having our next meeting on April 22, 2010. Jason Kaczor is our presenter and the topic is Use SharePoint 2010 and Visual Studio 2010 to boost Productivity. The meeting will begin sharply at 5:30 PM MDT with a SharePint to follow at the James Joyce (map) at approximately 8:30 PM MDT. Anyone is welcome. It's completely free of charge and pizza and beverages are provided. Registration is available here.
For those of you whom are unable to attend Thursday evening's presentation. Jason will also be presenting this topic on April 19, 2010 at 8:30 AM MDT (breakfast provided) as part of Microsoft's DevTech Breakfast and User Group tour.
Happy SharePointing!
Using JQuery to "Hide" Empty Divs
So, I thought it was about time for me to start blogging again. So much for weekly. I will shoot for monthly this time!
Anyway, here's today scenario:
I have a page layout with several fields (plain text or rich html) exposed. The template is meant to be used for corporate policies which can be very long with many sections or very short with one section and anywhere in between. What I needed to do was remove the from child divs that only contained that in the html.
Solution:
With the use of some jquery and a bit of trial and error the code below will do exactly what I wanted. When the page is rendered the empty lines are removed. When the page is edited all the field controls are still shown accordingly.
$(document).ready(function() { <span> </span> $('.<divclassgoeshere>').each(function() { var value=$(this).children(":first").html().toLowerCase(); if(value=='&nbsp; ') { $(this).remove(); } }); }); |
Enjoy!
Welcome To My Blog
Hi everyone and welcome to my blog! This is actually my very first blog post ever – on any topic!
Just a little bit about me: I am a SharePoint consultant (Business Analyst by title) with Ideaca Knowledge Services based in Toronto, Canada. I have been actively working with SharePoint for three years now and have been specializing more in the developmental and architectural aspects of SharePoint. In a previous life I worked both with SAP and Microsoft Exchange. In my spare time (yes – I have figured out how to have a life outside of SharePoint – only took 3 years!!) I read, have started to get myself back into decent shape, and intend to spend a significant amount of time outside this summer.
In this blog I intend to cover various aspects of SharePoint with more of a focus towards development. I also plan to post solutions to questions I am asked over the course of my projects (and outside of them), so feel free to email me (gregc at spinsiders dot com) and I’ll do my best to respond. I have a very ambitious goal of posting something at least once a week, so check back often!
If you are less interested in the technical aspects of SharePoint and more interested in the methods that could be employed to gather the requirements for a SharePoint implementation, take a look at my friend & colleague Ruven Gotz’ blog at http://spinsiders.com/ruveng. He has some excellent articles on answering the SharePoint chicken & egg question and how to run the workshops to get to that answer.
