How to enable Query Latency Trend report for Sharepoint 2010

Sharepoint Server 2010 has contains builting Search administration reports. You can find them via
Central Administration -> Administrative Report Library -> Search Administration reports.

One of the reports that is very useful is the Query Latency Trend chart. This does not work out of the box because verbose query monitoring is disabled.

To enable the Query Latency Trend report, you must run the following Windows PowerShell cmdlets:

$app = Get-SPEnterpriseSearchServiceApplication “<application name>”
$app = Set-SPEnterpriseSearchServiceApplication -VerboseQueryMonitoring “True”
$app = Get-SPEnterpriseSearchServiceApplication “<application name>”
$app.Update()

Example:

$sar = Get-SPEnterpriseSearchServiceApplication
$sar.VerboseQueryMonitoring = $true
$sar.Update()
Resource:
http://technet.microsoft.com/en-us/library/ee808861.aspx

Access Violation error on Sharepoint 2010 OOB components

If you are facing Access Violation error with newly upgraded Sharepoint 2010 server on common components like randomly calender view,document lists, etc. at undeterministic times.You may interested with this article.

Here is a sample error in ULS log:
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.    at Microsoft.SharePoint.WebControls.SPCalendarTabs.CreateChildControls()     at System.Web.UI.Control.EnsureChildControls()     at System.Web.UI.Control.PreRenderRecursiveInternal()     at System.Web.UI.Control.PreRenderRecursiveInternal()     at System.Web.UI.Control.PreRenderRecursiveInternal()     at System.Web.UI.Control.PreRenderRecursiveInternal()     at System.Web.UI.Control.PreRenderRecursiveInternal()     at System.Web.UI.Control.PreRenderRecursiveInternal()     at System.Web.UI.Control.PreRenderRecursiveInternal()     at System.Web.UI.Control.PreRenderRecursiveInternal()     at System.Web.UI.Control.PreRenderRecursiveInternal()     at System.W…       a45ffc85-760b-4b92-8dc9-6d6a8d3e16f9

and Event log:
Event code :3005
Exception type: AccessViolationException
Exception message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Cause:
This problem occurs because the values of the GC pointers are incorrect.

Solution:
There is a hotfix published by Microsoft for .net framework.
FIX: An access violation occurs when you pass structs as parameters through remoting or reflection in 64-bit applications in the .NET Framework 3.5 SP1 or the .NET Framework 2.0 SP2
http://support.microsoft.com/kb/974168/en-us

Before patching the hotfix please check your installed .net frameworks.
You must have .NET Framework 3.5 SP1 or .NET Framework 2.0 SP2 installed to apply this hotfix.

Check this article for determine  which versions and service pack levels of the Microsoft .NET Framework are installed
http://msdn.microsoft.com/en-us/kb/kbarticle.aspx?id=318785
You don’t have to restart the computer after you apply the hotfix if no relative .NET Framework instance is in use.
Apply this hotfix to your sharepoint wfe,app servers one by one. After patched you should better to execute an iisreset.

End of article.

Recursive Triggers on SQL Server and User Profile Service Problem

Recently Microsoft has published a “FAST PUBLISH” article about User Profile Application service starting problem with FIM Syncronization service.In KB defined problem is caused by The ‘Recursive Triggers Enabled’ property for the Model database is set to ‘True’ in the SQL instance. And the error is in your application log

The server encountered an unexpected error and stopped.
“ERR: MMS(6016): sql.cpp(5580): Query (update [mms_run_history] set [is_run_complete] = 1,[run_result] = N’stopped-server’,[end_date] = <Date & Time> where ([is_run_complete] = 0)) performed with error
ERR: MMS(6016): sql.cpp(5633): Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32).
….

What is a Recursive Triggers ?
A requirsive trigger is a trigger that fired by the other triggers or intreacting object that fire the trigger when executed recursively.

SQL Server also allows for recursive invocation of triggers when the RECURSIVE_TRIGGERS setting is enabled using ALTER DATABASE.

