SharePoint: Multiple databases for 1 Web Application

This process makes assumptions that the SharePoint environment is in a very exact state. Specifically that:
• All databases other the one currently being used for new MySites are in an offline state and that there is only ever one Web Application available.
• There is a defined business need for a series of smaller databases rather than one large and potentially unwieldy one.

When a database in SharePoint is in an offline state it is not in an inaccessible mode but rather it is not viewed as a tenable location by the process that creates new site collections. Instead SharePoint will look at the delta on the current number of sites value versus the set maximum in any and all other open Content Databases and select the one with the greatest value.

To set a content database status to offline:
1. Go to “Central Administration > Application Management > Content Databases”
2. Then click on the database of your choice set it to “Offline”

To create a new database for every new site collection the following steps need be followed.
1. Create a new content database.
a. Start the SharePoint Central Administration Web site.
b. On the Application Management page, in the SharePoint Web Application Management section, click Content databases.
c. On the Manage Content Databases page, click Add a content database.
d. On the Add Content Database page:
e. Select a Web application for the new database.
f. Select a database server to host the new database.
g. Specify the authentication method the new database will use and supply an account name and password if necessary.
h. Specify both the total number of top-level sites that can be created in the database and the number at which a warning will be issued.
i. Click OK.
2. Create the new Site Collection.
3. Set the newly created content database status to Offline.
4. View the contents of the new content database to confirm that it only contains what it should. (In theory a new My Site could be in there.)

It is important to confirm that this new database is appropriately accounted for by backup and DBA maintenance routines.

If a site collection was errantly created during the period that the new content database was online it can be moved as follows:

1. Run the following stsadm command, to get a list of all the sites in the web application

Stsadm -o enumsites -url <URL> > <path/file name>.xml

Where:
• <URL> is the address of the Web application that contains the site collection that you want to move,and
• <path/file name> is the name of the XML file that you want to create with the site collection data.

