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

Advertisement

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