Recursive triggers enable the following types of recursion to occur:

  • Indirect recursion
    With indirect recursion, an application updates table T1. This fires trigger TR1, updating table T2. In this scenario, trigger T2 then fires and updates table T1.
  • Direct recursion
    With direct recursion, the application updates table T1. This fires trigger TR1, updating table T1. Because table T1 was updated, trigger TR1 fires again, and so on.

The following example uses both indirect and direct trigger recursion Assume that two update triggers, TR1 and TR2, are defined on table T1. Trigger TR1 updates table T1 recursively. An UPDATE statement executes each TR1 and TR2 one time. Additionally, the execution of TR1 triggers the execution of TR1 (recursively) and TR2. The inserted and deleted tables for a specific trigger contain rows that correspond only to the UPDATE statement that invoked the trigger.

Note:The previous behavior occurs only if the RECURSIVE_TRIGGERS setting is enabled by using ALTER DATABASE. There is no defined order in which multiple triggers defined for a specific event are executed. Each trigger should be self-contained.

Disabling the RECURSIVE_TRIGGERS setting only prevents direct recursions. To disable indirect recursion also, set the nested triggers server option to 0 by using sp_configure.

If any one of the triggers performs a ROLLBACK TRANSACTION, regardless of the nesting level, no more triggers are executed.

How to change “Recursive Triggers Enabled” property to false ?

From the SQL Server Management Studio, expand ‘System Databases’ > Right-click ‘Model’ | Properties | Options | under Miscellaneous section, set ‘Recursive Triggers Enabled’ property to ‘False’.

or.

The recursive trigger setting works on a database level . For checking the status of the recursive setting, use this command:

 EXEC sp_dboption '<name of db>', 'recursive triggers' -

for enabling Recusive Triggers:

 EXEC sp_dboption '<name of db>', 'recursive triggers', 'true' 

for disabling Recursive Triggers:

 EXEC sp_dboption '<name of db>', 'recursive triggers', 'false' 

For our senario use like this:

EXEC sp_dboption 'Model', 'recursive triggers', 'false' 

Resources:
http://msdn.microsoft.com/en-us/library/ms189799.aspx
http://support.microsoft.com/kb/2579951

 

 

How to rename Sharepoint database server

In some cases User Profile service is in “starting” mode but not started after a while getting “stopped” . one of the cause this situation is Sharepoint server name is using an ip address instead of using netbios name. You can check if from Central Administration -> Servers in farm section.

How can we change the ip address of SQL server to netbios name? Answer is simple use stsadm.
Run the following command to rename the server from IP address to netbios name sucessfully:

Stsadm -o renameserver -oldservername <ipaddress> -newservername <netbios name of the sql server>

Example: Stsadm -o renameserver -oldservername 192.168.10.2 -newservername POSTSQL

Now you can try starting the User Profile Synchronization Service. It should start successfully, unless there is some other User Profile Sync Service related issue.

..

 

Moss 2007 – Troubleshooting incoming email problems

Windows SharePoint Services 3.0 uses e-mail handlers to route incoming e-mail from virtually any e-mail client to a list in your SharePoint site. Each e-mail-enabled list is associated with a unique e-mail address, and each e-mail handler is associated with a particular list type.

For troubleshooting incoming e-mails

1) Check Central Administration ->  Operations -> Incoming E-Mail Settings  is correctly configured.

2) Check your library – Settings-> Incoming E-mail settings is correctly configured.

If you correctly enable Incoming emails settings, you should have also an installed smtp server feature (for Windows server 2008 r2)
At this point i want to tell about the process of an incoming email distribution. When you send an email to a sharepoint list first your mail is delivered by your mail server and pass through the your sharepoint machine smtp server. It stored c:\inetpub\mailroot\drop folder with a file format of eml. The timer job of “Windows SharePoint Services Incoming E-Mail” is monitoring your mailroot\drop folder and when it find an email it process this mail and deliver the attachments to destination document library.

3) Check your Mailroot/drop folders stores eml files.

Incoming e-mail uses the Microsoft SharePoint Directory Management Service to connect SharePoint sites to the directory services used by your organization. If you enable the Microsoft SharePoint Directory Management Service, users can create and manage distribution groups from SharePoint sites. SharePoint lists that use e-mail can then be found in directory services, such as the Address Book. You must also select which distribution group requests from SharePoint lists require approval. The Microsoft SharePoint Directory Management Service can be installed on a server in the farm, or you can use a remote Microsoft SharePoint Directory Management Service.

