Solved

SQL Server 2008 Query

Posted on 2014-01-14
6
405 Views
Last Modified: 2014-01-15
Under SQL 2008, how to

- check internal & external index fragment ? I use the script below but it seems that it takes a long time to run ..
ref: http://gallery.technet.microsoft.com/scriptcenter/Check-SQL-Server-a-a5758043

- how to identify dead lock in SQL 2008 ? How do I know whether a dead lock occur in production environment ? Will the SQL server slow down the performance ?

- how can I identify a long running sql, procedure or jobs in SQL 2008 server ?
0
Comment
Question by:AXISHK
  • 4
  • 2
6 Comments
 
LVL 35

Expert Comment

by:David Todd
ID: 39780683
Hi,

These are three separate questions.

1. The script
How long does it take to run? What size is the database in question?

Regards
  David
0
 
LVL 35

Expert Comment

by:David Todd
ID: 39780706
PS It is extent fragmentation, not external ...

An extent is a related group of 8 pages.
0
 
LVL 35

Accepted Solution

by:
David Todd earned 500 total points
ID: 39780710
Hi,

I suggest you look up
http://technet.microsoft.com/en-us/library/ms188917.aspx, and dig into the dmv
dm_db_index_physical_stats a little more.

Regards
  David
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

Author Comment

by:AXISHK
ID: 39781389
Wait for 1/2 hour but it doesn't return the result...

Is the query correct ? Is there some example on using the sys.dm_db_index_physical_stats ? eg. how to interpret the value and result ?

I will separate the #2 and 3rd question into separate thread. Tks
0
 
LVL 35

Expert Comment

by:David Todd
ID: 39781494
Hi,

Try on a smaller database first then.

Or if you follow the link I gave, you can specify the indexes of immediate interest.

Regards
  David
0
 

Author Closing Comment

by:AXISHK
ID: 39784480
Tks
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question