31 January, 2013

Enabling and Using Developer Dashboard - Sharepoint 2010

Today I was working with one Client who was having some issues with performance . In Sharepoint 2010 . I found a Out of box Feature which helps in monitoring the performance of the site Developer Dashboard.

The Developer Dashboard is an instrumentation framework introduced in Microsoft SharePoint Foundation 2010. Similar in concept to ASP.NET page tracing, it provides diagnostic information that can help a developer or system administrator troubleshoot problems with page components that would otherwise be very difficult to isolate.

For example, a developer can easily introduce extra SPSite or SPWeb objects into his or her code unknowingly or add extraneous SQL Server queries.

In the past, the only way to debug performance problems caused by the extra overhead of these instances in code would be to attach a debugger to the code and monitor SQL Server Profiler traces. With the Developer Dashboard, a developer can identify this type of problem, either programmatically by using the object model or visually by looking at page output.

Although performance issues and resource usage information is available in the Unified Logging Service (ULS) logs, interpreting the raw data can be very time consuming. With the Developer Dashboard, all the related information is correlated, which makes identifying these types of issues much easier.

How to enable Developer Dashboard and how to use this?

Enable / Disable over stsadm:

stsadm -o getproperty -pn developer-dashboard



stsadm –o setproperty –pn developer-dashboard –pv “On”





Enable / Disable over powershell

Turn On: for onDemain Mode
$service = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$addsetting =$service.DeveloperDashboardSettings
$addsetting.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::OnDemand
$addsetting.Update()


Turn On
$service = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$addsetting =$service.DeveloperDashboardSettings
$addsetting.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::On
$addsetting.Update()


Turn Off
$service = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$addsetting =$service.DeveloperDashboardSettings
$addsetting.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::Off
$addsetting.Update()
 


On – Displays the output all the time at the end of the page content
Off – Switch off Developer Dashboard and nothing is rendered
OnDemand – Displays a DeveloperDashboard icon to make dashboard output visible if needed.

In ON Demand - you will see a icon on the top right hand side corner of the site . as Shown below .



also you will see the following details when you click on the icon .



How to use the Developer Dashboard?
Developer dashboard is designed to find performance bottleneck during the page load.
To get an overview about the whole page load performance take a look in the upper right side  on category “web server”. On my test environment the total time of page rendering  is 3801.71 milli seconds.





At the left side you will see the ASP.NET rendering process of all involved controls with their time to render. Here is makes sense to focus only on long running controls.






In this case the longest operation is GetWebPartPageContent (1815.92 ms)

Because sharepoint controls will request data from database, the developer dashboard lists also corresponding sql requests with their execution time.



If you click on the sql command than a popup windows display more details. The long running sql request on my test environment is “Declare @…”





During this request i see the complete SQL query and the corresponding call stack to identify the correct control. Additionally at the end we see the IO Stats in case of a slow running SQL server based on too many IO-operations. 


One additional category exist for webparts to identify the slow running ones. In this case the ListView-Webaprt of the “Shared Document Library” is the slowest one.


Hope This Post helps administrators on resolving Performance issues .



Reference sites- http://msdn.microsoft.com/en-us/library/ff512745(v=office.14).aspx

http://blogs.technet.com/b/patrick_heyde/archive/2009/11/16/sharepoint-2010-enable-using-developer-dashboard.aspx

28 January, 2013

Psconfig Steps with their Operations performed at each task

Today Lets check out What happens when we run the Post Setup configuration Wizard . After setup is run the post setup configuration wizard must be run to complete the process of either creating a new farm or joining a server to an existing farm.
Psconfig Steps with their Operations performed at each task. 
Task 1 -      Initialize SharePoint products and technologies configuration 
Note - It Initializes the configuration and has very less chances of failing on this step.
Task 2 -    Create Configuration database
Note - It creates a new configuration Database in the sql . You need to have proper rights to create a database. 
Setup user account - The Setup user account is used to run the following:
  • Setup
  • SharePoint Products Configuration Wizard
    • Domain user account.
    • Member of the Administrators group on each server on which Setup is run.
    • SQL Server login on the computer that runs SQL Server.
    • Member of the following SQL Server roles:
      • securityadmin fixed server role
      • dbcreator fixed server role
If you run Windows PowerShell cmdlets that affect a database, this account must be a member of the db_owner fixed database role for the database.

If you find an issue Connecting Sharepoint to the Sql server. Create a UDL file and check for the connectivity. For further information on UDL check the link below

http://blogs.msdn.com/b/farukcelik/archive/2007/12/31/basics-first-udl-test.aspx
Task 3 -      Install help collections
Task 4 -       Secure SharePoint resources
Task 5 -            Register SharePoint Services
 Successfully provisioned service: Windows SharePoint Services  Usage.
Successfully installed service instance: Windows SharePoint Services Usage
Successfully provisioned service instance: Windows SharePoint Services Usage
Successfully installed service: Microsoft.SharePoint.BusinessData.SharedS
BdcService.
Successfully provisioned service: Microsoft.SharePoint.BusinessData.Share
e.BdcService.
 Task 6 -        Register SharePoint features
Successfully installed feature C:\Program Files\Common Files\Microsoft Sh…
Server Extensions\14\Template\Features\SPSearchFeature\Feature.xml.
Successfully installed feature C:\Program Files\Common Files\Microsoft Sh
b Server Extensions\14\Template\Features\TenantAdmin\feature.xml.
Task 7          Provision Central Administration Web application and site if   
                        Standalone install.
Task 8 -          Register SharePointHealth Analysis rules 
Task 9 -            Create sample data and provision default Web application 
Task 10 -         Install application content files
Installing the application content files...
Installing the SharePoint Central Administration Web Application content.
Installing the SharePoint Web Application content files...
Task 11 -Finalize SharePoint product and technologies configuration
One new feature of SharePoint Foundation 2010 is that it will automatically set up inbound Windows firewall rules when provisioning a Web application or Web services. During PSConfig, steps above firewall rules will be created for newly created Web applications and services.

Business Data Connectivity connectors are currently enabled in a partitioned environment: SharePoint 2013.

Problem: You could see in SharePoint Health Analyzer rule "Business Data Connectivity connectors are currently enabled in a partitioned environment."
Background:  Business Data Connectivity (BDC) Models containing External Content Types with database, WCF, Web service or custom connectors can be used by tenants to elevate their user permissions. In a partitioned environment, we recommend you disable the Business Data Connectivity connectors.
Reason for error: Business Data Connectivity connectors are currently enabled in a partitioned environment.
Resolution: Disable unwanted connectors by using Windows PowerShell.
To disable unwanted connectors, follow these steps:
1.      Click Start, click All Programs.
2.      Click Microsoft SharePoint 2010 Products.
3.      Click SharePoint 2010 Management Shell.
4.      At the Windows PowerShell command prompt, type the following command, and then press ENTER:
Get-SPServiceApplicationProxy
5.      Note the Business Data Connectivity proxy instance.
6.      You must set the EnableSystemType property to false for each unwanted connector. To do this, at the Windows PowerShell prompt, type the following command, and then press ENTER:
$proxy.EnableSystemType("Connector_type",$false)
Applies to:
·        SharePoint Server 2013 
·        SharePoint Foundation 2013 

24 January, 2013

How to change service accounts and service account passwords in SharePoint Server 2007/2010

There might be a Need in the org to change the password of the service account as some administrator has Left or for some other reason to avoid any integrity issue .

Just as I was walking through the process of Changing Service account passwords in 2010 which i found the simplest .

I also wanted to share the old way of changing service accounts and service account passwords in SharePoint Server 2007 .

Please refer to the below link

http://support.microsoft.com/kb/934838

The steps in the KB article would walk you through the individual STSADM commands that were necessary to update the password for the following accounts on every server in the SharePoint Farm:

