1 / 6
文档名称:

数据库锁表与解锁.docx

格式:docx   大小:16KB   页数:6页
下载后只包含 1 个 DOCX 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

数据库锁表与解锁.docx

上传人:sunhongz9 2022/3/31 文件大小:16 KB

下载得到文件列表

数据库锁表与解锁.docx

相关文档

文档介绍

文档介绍:精选文档
5
数据库锁表与解锁
、 mysql
锁定表:L0CKTABLE3bl_name {READ| WRITE},[ tbl_name {READ| WRITE},…]
解锁表: UNL0CK TABLES
SELECT DISTINCT ID, , # V$DB_OBJECT_CACHE OC, V$OBJECT_DE PENDENCY OD, DBA_KGLLOCK W,
V$SESSION S,
V$PROCESS P
WHERE =
AND =
AND =
AND =
AND P. ADDR = ADDR
AND = UPP ER('drag_data_from_lcam');
Oracle的锁表与解锁
SELECT /*+ rule */ ,
decode( pe,'TM','TABLE LOCK',
精选文档
4
'TX','ROW LOCK',
NULL) LOCK_LEVEL,
ner, name, ype,
,#, nal, ne,s. program,
FROM v$session s,v$lock l,dba_objects o
WHERE =
AND = (+)
AND is NOT Null
--kill session 语句 (说明:下面的50是查询结果中sid字段值,492是
serial#字段值)
alter system kill session'50,492'; (需要 dba 权限)
--以下几个为相关表
SELECT * FROM v$lock;
SELECT * FROM v$sqlarea;
SELECT * FROM v$sessio n;
SELECT * FROM v$p rocess ;
SELECT * FROM v$locked_object;
SELECT * FROM all_objects;
SELECT * FROM v$session_wait;
-- object名
SELECT on_id sid, #, , name,
name, ne, in al, name, on _time
FROM v$locked_object l, all_objects o, v$sessi on s
WHERE =
AND =