Oracle資料庫鎖表查詢以及解鎖進程,oracle瑙i攣

來源:互聯網
上載者:User

Oracle資料庫鎖表查詢以及解鎖進程,oracle瑙i攣
Oracle資料庫鎖表查詢以及解鎖進程

  Oracle資料庫操作中,我們有時會用到鎖表查詢以及解鎖和kill進程等操作,那麼這些操作是怎麼實現的呢?本文我們主要就介紹一下這部分內容。


  鎖表查詢的代碼有以下的形式:


  select count(*) from v$locked_object;


  select * from v$locked_object;


  查看哪個表被鎖


  1.select b.owner,b.object_name,a.session_id,a.locked_mode


  2. from v$locked_object a,dba_objects b


  3. where b.object_id = a.object_id;


  查看是哪個session引起的


  1. select b.username,b.sid,b.serial#,logon_time


  2.from v$locked_object a,v$session b


  3.where a.session_id = b.sid order by b.logon_time;


  殺掉對應進程


  執行命令:alter system kill session'1025,41';


  其中1025為sid,41為serial#.


  關於Oracle鎖表查詢及解鎖kill進程的相關知識就介紹到這裡了,希望本次的介紹能夠對您有所收穫!


相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.