查看别锁表 select request_session_id spid,OBJECT_NAME(resource_associated_entity_id) tableName from sys.dm_tran_locks where resource_type='OBJECT' 解锁方式: declare @spid int Set @spid = --锁表进程 declare @sql varchar() set @sql='kill '+cast(@spid as varchar) ex…
1.不同数据库之间复制表的数据的方法: 当表目标表存在时: insert into 目的数据库..表 select * from 源数据库..表 当目标表不存在时: select * into 目的数据库..表 from 源数据库..表 2. 查看是否锁表 show OPEN TABLES where In_use > 0;…
① 查看用户锁表 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 where ao.object_id = lo.object_id and lo.session_id = sess.sid ② 解锁语句 alter system kil…
步骤1.查看锁表进程 2.杀死进程 --1.查询锁表进程 spid.和被锁表名称 tableName select request_session_id spid,OBJECT_NAME(resource_associated_entity_id) tableName from sys.dm_tran_locks where resource_type='OBJECT' and OBJECT_NAME(resource_associated_entity_id) is not nu…
查看 哪些表 被锁了 SELECT object_name, machine, s.sid, s.serial# FROM gv$locked_object l, dba_objects o, gv$session s WHERE l.object_id = o.object_id AND l.session_id = s.sid; 解除锁定: --alter system kill session 'sid, serial#'; ALTER system kill session '23, 1…
--查出sid,serial#select b.username,b.sid,b.serial#,logon_time from v$locked_object a,v$session b where a.session_id = b.sid order by b.logon_time;--杀掉进程 sid,serial#alter system kill session'161,7297'; 参考 https://www.cnblogs.com/XQiu/p/5212787.html…