(Example: stsadm -o enumsites -url http://localhost > c:Sites.XML)

Open the XML file that you created in a text editing application. If there are any URLs for site collections that you do not want to move, be sure to delete them from the file. The only URLs that should remain in the XML file should be for the site collections that you want to move.

Note: There is no need to change the site count or any of the other site collection information in the file. Only the URLs are relevant to this procedure.

2. Run the following stsadm command:
Stsadm -o mergecontentdbs -url <URL> -sourcedatabasename <database name> -destinationdatabasename <destination database name> -operation 3 -filename <file name>

Where:
• <URL> is the address of the Web application that contains the site collection that you want;
• <database name> is the name of the database that you want to move the site collection from; and
• <destination database name> is the name of the database that you want to move the site collection to;
• operation 3 is the “Read from file” operation; and
• <file name> is the name of the file that you created in step 4.

(Example: stsadm -o mergecontentdbs -url http://localhost -sourcedatabasename WSS_Content -destinationdatabasename WSS_Content2 -operation 3 -filename c:Sites.xml)

Note: This step assumes that all of the sites in the Sites.xml file where in the source database name. If the sites are located in multiple databases you may need to repeat these steps for each source Content Database.

3. Restart IIS by typing the following command, and then pressing ENTER: iisreset /noforce.

How to: Hide the “View All Site Content” link in MOSS

You can hide this particular link from all but those users with full control over a WSS site rather easily.

  • Open the site master page in SharePoint Designer and find the SPSecurityTrimmedControl element.
  • The PermissionsString attribute of the SPSecurityTrimmedControl element determines what users can view this content. Change the value of this attribute to ManageWeb and only those users with rights to perform all admin tasks on the site will then be able to see the link on all pages in the site.
  • Save and reload!

The value of distributed computing: The return of Markov chain Monte Carlo methods

A while back I wrote something on doing Monte Carlo simulations with Web Services and SharePoint. Halfway through I mentioned that Google Pagerank was defined by a Markov chain which in turn was an output of a process called Markov chain Monte Carlo methods. Not that it concerned me but only one person mentioned this, and at that it was a vague mentioning. Huh…

This actually is a big deal. In fact a very big deal. A multi billion dollar deal in fact, as in the case of Google PageRank. Distributed computing has the power to help us solve many things if applied correctly. The “cloud” does not. (A topic for later.) Probably the greatest hurdle in getting people back on track is that this technology has use beyond the scope of most peoples daily lives. For example…

A paper was published in PLoS last week, September 4th 2009, called “Can an Eigenvector Measure Species’ Importance for Coextinctions?” In it the authors state that “PageRank” can be applied to the study of food webs. Food webs are the complex networks of who eats whom in an ecosystem.Typically we’re at the top, unless Hollywood or very bad planning is involved. Essentially, the scientists are saying that their particular version of PageRank could be a simple way of working out which extinctions would lead to ecosystem collapse. A relatively handy thing to have these days… As every species is embedded in a complex network of relationships with others, even a single extinction can rapidly cascade into the loss of seemingly unrelated species. Investigating when this might happen using more conventional methods is complicated as even in simple ecosystems, the number of combinations exceeds the number of atoms in the universe… E.g. a typical lottery which has 8 numbers that can range between 1 and 50 has 39,062,500,000,000 different combinations…

The researchers had to tweak PageRank to it to adapt it for their ecology focused purposes.

“First of all we had to reverse the definition of the algorithm.” “In PageRank, a web page is important if important pages point to it. In our approach a species is important if it points to important species.”

They also tested against algorithms that were already in use in computational biology to find a solution to the same problem. PageRank, in its adjusted form, gave them exactly the same solution as these much more complicated algorithms.

With the right design SharePoint can be an extremely useful, and totally appropriate, interface for accessing and disseminating the inputs and outputs of such an effort. It can store and present this data with all of the requisite benefits one would expect from a collaborative platform. Certainly there’s a world of work involved in doing something like this but the key point is that the right tool for the right job mantra works here. “All” you need is:

  • IIS
  • .NET
  • SharePoint
  • PowerShell
  • Visual Studio
  • SQL
  • Skill

How to: turn the left navigation in SharePoint into an accordion style one

Add this code to your master page. Add the Google JS to a local address if you don’t want to keep making remote calls. I’ve edited the code so that it will render on the page by changing:

  • “<" - "< "
  • “>” – ” >”

< type="text/javascript" src="http://www.google.com/jsapi">< /script >
< type="text/javascript">
// Load jQuery
google.load(“jquery”, “1.2.6”);
< /script >
< type="text/javascript">
$(function(){
//initialize menus
var menuRows = $(“[id$=’QuickLaunchMenu’] > tbody > tr”);
var menuHd = menuRows.filter(“[id!=”]:has(+tr[id=”])”);
//set img path for when submenu is hidden
var closedImg = “/_layouts/images/Menu1.gif”;
//set img path for when submenu is visible
var openedImg = “/_layouts/images/ptclose.gif”;
var cssInit = {
“background-image”: “url(‘”+closedImg+”‘)”,
“background-repeat”: “no-repeat”,
“background-position”: “100% 50%”
}
var cssClosed = {“background-image”: “url(‘”+closedImg+”‘)”}
var cssOpen = {“background-image”: “url(‘”+openedImg+”‘)”}
//hide submenus
menuRows.filter(“[id=”]”).hide();
//apply initial inline style to menu headers
menuHd.find(“td:last”).css(cssInit);
menuHd.click(function () {
var styleElm = $(this).find(“td:last”)
var nextTR = $(this).next(“tr[id=”]”);
if (nextTR.is(‘:visible’)) {
nextTR.hide();
styleElm.css(cssClosed);
} else {
nextTR.show();
styleElm.css(cssOpen);
}
});
});
< /script >


Exam 70-542: Study recommendations

Subject Link
Excel Services http://msdn2.microsoft.com/en-us/library/ms519581.aspx
Search No special recommendation. I had taken a class on search earlier this year and real-world experience carried me through. Work with the “search center” component of MOSS.
BDC http://msdn2.microsoft.com/en-us/library/ms563661.aspx
Audiences http://msdn2.microsoft.com/en-us/library/ms496822.aspx
Profiles http://msdn2.microsoft.com/en-us/library/ms496822.aspx
Content Mgmt http://www.sharepointblogs.com/tonstegeman/archive/2007/02/01/moss-custom-policies-part-1-creating-a-custom-information-management-policy.aspx

http://blogs.msdn.com/ecm/archive/2007/03/04/customize-the-page-editing-toolbar-in-moss-2007.aspx

http://msdn2.microsoft.com/en-us/library/aa674506.aspx

BI Hands-on working with KPI’s in MOSS.
Workflow http://msdn2.microsoft.com/en-us/library/aa830816.aspx
Info mgmt http://msdn2.microsoft.com/en-us/library/bb397403.aspx
Variations http://aspnetcoe.wordpress.com/2007/02/09/customize-variation-root-landing-logic/
Records mgmt http://blogs.msdn.com/recman/archive/2006/06/16/633393.aspx
Infopath http://msdn.microsoft.com/msdnmag/issues/06/08/infopath2007/default.aspx

Charting Data: Keeping it simple.

I see a lot on charting data in SharePoint, and out.

In my opinion it boils down to three things

  1. what have you got
  2. how did you get it
  3. how are you going to show it

The first two are data related and require some questions.

  • Is it flat data that can “just be charted”?
  • If not, what needs to be done?
  • Is it interactive?
  • If it is, in what way?
  • etc

The third can get complicated as it can delve into what one can only call, the aesthetics of the situation. Some people love pie charts with garish colours. Others simply cannot understand radar charts. One product that works very nicely, has lots of options, and has a nice cost at $0 under the GPL, is Visifire.

http://visifire.com/silverlight_charts_gallery.php

Visifire is a set of open source data visualization controls – powered by Microsoft® Silverlight™ & WPF. It is a multi-targeting control which can be used in both WPF & Silverlight applications. Using the same API, charts in both Silverlight & WPF environments can be created within minutes. Visifire can also be embedded in any webpage as a standalone Silverlight App. Visifire is independent of server side technology. It can be used with

  • ASP.Net
  • PHP
  • JSP
  • ColdFusion
  • Ruby on Rails
  • Simple HTML
  • Etc.
This control can be easily used to chart data in a list.

Let me show you how…

  • Upload the Visifire files to your SharePoint document library. Specifically, copy the VisiFire.xap and .js files into the document library that will hold your web part page.
  • Add a Data View web part for the list containing the data you wish to graph to the web part page using SharePoint Designer.
  • In the Code View, replace the line in the section with the following

Note:

  1. Columns in this example are @Budget and @Actual, update these if your list is different
  2. I have replaced “<" with "< " so that the code will get presented correctly in the browser

< type="text/javascript" src="Visifire.js" mce_src="Visifire.js">< /script>
< escaping="yes">< ![CDATA[ < type="text/javascript">
var xmlString =
‘ < vc="clr-namespace:Visifire.Charts;assembly=Visifire.Charts" theme="Theme2">‘
+ ‘ < text="Revenue">‘
+ ‘ < title="Month">‘
+ ‘ < title="$ Thousands">‘
+ ‘ < name="Budget" renderas="Column" axisytype="Primary">‘
]]>< /xsl:text>
< select="/dsQueryResponse/Rows/Row">
< escaping="yes">< ![CDATA[ + ' < axislabel="">< /xsl:text>
< select="./@Title">
< escaping="yes">< ![CDATA[" YValue="]]>< /xsl:text>
< select="@Budget">
< escaping="yes">< ![CDATA["/>‘]]>< /xsl:text>
< /xsl:for-each>
< escaping="yes">
< ![CDATA[ + ' < /vc:DataSeries>‘
+ ‘ < name="Actual" renderas="Line" color="Red" axisytype="Primary">‘
]]>< /xsl:text>
< select="/dsQueryResponse/Rows/Row">
< escaping="yes">< ![CDATA[ + ' < axislabel="">< /xsl:text>
< select="./@Title">
< escaping="yes">< ![CDATA[" YValue="]]>< /xsl:text>
< select="@Actual">
< escaping="yes">< ![CDATA["/>‘]]>< /xsl:text>
< /xsl:for-each>
< escaping="yes">
< ![CDATA[ + ' < /vc:DataSeries>‘
+ ‘ < /vc:Chart>‘;
< /script>
]]>< /xsl:text>
< !-- Create the div to hold the chart and then run -->
< !-- the JavaScript code to actually show the chart. -->
< id="myChart" style="width:500px;height:300px;">
< language="javascript" type="text/javascript">
var vChart2 = new Visifire(“Visifire.xap”);
vChart2.setDataXml(xmlString);
vChart2.render(“myChart”);
< /script> < /div>

Opera Unite – a perspective change from the centralized model used by SharePoint?

Opera Unite, a web browser melded with a web server. Now there’s a novel concept.

Opera Unite allows you to share your files, stream music, host sites, and communicate real time with people. The suite of services, that’s what they literally are, are comprehensive.

  • File Sharing
  • Photo Sharing
  • The Lounge
  • Fridge
  • Media Player
  • Web Server
  • and more…

But there’s a problem with it. A very big problem that I suspect Opera Marketing are all too aware of. Although Opera Unite claims to “directly link people’s personal computers together,” to use it you must have an account on Opera’s servers. Once you have that all of your exchanges pass through Opera’s servers first. Sure, that’s an effective way to get around technical difficulties such as NAT, firewalls, etc, but the big issue is that it makes Opera the intermediary in your social interactions — not Facebook, not MySpace, but Opera. Think it through. Stepping past all the hype, the benchmarks*, etc. you have just another lockin scenario. Opera is up you’re up. Sure your stuff is on your machine but it can only be accessed via Opera the domain.

Is there a way around this? Do we need a way around this? Yes, it would be possible to create a swarm and find your friends, but what happens when your computer is down and somebody wants to access your content. Nothing.

*Benchmarks

Excerpt from http://unitehowto.com/Performance below. Take them in context.

Opera Unite uses very smart file I/O! Even if you save data to file each request (simplest, but stupidest way to do it) – it still can push out very impressive 744 requests/second! (It probably means that this data is saved to memory and dumped only sometimes, smart move!)

It seems like Opera uses 13 threads (seems like a soft limit, but unchangeable). 13 concurrent connections max out @ 810req/s, 1.23ms processing time.

For comparison:

PHP+Apache(+MySQL) is almost 2 times faster than peak Unite performance.

Compiled C++ web server (MadFish WebToolkit ) is only 6 times faster than Opera Unite, but that is compiled raw C++.

nginx (one of the fastest Web Servers available) is only 5 times faster than Opera Unite (clocked at 4900 req/s in raw C++) “Welcome to nginx” cycle (no I/O or scripting).