标签:style blog http color 使用 io strong 数据
lock table in [row share][row exclusive][share][share row exclusive][exclusive] mode;
grant select on v_$mystat to hr;
select sid from v$mystat where rownum=1;
update employees set last_name=last_name||‘a‘ where department_id=60;
select xidusn,xidslot,xidsqn,status from v$transaction;
select sid,type,id1,id2, decode(lmode,0,‘None‘,1,‘Null‘,2,‘Row share‘,3,‘Row Exclusive‘,4,‘Share‘,5,‘Share Row Exclusive‘,6,‘Exclusive‘) lock_mode, decode(request,0,‘None‘,1,‘Null‘,2,‘Row share‘,3,‘Row Exclusive‘,4,‘Share‘,5,‘Share Row Exclusive‘,6,‘Exclusive‘) request_mode, block from v$lock where sid=&sid;
select object_name from dba_objects where object_id=&object_id;
select trunc(393249/power(2,16)) as undo_blk#,bitand(393249,to_number(‘ffff‘,‘xxxx‘)) + 0 as slot# from dual;
select sid from v$mystat where rownum=1;
update employees set last_name=last_name||‘b‘ where department_id=60;
select sid, type, id1, id2, decode(lmode,0,‘None‘,1,‘Null‘,2,‘Row share‘,3,‘Row Exclusive‘,4,‘Share‘,5,‘Share Row Exclusive‘,6,‘Exclusive‘) lock_mode, decode(request,0,‘None‘,1,‘Null‘,2,‘Row share‘,3,‘Row Exclusive‘,4,‘Share‘,5,‘Share Row Exclusive‘,6,‘Exclusive‘) request_mode,
block from v$lock where sid in(&sid1,&sid2) order by sid;
select sid from v$mystat where rownum=1;
update employees set last_name=last_name||‘c‘ where department_id=60;
select sid,type, decode(request,0,‘None‘,1,‘Null‘,2,‘Row share‘,3,‘Row Exclusive‘,4,‘Share‘,5,‘Share Row Exclusive‘,6,‘Exclusive‘) request_mode from v$enqueue_lock where sid in(&sid1,&sid2);
select a.sid blocker_sid, a.serial#, a.username as blocker_username, b.type, decode(b.lmode,0,‘None‘,1,‘Null‘,2,‘Row share‘,3,‘Row Exclusive‘,4,‘Share‘,5,‘Share Row Exclusive‘,6,‘Exclusive‘) lock_mode, b.ctime as time_held,c.sid as waiter_sid, decode(c.request,0,‘None‘,1,‘Null‘,2,‘Row share‘,3,‘Row Exclusive‘,4,‘Share‘,5,‘Share Row Exclusive‘,6,‘Exclusive‘) request_mode, c.ctime time_waited from v$lock b, v$enqueue_lock c, v$session a where a.sid = b.sid and b.id1= c.id1(+) and b.id2 = c.id2(+) and c.type(+) = ‘TX‘ and b.type = ‘TX‘ and b.block = 1 order by time_held, time_waited;
alter system kill session ‘&sid,&serial‘;
select sid from v$mystat where rownum=1;
update employees set last_name=last_name||‘a‘ where department_id=60; update departments set department_name=‘unknow‘ where department_id=10; update locations set city=‘unknown‘ where location_id=1100;
select sid, type, id1, id2, decode(lmode,0,‘None‘,1,‘Null‘,2,‘Row share‘,3,‘Row Exclusive‘,4,‘Share‘,5,‘Share Row Exclusive‘,6,‘Exclusive‘) lock_mode, decode(request,0,‘None‘,1,‘Null‘,2,‘Row share‘,3,‘Row Exclusive‘,4,‘Share‘,5,‘Share Row Exclusive‘,6,‘Exclusive‘) request_mode,block from v$lock where sid=&sid;
select name, value from v$parameter where name in(‘transactions‘,‘dml_locks‘);
select resource_name as "R_N", current_utilization as "C_U", max_utilization as "M_U", initial_allocation as "I_U" from v$resource_limit where resource_name in(‘transactions‘,‘dml_locks‘);
select sid from v$mystat where rownum=1; update employees set last_name=last_name||‘a‘ where employee_id=100
select sid from v$mystat where rownum=1; update employees set last_name=last_name||‘b‘ where employee_id=101;
update employees set last_name=last_name||‘c‘ where employee_id=101;
update employees set last_name=last_name||‘d‘ where employee_id=100;
相克军_Oracle体系_随堂笔记014-锁 latch,lock,布布扣,bubuko.com
相克军_Oracle体系_随堂笔记014-锁 latch,lock
标签:style blog http color 使用 io strong 数据
原文地址:http://www.cnblogs.com/jyzhao/p/3819381.html