--oracle中檢視表是否被鎖 檢視表是否被鎖
select /*+ rule*/
a.sid, b.owner, object_name, object_type
from v$lock a, all_objects b
where type = 'tm'
and a.id1 = b.object_id;
--這樣可以把它殺掉
select sid,serial# from v$session where sid =1027;
alter system kill session '1027,14272';
select /*+ rule*/
a.sid, b.owner, object_name, object_type
from v$lock a, all_objects b
where type = 'tm'
and a.id1 = b.object_id;
select sid,serial# from v$session where sid =695;
alter system kill session '695,32099';
select s.sid, s.machine, o.object_name, l.oracle_username, l.locked_mode, s.osusesr, 'alter system kill session '''|| s.sid || ', '|| s.serial#||''';' as kill_command from v$locked_object l, v$session s, all_objects o where l.session_id=s.sid and l.object_id=o.object_id
select l.session_id sid, s.serial#, l.locked_mode,l.oracle_username,
l.os_user_name,s.machine, s.terminal, o.object_name, s.logon_time
from v$locked_object l, all_objects o, v$session s
where l.object_id = o.object_id
and l.session_id = s.sid
order by sid, s.serial# ;
alter system kill session '695';
select a.owner 方案名,
a.object_name 表名,
b.xidusn 回滾段號,
b.xidslot 槽號,
b.xidsqn 序列號,
b.session_id 鎖表session_id,
b.oracle_username 鎖表使用者名稱,
decode(d.type,
'xr',
'null',
'rs',
'ss(row-s)',
'cf',
'ss(row-s)',
'tm',
'table lock',
'pw',
'table lock',
'to',
'table lock',
'ts',
'table lock',
'rt',
'row lock',
'tx',
'row lock',
'mr',
's(share)',
null) 鎖定方式,
c.machine 使用者組,
c.terminal 機器名,
b.os_user_name 系統使用者名稱,
b.process 系統程序id,
decode(c.status, 'inactive', '不活動', 'active', '活動') 活動情況,
c.server,
c.sid,
c.serial#,
c.program 連線方式,
c.logon_time
from all_objects a, v$locked_object b, sys.gv_$session c, v$lock d
where (a.object_id = b.object_id)
and (b.process = c.process)
and c.sid = d.sid
and b.locked_mode = d.lmode
order by 1, 2;
plsql如何連線oracle
2.配置作業系統環境變數 nls lang simplified chinese china.zhs16gbk tns admin c oracleclient 3.進入instantclient 10 2資料夾,新建乙個network資料夾,並在network資料夾下新建admin資料夾,在adm...
PL SQL如何除錯Oracle儲存過程
分步閱讀 除錯過程對找到乙個存過的bug或錯誤是非常重要的,oracle作為一款強大的商業資料庫,其上面的存過少則10幾行,多則上千行,免不了bug的存在,存過上千行的話,找bug也很費力,通過除錯可以大大減輕這種負擔。找到想要除錯的存過,左鍵單擊選中該存過 圖中位置1 然後右鍵單擊該存過,從彈出選...
PL SQL如何除錯Oracle儲存過程
除錯過程對找到乙個存過的bug或錯誤是非常重要的,oracle作為一款強大的商業資料庫,其上面的存過少則10幾行,多則上千行,免不了bug的存在,存過上千行的話,找bug也很費力,通過除錯可以大大減輕這種負擔。步驟閱讀 2找到想要除錯的存過,左鍵單擊選中該存過 圖中位置1 然後右鍵單擊該存過,從彈出...