30.06.2013 Views

Performance Tuning with SQL Server Dynamic Management Views

Performance Tuning with SQL Server Dynamic Management Views

Performance Tuning with SQL Server Dynamic Management Views

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 2: Connections, Sessions and Requests<br />

would review the activity associated <strong>with</strong> the Transport View application to<br />

determine whether or not multiple connections, and multiple sources of said<br />

connections, are appropriate.<br />

It is quite common that many, if not most, of the Application <strong>Server</strong>s in your<br />

environment will be generating multiple connections into your <strong>SQL</strong> <strong>Server</strong> boxes.<br />

However, if you observe the same behavior from a workstation, you may need to<br />

investigate the usage patterns of the application <strong>with</strong> the application analyst or<br />

vendor representative, to determine if this is an architectural issue or a result of<br />

misuse by the end-user (opening multiple instances of the application in an attempt<br />

to increase productivity).<br />

Who is connected by SSMS?<br />

Closely related to the previous script, Listing 2.4 focuses on those who are directly<br />

connected to the <strong>SQL</strong> <strong>Server</strong> instances I support, via SSMS. If I see results that reference<br />

a server-class box, I would be apt to question the activity. Red flags would also be<br />

generated if I encounter rows that are not associated <strong>with</strong> workstations assigned to<br />

DBAs, developers, or other authorized <strong>SQL</strong> <strong>Server</strong> professionals in my environment.<br />

SELECT dec.client_net_address ,<br />

des.host_name ,<br />

dest.text<br />

FROM sys.dm_exec_sessions des<br />

INNER JOIN sys.dm_exec_connections dec<br />

ON des.session_id = dec.session_id<br />

CROSS APPLY sys.dm_exec_sql_text(dec.most_recent_sql_handle) dest<br />

WHERE des.program_name LIKE 'Microsoft <strong>SQL</strong> <strong>Server</strong> <strong>Management</strong> Studio%'<br />

ORDER BY des.program_name ,<br />

dec.client_net_address<br />

44

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!