You administer a Microsoft SQL Server 2012.
A process that normally runs in less than 10 seconds has been running for more than an hour.
You examine the application log and discover that the process is using session ID 60.
You need to find out whether the process is being blocked.
Which Transact-SQL statement should you use?
A.
SELECT * FROM sys.dm_exec_sessions WHERE session_id = 60
B.
DBCC INPUTBUFFER (60)
C.
EXEC sp_helpdb 60
D.
SELECT * FROM sys.dm_exec_request WHERE session_id = 60
The corect answer is A.
sys.dm_exec_sessions is a server-scope view that shows information about all active user connections and internal tasks. This information includes client version, client program name, client login time, login user, current session setting, and more. Use sys.dm_exec_sessions to first view the current system load and to identify a session of interest, and then learn more information about that session by using other dynamic management views or dynamic management functions.
“You need to find out whether the process is being blocked.”
correct answer is D, because in that view exist information about blocking session id.
SELECT * FROM sys.dm_exec_request WHERE session_id = 60
returns a syntax error Invalid object name ‘sys.dm_exec_request’.
It has to be A.
I think it is a typo…..
select * from sys.dm_exec_requests;
That works….
https://www.mssqltips.com/sqlservertip/2429/how-to-identify-blocking-in-sql-server/
There are number of ways to find out the details of the system processes IDs (spids) involved in blocking. Some of these options include:
sp_who2 System Stored Procedure
sys.dm_exec_requests DMV
Sys.dm_os_waiting_tasks
SQL Server Management Studio Activity Monitor
SQL Server Management Studio Reports
SQL Server Profiler
Please stop by the web sites we adhere to, such as this a single, as it represents our picks from the web.
although web sites we backlink to beneath are considerably not connected to ours, we feel they are really worth a go by, so possess a look
we prefer to honor many other net internet sites around the internet, even when they arent linked to us, by linking to them. Beneath are some webpages worth checking out
always a huge fan of linking to bloggers that I really like but dont get a great deal of link appreciate from
check beneath, are some completely unrelated sites to ours, on the other hand, they are most trustworthy sources that we use
here are some links to web pages that we link to mainly because we consider they are worth visiting
one of our guests not too long ago recommended the following website
Every as soon as in a though we opt for blogs that we study. Listed below are the latest websites that we pick out
just beneath, are several totally not related web sites to ours, even so, they’re surely worth going over
just beneath, are a lot of absolutely not connected web-sites to ours, nevertheless, they are surely really worth going over
Here is a superb Weblog You might Come across Exciting that we Encourage You
one of our visitors just lately suggested the following website
D.
But have a error:
sys.dm_exec_request (error) because correct sys.dm_exec_requests
A
Same question like this:
http://www.aiotestking.com/microsoft/which-transact-sql-statement-should-you-use-153/
sys.dm_exec_requests
Tested it
select blocking_session_id,* from sys.dm_exec_requests
where blocking_session_id0
What i do not understood is actually how you’re no longer really much more neatly-favored than you might be right now. You are very intelligent. You already know therefore considerably in the case of this matter, produced me individually imagine it from so many varied angles. Its like men and women aren’t fascinated except it is something to do with Girl gaga! Your personal stuffs outstanding. Always care for it up!