马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622 。
您需要 登录 才可以下载或查看,没有帐号?注册
x
-
- set echo OFF rem 该脚本是用来检验系统中谁在锁表
- column username format a13
- column object_name format a10
- column osuser format a10
- column MACHINE format a10
- column LockType format a10
- select A.sid,
- b.serial#,
- decode(A.type,
- 'MR',
- 'Media Recovery',
- 'RT',
- 'Redo Thread',
- 'UN',
- 'User Name',
- 'TX',
- 'Transaction',
- 'TM',
- 'DML',
- 'UL',
- 'PL/SQL User Lock',
- 'DX',
- 'Distributed Xaction',
- 'CF',
- 'Control File',
- 'IS',
- 'Instance State',
- 'FS',
- 'File Set',
- 'IR',
- 'Instance Recovery',
- 'ST',
- 'Disk Space Transaction',
- 'TS',
- 'Temp Segment',
- 'IV',
- 'Library Cache Invalida-tion',
- 'LS',
- 'Log Start or Switch',
- 'RW',
- 'Row Wait',
- 'SQ',
- 'Sequence Number',
- 'TE',
- 'Extend Table',
- 'TT',
- 'Temp Table',
- 'Unknown') LockType,
- c.object_name,
- ---b.username,
- ---b.osuser,
- decode(a.lmode,
- 0,
- 'None',
- 1,
- 'Null',
- 2,
- 'Row-S',
- 3,
- 'Row-X',
- 4,
- 'Share',
- 5,
- 'S/Row-X',
- 6,
- 'Exclusive',
- 'Unknown') LockMode,
- B.MACHINE,
- D.SPID
- from v$lock a, v$session b, all_objects c, V$PROCESS D
- where a.sid = b.sid
- and a.type in ('TM', 'TX')
- and c.object_id = a.id1
- AND B.PADDR = D.ADDR
- ---order by username /
- ---使用这个教本把进程号和序列号查出来然后用alter system kill session '进程号,序列号' 这个命令把那个进程杀掉
-
复制代码 |