January 18, 2016 at 12:01 pm
Hello
Is there anyway to find out the list of procedures causing SERIALIZABLE lock modes? I see a lot of key locks in DMV 'sys.dm_tran_locks' but unable to find the historic lock details caused by the procs.
Thanks.
January 18, 2016 at 12:10 pm
There is no easy way to do this.
You could try querying the DMV sys.dm_all_sql_modules with a WHERE clause like WHERE definition LIKE '%SearchString%', and then use searchstrings that invoke serializable isolation level (SET TRANSACTION LEVEL SERIALIZABLE or (WITH SERIALIZABLE) off the top of my head).
But that will not give you stored procedures invoked by stored procedures that set the isolation level to serializable. Or invoked by SQL Agent jobs that set the isolation level to serializable. Or invoked by client code that sets the isolation level to serializable before making the call. (And there may be more similar scenarios).
Alternatively, set up an extended events session to see when the isolation level is set to serializable.
January 19, 2016 at 1:36 am
I'd probably go with the extended events session. I'm at least sure you can capture the information there as opposed to the DMVs.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
January 19, 2016 at 1:39 am
Grant Fritchey (1/19/2016)
I'd probably go with the extended events session.
Thirded. I'm starting to love XEs (late to the party, I know).
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 19, 2016 at 2:58 am
GilaMonster (1/19/2016)
Grant Fritchey (1/19/2016)
I'd probably go with the extended events session.Thirded. I'm starting to love XEs (late to the party, I know).
But very welcome all the same!
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply