enrique_aeo
asked on
View lock information using Activity Monitor
I expertr. i need to know about
View lock information using Activity Monitor
Use the dynamic management view to view lock info
an url please or article,
View lock information using Activity Monitor
Use the dynamic management view to view lock info
an url please or article,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
sp_who is a simple command to look for locking transactions. Beyond that, here is a query that gives more information
from http://drsql.spaces.live.com/blog/cns!80677FB08B3162E4!906.entry
select login_name,
case des.transaction_isolation_level
when 0 then 'Unspecified' when 1 then 'ReadUncomitted'
when 2 then 'ReadCommitted' when 3 then 'Repeatable'
when 4 then 'Serializable' when 5 then 'Snapshot'
end as transaction_isolation_level,
request_session_id, resource_type, resource_subtype, request_mode, request_type, request_status, request_owner_type,
case when resource_type = 'object' then object_name(resource_associated_entity_id)
when resource_type = 'database' then db_name(resource_associated_entity_id)
when resource_type in ('key','page') then (select object_name(object_id) from sys.partitions where hobt_id = resource_associated_entity_id)
else cast(resource_associated_entity_id as varchar(20))
end
from sys.dm_tran_locks dtl
left outer join sys.dm_exec_sessions des
on dtl.request_session_id = des.session_id
where request_session_id <> @@spid
ASKER
Hello, I have understood my question isas I can generate a lock on the database?
do you want to generate the lock? well. the siblest way is:
begin tran
update table1 set.. where..
it will place exclusive locks on the updated records till you commit or rollback transaction
begin tran
update table1 set.. where..
it will place exclusive locks on the updated records till you commit or rollback transaction
ASKER
Hello, I made the query, but not blocking it generates no
begin tran
update HumanResources.Employee
set fechaRegistro = null
where fechaRegistro is null
begin tran
update HumanResources.Employee
set fechaRegistro = null
where fechaRegistro is null
open the second session and run
select * from humanresouces.employee
select * from humanresouces.employee
ASKER
first session
begin tran
update HumanResources.Employee
set fechaRegistro = null
where fechaRegistro is null
second session
select * from HumanResources.Employee
but not blocking it generates, i attached the results
resultSESSION.JPG
begin tran
update HumanResources.Employee
set fechaRegistro = null
where fechaRegistro is null
second session
select * from HumanResources.Employee
but not blocking it generates, i attached the results
resultSESSION.JPG
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That's right, the update did not update records, and i fixed it, thank you very much for your patience. Regards
ASKER