Thursday 17 June 2010

Filter web parts are missing

I couldn't find the "filter web parts" on my SP 2010 installation, they are there just add them to the web part gallery.
In the RTM the filter WP are available by default and didn't need to be added.

A list of OOTB Web Parts

How Filter WP work from the MS site. Writen for MOSS but still applies to SP2010.

  1. Connect a filter Web Part to a List View Web Part to display a subset of data.
  2. The filter Web Part provides a value.
  3. The filter value is passed to a column in the List View Web Part by using a Web Part connection.
  4. The List View Web Part displays only those columns that match the filter value

Tuesday 15 June 2010

Finding Your Default File Locations in SMO

Alan White's article helped me figure out where my default databases would be created.
To open SQL Powershell type "sqlps" in the run prompt.

==============================================

Update: 2012/12/20
Problem: After creating a udl file to check my SQL connection to the database which failed I realiased the SQL 2012 install done by the DBA was not on the default port 1433.  And it was set to dynamic.

Resolution: Change the TCP/IP network configuration as shown below

 

SQL Server for SharePoint 2010 notes

  • SharePoint Server 2010 needs 64-bit SQL Server 2008 SP 1 CU2 (Cumulative Update) or 64-bit SQL Server 2005 SP3 CU3.
  • Determine you storage requirements
  • SQL is I/O intensive, to improve this get fast disks and use multiple disks & disk controllers.
  • Use a SAN if possible, the physical hardware with multiple disks that are RAID 10 (Stripped & mirrored) preferable with C:\ drive for programs, d:\ for data and e:\ for logs.
  • Don't virtualise SQL Server unless you are a virtualisation expert and can get extremely high IOPS.
  • Search db's can also be broken into their own drive/disks.
  • Build the database with hardware redundancy (NIC, controllers, RAID).
  • Use SQL Server 2008 R2 Enterprise edition if possible.
  • Index's will be about 25% of the size of your database storage.
  • 8 GB is the minimum amount of RAM for a DB in production, 16 GB is more comfortable and for large farms or big site collections 64GB is a good guideline. SQL Enterprise Edition (EE) can support up to 2 Terabytes of RAM.
  • Don't install any other software on the database as you want maximum I/Oa nd the DB server/s should be locked down.
  • SQL guideline is 4 SP2010 server for each SQL machine.
  • Use multiple Data files for Content databases (Distribute data across disks, faster backup and restore). Try keep data files roughly similar in size & usage.
  • Large files can be store in Remote Blob storage (RBS), saves db and can be cheaper on disk space. Cheaper storage can be used to hold large blob data such as cloud storage. Blobs can be stored locally using the files stream using all versions of SQL, for remote storage EE is needed (Not sure what this means).
  • Pre-grow data & log files, faster than doing it on the fly when the system is over utilised.
  • Try keep 25% of db space free for growth in peak times.
  • Monitor SQL Servers including hardware counters.
  • SQL Database Mirroring is greatly improved.
  • Use backup compression on SQL 2008 (2005 not supported) is backup size is an issue. I/O is improved for the backup process.
  • SQL 2008 offers improved clustering.
  • Mirroring or Clustering is a good resilience option.  Review for HA.
  • Use Windows authentication not mixed mode authentication.
  • Use throttling if SQL is under load.
  • Transparent Data Encryption is supported in SQL 2008 EE & SP2010, there are costs but security is much better.
  • Failover clustering is still available is you use Standard or EE of SQL 2008.
  • Clustering and mirroring are good options for High Availability (HA) select appropriately for your network and knowledge.
  • Install SQL Server using a domain account.  The windows service account needs no permissions but is needed for advance SQL features as opposed to using built in accounts or local accounts.
  • I tend to use IP adrs for point to SQL Server, the netbios name also works and can be easier in the event of a SQL Server disaster.  For really good availability use a SQL Alias, it takes more setup time but if you loose your SQL box you will be glad you did it as you can switch over to another SQL box quickly.
  • Mirroring is a good option for HA.  Backups can be performed in various ways ensure you select the appropriate backup strategy. 
  • Max Degree of Parallelism (MAXDOP) should be set to 1. This can be found on the SQL Server instance properties > Advanced > Parallelism > Max Degree of Parallelism. Or run the T-SQL SELECT value FROM sys.configurations WHERE name = 'max degree of parallelism' SP2013 tries to reset MAXDOP during installation. 
  • AUTO_UPDATE_STATISTICS & AUTO_CREATE_STATISTICS should be disabled in SP2010.  More Info.
  • Use the default SQL Collation (Latin1_General_CI_AS_KS_WS), a good reason why SharePoint farms should have their own SQL Server instance.
  • Full backups should clear down the transaction log, if the transaction log is not cleaned up, perform it manually after you have checked the SQL backup of the db is valid.
  • Incremental backups are cumulative i.e. they go back to the last Fullback up not the last incremental backup.
  • Don't let transaction logs grow continuously, perform full backups periodically followed by taking a transaction log backup that truncates the log to remove/zero unused transactions.
  • SQL 2008 Developer Edition is the equivalent of SQL 2008 Enterprise Edition.
  • SQL Server 2008 R2 is the best option if you can choose.
  • To determine SQL edition in SQL Management Studio run
SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
  • SQL Server 2008 = 10.0.1600.22 needs cumulative update 2 for SP1. Update - 12/10/2010 or SP2
  • SQL Server 2008 SP1  = 10.0.2531.0 needs cumulative update 2 for SP1.
  • SQL Server 2008 SP1 + CU2 = 10.0.2714.0
  • SQL Server 2008 + SP2 = 10.0.4000.0 Update - 12/10/2010
  • SQL Server 2008 R2  =  10.50.1600.1 Update - 12/10/2010
  • SQL Server 2008 R2 SP1 = 10.50.2500.0 Updated - 26/07/2011
I also telnet from each of my SharePoint servers to SLQ Server before I install to ensure networking is working and that SQL Server is available.

SharePoint DB's create:
SPF2010: 1) Configuration database (DB), 2) CA, Content DB's (multiple for site collections, 3) 1 content db stores 1 or more site collections data, Best Practice is to limit content db's to 200GB), 4) Usage and Health Data Collection database (farm health & usage info), 5) Business Data Connectivity database, Application Registry database(BDC in MOSS used for historic reason) & 6) Subscription Settings database.
SPS2010 Std Ed: 1) Secure Store database (stores & masps credentials), 2) State database (State info used by forms server, info path & visio services), 3) Web Analytics Staging database, 4) Web Analytics Reporting database, 5) Search service application Administration database, 6) Search service application Crawl database, 7) Search service application Property database, 8) User Profile service application Profile database, 9) User Profile service application Synchronization database, 10) User Profile service application Social Tagging database, 11) Managed Metadata database, 12) Word Automation Services database
SPS2010 Ent Ed: 1) PerformancePoint service application database, 2) Project Server 2010 databases, 3) Published database, 4) Archive database, 5) Reporting database, 6) ...
More info:
http://technet.microsoft.com/en-us/library/cc990273.aspx
Determine the SQL Server version installed
SQL Version no's
SQL DB info for SP 2010 - db's created
Updated 15 Dec 2010 - Database Maintenance for SharePoint 2010 by Matt Ranlett, Brendon Schwartz
Updated 11 May 2011 - Nice simple article on the SP2010 database's by Bert Jan van der Steeg
Updated 24 May 2011 - SQL Server mirror is either Synconous (hot standby for HA) or Asynconous (for DR).  Mirroring requires Enterprise edition and standard edition support is limited.  Clustering is normally done in the same server room whereas Mirroring is done on a remote site, the distance is dictated by the speed of the connection.
Update 11 Aug 2011 - Set the appropriate recovery model for your SP2010 databases.
Updated 28 May 2012 - SQL Best Practices for SharePoint 2010
Update 13 August 2013 - Best Practices for SQL Server in a SharePoint 2013 Farm - In SP2013 still ensure MAXDOP is set to 1.  Note:  During the SPInstall SQL will make this change if it has permissions to do this.

