Mysql、Oracle锁表处理

MySql解锁方式

1 # 1. 查看当前数据库锁表的情况 
2 SELECT * FROM information_schema.INNODB_TRX; 
3 # 2. 杀掉查询结果中锁表的trx_mysql_thread_id 
4 kill trx_mysql_thread_id

Oracle解锁方式

1 # 查看被锁的表
2 select b.owner, b.object_name, a.session_id, a.locked_mode from v$locked_object a, dba_objects b where b.OBJECT_ID = a.OBJECT_ID
3 # 查看连接的进程
4 select sid, serial#, username, osuser from v$session; 
5 # 杀掉进程 sid, serial#
6 alter system kill session '678,983';
posted @ 2022-02-07 09:27  马永猛  阅读(69)  评论(0编辑  收藏  举报