Oracle数据库知识库
查看是否有表被锁住:select * from v$locked_object;
查看详细的信息: select sess.sid, sess.serial#, lo.oracle_username, lo.os_user_name, ao.object_name, lo.locked_mode from v$locked_object lo, dba_objects ao, v$session sess, v$process p where ao.object_id = lo.object_id and lo.session_id = sess.sid;
结束掉锁住的表 alter system kill session ‘1327,42869’;
select 'alter system kill session '''||sess.sid||','||sess.serial#||''';' from v$locked_object lo, dba_objects ao, v$session sess where ao.object_id = lo.object_id and lo.session_id = sess.sid
Mysql数据库知识库
1:查看当前的事务 SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX; 杀死进程id,就是上面命令的trx_mysql_thread_id列 kill 线程ID; 2:查看当前锁定的事务 SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS; 3:查看当前等锁的事务 SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS;
标签:sess,object,lo,数据库,知识库,ao,session,id From: https://www.cnblogs.com/vincentYw/p/17668493.html