Moving a site collection to a new database

Problem: IT department created my development machine using a base image with a 20GB C:\ drive. The company insists I use SQL Server 2010 express for development. I installed SQL Express onto the C:\ drive. The databases are all stored on the same c drive along with the Windows footprint of 13GB. Very quickly I ran out of space.
Initial Hypothesis: When creating content databases thru Central Administration (CA), SharePoint will use the SQL default file location for *.mdf and *.ldf files. Therefore I need to change the location where the data and log files will be setup thru the UI.
I have a large D:\ drive so I should move the data and log files to the D:\ drive. I need to:
  • Change the default location of the files to the D:\ drive for data\log files;
  • Create a new content database to host the existing site collections; and
  • Move the existing data (site collections) to the newly created content database.
Resolution:
The base image is causing issues, this couple with me putting the default location on my C drive and the inability of this environment to resize virtual machine drives I had had to use the resolution below.

1.> Change the default location using T-SQL (I'm sure there is a better solution using Power Shell for Windows using SMO);
SQL Server Management Studio


2.> Open Power Shell (PS) for SharePoint



PS> Move-SPSite -Identity http://mysharepointsite.com.au/sites/user -destinationdatabase WSS-Content-NewUserDB


Your should work, I will solve the SQL permissions issue in my next post.

More Info:
SQL default location info

Moving site collections using PowerShell or move the entire Content DB

Monday 14 June 2010

IE won't open the local SharePoint site

If you can open your local sharepoint site using Firefox but no IE you need to diable the loop back check for IE7 & IE 8
To set the DisableLoopbackCheck registry key yourself, follow these steps:
Set the DisableStrictNameChecking registry entry to 1. For more information about how to do this, click the following article number to view the article in the Microsoft Knowledge Base:
281308 (http://support.microsoft.com/kb/281308/ ) Connecting to SMB share on a Windows 2000-based computer or a Windows Server 2003-based computer may not work with an alias name
Click Start, click Run, type regedit, and then click OK.
In Registry Editor, locate and then click the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
Right-click Lsa, point to New, and then click DWORD Value.
Type DisableLoopbackCheck, and then press ENTER.
Right-click DisableLoopbackCheck, and then click Modify.
In the Value data box, type 1, and then click OK.
Quit Registry Editor, and then restart your computer.
Back to the top

Sunday 13 June 2010

Using embedded jQuery in xslt for SharePoint

Problem: A lot of web parts (WP) use xslt to create the html user interface(UI). You need to escape characters in order to get jQuery to work.
Initial Hypothesis:
Can use a Content Network Content copy of jQuery, has the advantage of being up-to-date and may be cached in user browser already. Issue is that may not be trusted or available on an Intranet.
jQuery file/s should be embedded in the master page (this should be activated in a feature).
Inside the xslt add the jQuery to perform your custom actions as shown below that does not escape characters:

XSLT List View Web Part (XLV)

Overview:
SharePoint 2010 has a heavy reliance on the Xslt List (XLV) View Web Part (WP). The replaces the MOSS List View Web Part (LVWP). In MOSS the Content Query Web Part (CQWP) was heavily utilised and the XLV WP is often a better option in SP 2010.

The old LVWP used CAML to provide custom views of the data/lists. Customising the XLVWP display is is done using xslt.

XLVWP has a default xslt for display located in the 14 hive at _layouts/xsl/main.xsl
main.xsl uses vwstyles.xsl and fldtypes.xsl that does most of the work on all the XLVWP in your SP farm.

Note. "XSLT is schema dependent because it iterates through the list of columns by naming each one explicitly. Using XSLT, the schema of the rendered list is fixed; it’s not possible to change the set of fields without changing the XSLT." - Eric Andeen.

XLV WP model - How it works

A custom xslt can either be placed ina style library or in th 14 hive.
Using SharePoint Designer (SPD)2010, you can customise the the XLVWP

More Info
SPD 2010 working with XLVWP
XSLT customisation
Customise the XLVWP
Connected Web Parts (XLVWP)