4) If you are using Microsoft SharePoint Directory Management Service  Check Microsoft SharePoint Directory Management Service is running.

5) Check your sharepoint timer service identity has correct rights on mailroot folders. (you can check it from services.msc)

6) Trace the log messages using ULSViewer program with a filter of “category equals E-Mail”

For more information of Configuring Incoming E-Mail Settings:
http://technet.microsoft.com/en-us/library/cc287879(office.12).aspx

 

Sharepoint 2010 Misconception with RBS

After Sharepoint 2010 sp1 is released , some new features and improvements has been spreading in several blogs.And one of the most interested the new content database limits. In SP1 , by defining specific requirements for large data storage in SharePoint, Microsoft is able to increase the supported limits for data storage in SharePoint.
Sotware boundaries and limits and the primary changes are:

  1. For a SharePoint content database up to 200 GB there are no special requirements and this limit is included for consistency.
  2. For a SharePoint content database up to 4 TB you need to additionally plan for the following two requirements:
    • Requires disk sub-system performance of 0.25 IOPS per GB, 2 IOPS per GB is recommended for optimal performance.
    • Requires the customer to have plans for high availability, disaster recovery, future capacity, and performance testing.
    • And you need to review additional considerations in the TechNet Boundaries and Limits article.
  3. For a SharePoint content database over 4TB specifically for a Document Archive scenario you are required to additionally plan for the following:
    • SharePoint sites must be based on Document Center or Records Center site templates and must be an archive scenario where less than 5% of content is actively read from each month and less than 1% of content is actively written to.
    • Do not use alerts, workflows, link fix-ups, or item level security on any SharePoint objects in the content database. Note: document archive content databases can be the recipient of documents as a result of Content Routing workflow.
  4. Other specific limits changes being made at the same time:
    • A new limit of 60million items in any one SharePoint content database
    • The specific 5 TB limit per SQL Server instance has been removed.  Instead you should work with a SQL Server professional to plan for database storage.

 Also these new extended limitation is not our artile issue if you need more info see:
http://technet.microsoft.com/en-us/library/cc262787.aspx

And also RBS has some improvements:
The Microsoft SQL Server FILESTREAM RBS provider is now supported allowing for iSCSI connections to lower cost NAS storage. The SQL Server RBS provider is one option for RBS use with SharePoint and there are a number of ISV’s who also have RBS providers.

What about RBS misconception: Misconception is that RBS can provide extra database size limit ? Answer is “No”:

First of all Microsoft Says :
“We are clarifying that Remote Blob Storage (RBS) does not offer a way to increase the SharePoint content database size limits. The content database supported size limits apply to the sum of data stored in SQL Server plus data stored outside of SQL Server using an RBS provider”

Even if you use RBS or not , Sharepoint boundries is strict and you should not able to change it. And this is not only just Content DB size limit. it is also valid for all Sharepoint Limitation,  including Maximum document size limit of 2 GB for one file.

See you in next article…

 

Sharepoint 2010 – Basic Authentication and Php .net web service connection.

A few days ago i have faced a problem that an application which coded with php try to connect sharepoint web services. And it didnt not succeed because of authentication of sharepoint system was windows authentication. PHP application support basic authentication so sharepoint does also. But the problem is when change authentication to basic or enable basic authenticaition for production site cause a security risk . So  SSL should be use but in our case it is one of out of issue.

so what we did , extending current site to new web application from Central Administration and enable basic authentication for extended site. Secure this extended site for specific application server that running php via Firewall rules and voila . Also suggested for external connection for this site using vpn or also able to use ssl if they able to change their code for it.

For Enabling Basic Authentication fallowing defined above senario :

1)  Extend your sharepoint site from Central Administration .

2) Enable basic authentication from IIS management console for extend web application. 

3) Select Authentication Provider for your newly extended site.

4) Enable Basic Authentication from configuration.

 

its done 🙂