SQL SERVER???????--???????????????????
???????????? ???????[ 2013/10/24 10:06:56 ] ????????
???????????:
?????????
????--???????2
????begin tran
????select * from ta with (nolock)--??nolock:??????????仯?У????????????????á?
??????????
????????2(????):
???????????: ??????
????create index IX_Ta_Col1 on Ta(Col1)--??COl1??????????????????????:COl1=102?????????IX_Ta_Col1????????????????Χ??
----------------------------???????1 -------------------------------------------------
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
--?????????? TRANSACTION ISOLATION LEVEL
--SERIALIZABLE ?????????????????????????????
begin tran
update ta set col2='BB' where COl1=102
--rollback tran
-----------------------------???????2------------------------------------------------
begin tran
select * from ta
?????????????????????????
????-----------------------------???????2------------------------------------------------
????SET TRANSACTION ISOLATION LEVEL READ COMMITTED --???????????:????????????????????????????δ????????
????begin tran
????select * from ta
????1?????????????
????--???????????
????SELECT '????ID[SPID]' = STR(a.spid?? 4)
?????? '??????' = CONVERT(CHAR(10)?? a.status)
?????? '??????ID' = STR(a.blocked?? 2)
?????? '??????????' = CONVERT(CHAR(10)?? a.hostname)
?????? '??????' = CONVERT(CHAR(10)?? SUSER_NAME(a.uid))
?????? '???????' = CONVERT(CHAR(10)?? DB_NAME(a.dbid))
?????? '??ó?????' = CONVERT(CHAR(10)?? a.program_name)
?????? '??????е?????' = CONVERT(CHAR(16)?? a.cmd)
?????? '???CPU???' = STR(a.cpu?? 7)
?????? 'IO' = STR(a.physical_io?? 7)
?????? '?????' = a.loginame
?????? '???sql' = b.text
????FROM master..sysprocesses a CROSS APPLY
????sys.dm_exec_sql_text(a.sql_handle) b
????WHERE blocked <> 0
????ORDER BY spid
????--?????????????
????SELECT '????ID' = STR(spid?? 4)
?????? '????ID??' = CONVERT(CHAR(10)?? status)
?????? '??????ID' = STR(blocked?? 2)
?????? '?????????' = CONVERT(CHAR(10)?? hostname)
?????? '??????' = CONVERT(CHAR(10)?? SUSER_NAME(uid))
?????? '???????' = CONVERT(CHAR(10)?? DB_NAME(dbid))
?????? '??ó?????' = CONVERT(CHAR(10)?? program_name)
?????? '??????е?????' = CONVERT(CHAR(16)?? cmd)
?????? '???CPU???' = STR(cpu?? 7)
?????? 'IO' = STR(physical_io?? 7)
?????? '?????' = loginame
????FROM master..sysprocesses
????--where blocked = 0
????ORDER BY spid
????--blocked = 0???????????????ID??
????--?????????
????select ????id=a.req_spid
???????????=db_name(rsc_dbid)
??????????=case rsc_type when 1 then 'NULL ?????δ????'
????when 2 then '?????'
????when 3 then '???'
????when 4 then '????'
????when 5 then '??'
????when 6 then '?'
????when 7 then '??'
????when 8 then '???????'
????when 9 then 'RID???? ID)'
????when 10 then '??ó???'
????end
??????????id=rsc_objid
????????????=b.obj_name
??????rsc_indid
????from master..syslockinfo a left join #t b on a.req_spid=b.req_spid
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11