•Farm account
•Application pool account(s)
•Windows SharePoint Services Help Search Service
•Content access account (used by the Windows SharePoint Services Help Search Service)
•Shared Services Provider (SSP) account(s)
•Office SharePoint Server Search service

However in Sharepoint 2010 we have Managed Accounts

Launch SharePoint 2010 Central Administration (logon as Setup Farm Account)
Navigate to ‘Application Management’
In ‘Security’ Section Click‘Configure Manage Accounts
Click Register Managed Account

Add the New Account
User Name (NEW USER)
Password (NEW PASSWORD)

Update Security Groups on Each SharePoint Server.
Start – Administrative Tools – Computer Management
Expand System Tools -> Local Users and Groups – Groups
Set the permissions as below:

ADMINISTRATORS – add the new farm account confirm it exists
WSS_WPG – add the new farm accountconfirm it exists
WSS_ADMIN_WPG – add the new farm accountconfirm it exists

Launch Central Administration
Select Security
Select Configure Service Accounts
Update the following Accounts:
• Farm Account
• Windows Service – Microsoft SharePoint Foundation Sandboxed Code Service
• Windows Service – User Profile Synchronization Service
• Windows Service – Web Analytics Data Processing Service
• Service Application Pool – SecurityTokenServiceApplicationPool
• Service Application Pool – SharePoint Web Services System

You can also change only the password of the Service account

Launch SharePoint 2010 Central Administration (logon as Setup Farm Account)
Navigate to ‘Application Management’
In ‘Security’ Section Click
‘Configure Manage Accounts
Click on Edit besides the service account and then fill in the details
The Managed account should be already selected
Check the Change password now box
Set account password to new value
Confirm Password
Click ok

Hope This helps some Administrators .

You can also refer - http://blogs.technet.com/b/seanearp/archive/2011/01/25/updating-passwords-on-sharepoint-2010.aspx

Recover data from an unattached content database - Sharepoint 2010

Wow One more amazing feature .

Now you can Recover data from an unattached content database . you dont have to add the content database to a web application

As a Sharepoint administrator there might be a need to restore only some but not all content within a content database. How would you do that in SharePoint 2010 .

In earlier versions of SharePoint, to restore or recover content from a backup file, we had to restore the backed up file to a database server and had to attach that restored database to a another SharePoint farm. Then we needed to export the required content from this new temporary farm and then migrate it to the original farm where we wanted to recover it. This whole process required a huge time investment and rigorous planning.

To recover content from an unattached content database by using Central Administration

* Verify that the user account that is performing this procedure is a member of the Farm Administrators group and is a member of the db_owner fixed database role.

* In Central Administration, on the Home page, click Backup and Restore.

* On the Backup and Restore page, in the Granular Backup section, click Recover data from an unattached content database.

* On the Unattached Content Database Data Recovery page, type the database server name in the       
    Database Server text box and type the database name in the Database Name text box.

* Select the database authentication method that you want to use.

* Select the Browse content option, and then click Next.

* Click Start Restore.

* On the Browse content page, select the site collection, site, and or list that you want to restore, select the
   Backup site collection or Export site or list option, and then click Next.

Complete the process to restore the content.

To recover content from an unattached content database by using Windows PowerShell

Verify that you meet the following minimum requirements: See Add-SPShellAdmin.

On the Start menu, click All Programs.
Click Microsoft SharePoint 2010 Products.
Click SharePoint 2010 Management Shell.
At the Windows PowerShell command prompt, type the following command

Get-SPContentDatabase -ConnectAsUnattachedDatabase  -DatabaseName <DatabaseName> -DatabaseServer <DatabaseServer>

Where:
<DatabaseName> is the name of the unattached database from which you want to recover content.
<DatabaseServer> is the name of the database server that hosts the unattached database from which you want to recover content

For reference - http://technet.microsoft.com/en-us/library/hh269601(v=office.14).aspx