Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
SQL Server 2008 - General
»
How To Master a Database in SQL Server 2008
How To Master a Database in SQL Server 2008
Rate Topic
Display Mode
Topic Options
Author
Message
sweetheartcharan
sweetheartcharan
Posted Tuesday, September 25, 2012 1:47 AM
Forum Newbie
Group: General Forum Members
Last Login: Friday, November 09, 2012 2:24 AM
Points: 2,
Visits: 8
Hi All,
I am having few Databases in which i have to go through each and every table and stored procs etc.
I know if i have the statistics of DB it will be easy for me to go through tables and sps based on the priority of their execution .
Things I did
1. Found the frequency of each SP (hence i know which SP is frequently executed)
2. Found the no of Tables & SPS in each Database
My Doubt is
What are the other ways to get the statistics of Database in SQL Server 2008 so that i will be having an informed data hence i can learn more
Or How one can master all Databases in SQL Server (2008)
Thanks,
Charan
Post #1363836
sroos
sroos
Posted Tuesday, September 25, 2012 2:11 AM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Saturday, January 26, 2013 2:59 AM
Points: 199,
Visits: 240
The sys.dm_exec_query_stats is a central DMV to find the statistics of the current performance of cached query plans.
Post #1363847
ChrisM@Work
ChrisM@Work
Posted Tuesday, September 25, 2012 3:04 AM
SSCertifiable
Group: General Forum Members
Last Login: Yesterday @ 8:21 AM
Points: 5,602,
Visits: 10,950
Familiarisation? Probably the easiest place to start is the Activity Monitor.
Watch for Recent Expensive Queries and examine them in detail as they come up. Experiment by sorting the columns - click on [Executions/mi] to see frequently-run queries. Hover on column titles to see which DMV is called to obtain the values.
Keep an eye on Waits in the Processes pane, and obtain more information if necessary from the relevant DMV.
Don't forget indexes.
Glen Berry
publishes a suite of diagnostic information queries on his website - they are tremendously useful for this type of investigation and include index investigation for refactoring.
“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.”
- Gail Shaw
For fast, accurate and documented assistance in answering your questions, please read
this article
.
Understanding and using APPLY, (I)
and
(II)
Paul White
Hidden RBAR: Triangular Joins
/
The "Numbers" or "Tally" Table: What it is and how it replaces a loop
Jeff Moden
Exploring Recursive CTEs by Example
Dwain Camps
Post #1363867
Grant Fritchey
Grant Fritchey
Posted Tuesday, September 25, 2012 4:30 AM
SSChampion
Group: General Forum Members
Last Login: Today @ 4:50 AM
Points: 13,371,
Visits: 25,143
If you're parachuting into a situation where there is no monitoring in place, then, as was already mentioned, use the Dynamic Management Objects (DMO) to query the cache in order to understand the most frequently called, most expense, longest running queries.
If you're living with a database over time, then setting up monitoring, preferably using a combination of Performance Monitor and Extended Events, to capture performance metrics about the system. This will lead you to understanding of the system in general.
I would ensure that you have maintenance routines in place to take care of statistics and possibly defragment indexes. While we're on indexes, most tables in most databases absolutely should have a clustered index. Where to place it is a design issue you won't be able to address directly since you're not designing the system, but I'd be concerned about any tables missing indexes.
From there, it's a slog. There are no shortcuts. See a query running long? Get the execution plan and see if modifying the structure or the T-SQL can help improve performance.
For lots more detail, get a copy of my book.
----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of:
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans
Product Evangelist for
Red Gate Software
Post #1363920
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.