Upload
cecily
View
52
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Interpreting DMV’s & practical uses. Jannie Muller mullerjannie.wordpress.com. Making sense of – Dynamic Manage Views. And other practical DBA stuff!. Troubleshooting Timeline “Wh ere do we start ?!”. “ sys.configurations VS. sp_configure .”. sys.configurations Degree of parallelism - PowerPoint PPT Presentation
Citation preview
Interpreting DMV’s & practical uses
Jannie Mullermullerjannie.wordpress.com
wellington.sqlpass.org
Making sense of – Dynamic Manage ViewsAnd other practical DBA stuff!
Troubleshooting Timeline“Where do we start ?!”
sys.
config
uratio
ns
sys.
dm_o
s_m
emory
_cle
rks
sys.
dm_e
xec_
reques
ts
sys.
dm_d
b_index
_oper
atio
nal_s
tats
sys.
dm_o
s_buffe
r_des
crip
tors
“Simple. From left to right … right ?”
wellington.sqlpass.org
“sys.configurations VS. sp_configure.”
o sys.configurations
o Degree of parallelismo Server memoryo Query memoryo Full text crawl bandwitho CPU affinityo Fillfactor
“sys.configurations VS. sp_configure.”
Hard affinity.
No affinity.
“sys.dm_os_sys_info and sys.dm_os_memory_Clerks”
o sys.dm_os_sys_info
o Number of CPUs(cpu count)o Hyperthreading ratioo System Memoryo Restart dateo Affinity (scheduler count)
o sys.dm_os_memory_clerks
o NUMA Nodes
“sys.dm_os_buffer_descriptors”
o sys.dm_os_buffer_descriptors
o Row per item in the buffer pool.o Page types.
Troubleshooting Timeline“Where do we start ?!”
sys.
config
uratio
ns
sys.
dm_o
s_m
emory
_cle
rks
sys.
dm_e
xec_
reques
ts
sys.
dm_d
b_index
_oper
atio
nal_s
tats
sys.
dm_o
s_buffe
r_des
crip
tors
“Know your system… backwards, inside out.”
sys.configurationssys.dm_os_sys_infosys.dm_os_memory_clerks
wellington.sqlpass.org
Sp_who2
o sp_who2 ‘active’
o Active requestso Blockingo NUMAo Server start dateo Long running processes
o Log, mirror, jobs,brokero Gauge workload
o Checkpointso Status
o Runnable\waitingo Fulltexto System threads
select 100.*sum(signal_wait_time_ms)/sum(wait_time_ms),100.*sum(wait_time_ms -signal_wait_time_ms)/sum(wait_time_ms)
from sys.dm_os_wait_stats -- resource & CPU waits.
“sys.dm_os_wait_stats and sys.dm_os_waiting_tasks”
o sys.dm_os_wait_stats
o Historicalo Overall wait typeso Filter on typeso Resource waitso Signal (CPU waits)
o sys.dm_os_waiting_tasks
o Currento Who is blockingo What is it blocking ono Activityo Bottlenecks
select 100.*sum(signal_wait_time_ms)/sum(wait_time_ms),100.*sum(wait_time_ms -signal_wait_time_ms)/sum(wait_time_ms)
from sys.dm_os_wait_stats -- resource & CPU waits.
“sys.os_wait_stats and sys.dm_waiting_tasks”
o sys.dm_os_wait_stats
o Historicalo Overall wait typeso Filter on typeso Resource waitso Signal (CPU waits)
o sys.dm_os_waiting_tasks
o Currento Who is blockingo What is it blocking ono Activityo Bottlenecks
“sys.dm_exec_requests and sys.dm_exec_query_stats” o sys.dm_exec_query_stats
o Historicalo Logical \ Physical reads(IO)o Total worker time (CPU)o Execution Counto Text handle.
o sys.dm_exec_requests
o Currento Who is executingo What is it blocking ono Activityo Text Handleo read \ writes \ cpuo Percentage completeo Schedulerso Wait types
“sys.exec_requests and sys.dm_exec_query_stats”
o sys.dm_exec_query_stats
o Historicalo Logical \ Physical reads(IO)o Total worker time (CPU)o Execution Counto Text handle.
o sys.dm_exec_requests
o Currento Who is executingo What is it blocking ono Activityo Text Handle
“sys.dm_exec_query_stats” When it works, it works well…
..that issue on a Friday afternoon just before Beer’o clock.
Butterfly effect… Table details: 200mb, 600k rows.
@ 200 executions per second, it makes a difference.
“sp_recompile” - The solution
Troubleshooting Timeline“Where do we start ?!”
sys.
config
uratio
ns
sys.
dm_o
s_m
emory
_cle
rks
sys.
dm_e
xec_
reques
ts
sys.
dm_d
b_index
_oper
atio
nal_s
tats
sys.
dm_o
s_buffe
r_des
crip
tors
“Know your workload… and the hardware threshold”
sys.dm_os_wait_stats.sys.dm_os_waiting_taskssys.dm_exec_requestssys.dm_exec_query_stats
wellington.sqlpass.org
“sys.dm_io_virtual_file_stats”
SQL VS. Excel
o Cumulativeo read \ Write waits.o Data Vs. log file.
o sys.dm_db_index_usage_stats
o Historicalo Seeko Scano Lookupo Updateo Last used date
o sys.dm_db_index_operational_stats
o Waits or latcheso Range or singleton lookup
o sys.dm_db_index_physical_stats
o Fragmentationo Size
“You can use sys.dm_db_index_operational_stats to track the length of time that users must wait to read or write to a table, index, or partition, and identify the tables or indexes that are encountering significant I/O activity or
hot spots.” - BOL
“sys.dm_db_index_usage_stats , sys.dm_db_index_operational_stats , sys.dm_db_index_physical_stats”
“sys.dm_db_index_usage_stats , sys.dm_db_index_operational_stats , sys.dm_db_index_physical_stats”
o sys.dm_db_index_usage_stats
o Historicalo Seeko Scano Lookupo Updateo Last used date
o sys.dm_db_index_operational_stats
o Waits or latcheso Range or singleton lookup
o sys.dm_db_index_physical_stats
o Fragmentationo Size
“sys.dm_db_index_usage_stats , sys.dm_db_index_operational_stats , sys.dm_db_index_physical_stats”
o sys.dm_db_index_usage_stats
o Historicalo Seeko Scano Lookupo Updateo Last used date
o sys.dm_db_index_operational_stats
o Waits or latcheso Range or singleton lookup
o sys.dm_db_index_physical_stats
o Fragmentationo Size
“sys.dm_db_index_usage_stats , sys.dm_db_index_operational_stats , sys.dm_db_index_physical_stats”
o sys.dm_db_index_usage_stats
o Historicalo Seeko Scano Lookupo Updateo Last used date
o sys.dm_db_index_operational_stats
o Waits or latcheso Range or singleton lookup
o sys.dm_db_index_physical_stats
o Fragmentationo Size
“The value for avg_fragmentation_in_percent should be as close to zero as possible for maximum performance. However, values from 0 percent through 10 percent may be
acceptable. All methods of reducing fragmentation, such as rebuilding, reorganizing, or re-creating, can be used to reduce these values. “ - BOL
Troubleshooting Timeline“Where do we start ?!”
sys.
config
uratio
ns
sys.
dm_o
s_m
emory
_cle
rks
sys.
dm_e
xec_
reques
ts
sys.
dm_d
b_index
_oper
atio
nal_s
tats
sys.
dm_o
s_buffe
r_des
crip
tors
“Simple. From left to right … right ?”
Set yourself goals to spend limited time on a DMV.
Just because it’s not in SQL doesn’t mean you can’t use it.
Combine your DMV information with data from Win 2008 resource monitor. Use excel to visualize your data. Don’t forget to all the tools available to you.
Most importantly don’t forgot sp_who2.
Thanks! Questions?
Please complete an evaluation form for this session…and thanks again to our awesome sponsors!