SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 how to optimized SQL Server Performance
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

imughal
Posting Yak Master

184 Posts

Posted - 07/26/2012 :  00:28:19  Show Profile  Reply with Quote
Hi,
i am using SQL Server 2008 R2 Ent. SQL is being used for SharePoint, TFS and Reporting Services. Now response from DB is getting slow. Please guide me steps how to optimize SQL Server performance. What steps to follow.

Thanks.

lionofdezert
Aged Yak Warrior

Pakistan
864 Posts

Posted - 07/26/2012 :  01:57:20  Show Profile  Visit lionofdezert's Homepage  Send lionofdezert a Yahoo! Message  Reply with Quote
First run SQL Profiler and get slow running quries. Then for each query, get execution plan to find out which part is causing its slowness. If requried create proper indexes and refactor your code to help SQL Server Optimizer to select a better index.

--------------------------
http://connectsql.blogspot.com/
Go to Top of Page

Transact Charlie
Flowing Fount of Yak Knowledge

United Kingdom
3425 Posts

Posted - 07/26/2012 :  04:21:37  Show Profile  Visit Transact Charlie's Homepage  Reply with Quote
If you are unfamiliar with profiler it can be a bit of a steep learning curve. Also if you aren't 100% with execution plans then I can recommend this as a starting point:

http://assets.red-gate.com/community/books/assets/sql-server-execution-plans.pdf

Do you have any idea of what's currently going on?

you may get some mileage also by looking at the object execution stats report

Right click on db go to reports -> standard reports -> Object Execution Statistics...



Transact Charlie
Msg 3903.. The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION.
http://nosqlsolution.blogspot.co.uk/
Go to Top of Page

Ibid
Starting Member

4 Posts

Posted - 08/02/2012 :  01:41:00  Show Profile  Reply with Quote
Getting through all those profile events is a lot of work - but there are a few free tools out there that could help you. I think the 2 most popular ones are Qure Analyzer (http://www.dbsophic.com/qure-analyzer.html) and ClearTrace. I highly recommend you use one of them to help you analyze those Profiler traces.
Go to Top of Page

denis_the_thief
Constraint Violating Yak Guru

Canada
463 Posts

Posted - 08/02/2012 :  08:55:27  Show Profile  Reply with Quote
Run the query below when the performance is poor. It will show you all actively running queries. It is ordered by StartTime so the culprit will likely be the first row returned. Also, if a Stored Procedure is running, this will show you both the Stored Procedure and which statment within the Stored Procedure SQL Server is currently having trouble with.


SELECT 
	r.Session_ID, 
	DB_Name(Database_ID) DatabaseName,
	r.Start_Time, 
	convert(decimal(10, 3), datediff(ms, r.start_time, getdate())/1000.0) Running_Time,
	left(s.text, 2000) Statement_Start, 
	object_name(objectID, database_id) ObjectName,
	SUBSTRING(text, (statement_start_offset/2) + 1,      
			((CASE statement_end_offset WHEN -1 THEN DATALENGTH(text) ELSE statement_end_offset END
			- statement_start_offset)/2) + 1) AS Statement_Text,  
	Blocking_Session_ID, 
	*
FROM 
	sys.dm_exec_requests r CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) s
order by 
	R.Start_Time
Go to Top of Page

jackv
Flowing Fount of Yak Knowledge

United Kingdom
1765 Posts

Posted - 08/02/2012 :  11:47:22  Show Profile  Visit jackv's Homepage  Reply with Quote
Beyond suggestion made above - which are all recommended, afre you maintaining statistics? For example , is your data changing regularly . If so , some index management may be required
Also, have any changes happened recently on the system \ subsystem ?

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page

chadmat
The Chadinator

USA
1947 Posts

Posted - 08/03/2012 :  16:52:09  Show Profile  Visit chadmat's Homepage  Reply with Quote
Pretty broad topic...You could look at wait stats and see what your threads are waiting for, then once you have that narrowed down, you can drill deeper (If it is IO, or Blocking, or whatever)

-Chad
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
35007 Posts

Posted - 08/03/2012 :  17:01:23  Show Profile  Visit tkizer's Homepage  Reply with Quote
Chad!

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

chadmat
The Chadinator

USA
1947 Posts

Posted - 08/03/2012 :  17:05:54  Show Profile  Visit chadmat's Homepage  Reply with Quote
Hi Tara

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000