oracle数据库查看用户锁表及对表解锁的sql语句

2011年03月15日 其他资源 19条评论 阅读53345次

oracle数据库查看用户锁表及对表解锁的sql语句
大型项目中很多人使用一个用户名登录oracle服务器,很多人都有可能对同一张表进行各种操作,不知不觉地就会出现锁表的情况。如何解决此问题呢?据老手说很简单,下面就是使用sql语句解决的方法。
首先执行一下语句查看是哪个进程和序列锁住了表
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

通过以上sql就可以知道哪个进程、序列,oracle用户名、操作系统用户名、表名、锁表模式几个字段

下面一步就是将改锁表的进程和序列杀掉了,执行下面的语句即可。
alter system kill session '1020,38953' --(1020,就是执行第一步语句得到的sid字段值,38953就是serial#字段值)

分享本文至:

WRITTEN BY

avatar
本文标签:oraclesql
看了本文是不是觉得很赞,那就赶紧点击下面按钮分享给身边的朋友吧!

19 条评论

  1. <a href="http://www.rokettubemi.com/boston-red-sox-red-jersey-nfli">boston red sox red jersey</a> <a href="http://www.cumjacket.com/authentic-corey-seager-jersey-nflh">authentic corey seager jersey</a> <a href="http://www.hzrdcraft.com/nike-huarache-high-rouge-orange-shoesf">nike huarache high rouge orange</a> <a href="http://www.clubrockorg.com/neon-orange-polo-shirt-poloh">neon orange polo shirt</a> <a href="http://www.giaiphapdautu.com/adidas-zx-flux-b34909-sort-gr%C3%A5-foota">adidas zx flux b34909 sort gr氓</a> <a href="http://www.spreymax.com/adidas-porsche-design-blau-gr%C3%BCn-runninga">adidas porsche design blau gr眉n</a>
    profondofud http://www.profondofud.com/

  2. <a href="http://www.anilcagatay.com/nike-tanjun-gs-noir-diamond-trainersce">nike tanjun gs noir diamond</a> <a href="http://www.glpwindsor.com/adidas-superstar-alle-schwarz-herren-schuhek">adidas superstar alle schwarz herren</a> <a href="http://www.easytoberaw.com/herre-nike-sb-stefan-janoski-max-gr%C3%A5-guld-scarpeg">herre nike sb stefan janoski max gr氓 guld</a> <a href="http://www.couponrider.com/herren-asics-gel-quantum-360-himmelblau-orange-kurpesb">herren asics gel quantum 360 himmelblau orange</a> <a href="http://www.boomcogames.com/hombres-nike-air-zoom-structure-18-negro-rojo-gris-zapatosk">hombres nike air zoom structure 18 negro rojo gris</a> <a href="http://www.roostercole.com/femmes-air-jordan-retro-7-noir-rose-runningc">femmes air jordan retro 7 noir rose</a>
    auroragenri http://www.auroragenri.com/

  3. <a href="http://www.tkbelazig.com/nike-zoom-structure-20-dam%C3%A4nner-wei%C3%9F-schuhel">nike zoom structure 20 dam盲nner wei脽</a> <a href="http://www.swiftgrocer.com/femmes-air-jordan-retro-1-blanc-rose-chaussuresq">femmes air jordan retro 1 blanc rose</a> <a href="http://www.warrnamboolag.com/nike-air-max-90-em-oro-naranja-zapatosl">nike air max 90 em oro naranja</a> <a href="http://www.paineesq.com/kvinders-nike-roshe-run-hyp-gr%C3%B8n-lyser%C3%B8d-skoj">kvinders nike roshe run hyp gr酶n lyser酶d</a> <a href="http://www.gemmatyndall.com/kvinners-nike-kd-7-all-bl%C3%A5-obuvi">kvinners nike kd 7 all bl氓</a> <a href="http://www.cestreaming.com/nike-air-max-97-naranja-blanco-zapatosp">nike air max 97 naranja blanco</a>
    shetablink http://www.shetablink.com/

  4. <a href="http://www.videogue.com/rhea-mini-logo-backpack-michael-kors-mkh">rhea mini logo backpack michael kors</a> <a href="http://www.actuelvet.com/nike-air-jordan-retro-6-svart-obuvi">nike air jordan retro 6 svart</a> <a href="http://www.jstreetdoc.com/adidas-prossoator-cup-scarpek">adidas prossoator cup</a> <a href="http://www.rightcardeals.com/adidas-stan-smith-white-gold-silver-shoesi">adidas stan smith white gold silver</a> <a href="http://www.wearesmashed.com/boys-negro-nike-shox-zapatosi">boys negro nike shox</a> <a href="http://www.icecardonline.com/nike-mercurial-superfly-fg-gr%C3%B8n-bl%C3%A5-sort-skoh">nike mercurial superfly fg gr酶n bl氓 sort</a>
    nike kaishi schwarz http://www.recspokane.com/nike-kaishi-schwarz-schuhei

  5. <a href="http://www.townyplay.com/air-jordan-3-true-bl%C3%A5-gs-skoh">air jordan 3 true bl氓 gs</a> <a href="http://www.djpunjabii.com/tutti-nero-nike-air-max-90-hyperfuse-scarpei">tutti nero nike air max 90 hyperfuse</a> <a href="http://www.avsomurie.com/rosso-verde-maschio-adidas-ultra-boost-scarpe-scarpej">rosso verde maschio adidas ultra boost scarpe</a> <a href="http://www.circusveil.com/authentic-houston-colt-45s-jersey-nflh">authentic houston colt 45s jersey</a> <a href="http://www.laconiaoil.com/mahogany-coach-wallet-coachh">mahogany coach wallet</a> <a href="http://www.hurizmir.com/nike-mercurial-superfly-ag-bianca-nero-rosa-scarpei">nike mercurial superfly ag bianca nero rosa</a>
    lolalolincoln http://www.lolalolincoln.com/

  6. <a href="http://www.atrapaniapp.com/michael-kors-jet-set-travel-small-tote-bag-mkh">michael kors jet set travel small tote bag</a> <a href="http://www.maplebeyond.com/nike-lebron-soldier-9-rosa-r%C3%B8d-obuvi">nike lebron soldier 9 rosa r酶d</a> <a href="http://www.collisionsix.com/nike-air-huarache-verde-bianca-scarpej">nike air huarache verde bianca</a> <a href="http://www.todololitas.com/nike-air-max-90-independence-day-navy-blue-shoesh">nike air max 90 independence day navy blue</a> <a href="http://www.jcwjrlaw.com/kobe-9-p%C3%BArpura-zapatosk">kobe 9 p煤rpura</a> <a href="http://www.vstsblog.com/air-jordan-retro-4-plata-brojo-zapatosp">air jordan retro 4 plata brojo</a>
    zotorrent http://www.zotorrent.com/

  7. <a href="http://www.maytorrent.com/nike-air-huarache-hyper-punch-svart-rosa-yeezy-obuvk">nike air huarache hyper punch svart rosa yeezy</a> <a href="http://www.gplandiet.com/vibram-fivefingers-kso-menn-gr%C3%A5-obuvi">vibram fivefingers kso menn gr氓</a> <a href="http://www.mizenbouche.com/nike-roshe-run-nm-br-hombres-amarillo-zapatosl">nike roshe run nm br hombres amarillo</a> <a href="http://www.owenandfarney.com/nike-tanjun-maschio-bianca-scarpeh">nike tanjun maschio bianca</a> <a href="http://www.escortsinoz.com/nike-roshe-run-women-floral-light-blue-pink-shoesk">nike roshe run women floral light blue pink</a> <a href="http://www.itsallfetish.com/ray-ban-rb4165-justin-622-55-sunglassesh">ray ban rb4165 justin 622 55</a>
    alinakrocheva http://www.alinakrocheva.com/

  8. <a href="http://www.ankaraoyunevi.com/adidas-superstar-schuhe-dam%C3%A4nner-wei%C3%9F-schuhek">adidas superstar schuhe dam盲nner wei脽</a> <a href="http://www.iotlsebring.com/san-antonio-spurs-starter-nba-mens-legend-hockey-jersey-nflh">san antonio spurs starter nba mens legend hockey jersey</a> <a href="http://www.joshsingleton.com/nike-tiempo-legend-v-r%C3%B8d-hvit-obuvi">nike tiempo legend v r酶d hvit</a> <a href="http://www.amesecolombia.com/green-yellow-mens-adidas-eqt-support-shoes-shoesj">green yellow mens adidas eqt support shoes</a> <a href="http://www.flatshotgame.com/men-flyknit-air-max-2016-fire-red-black-shoesl">men flyknit air max 2016 fire red black</a> <a href="http://www.myrumpun.com/ralph-lauren-lace-swimsuit-issue-poloh">ralph lauren lace swimsuit issue</a>
    prodomfactory http://www.prodomfactory.com/

  9. avatar bladeid

    <a href="http://www.jaramiel.com/bambini-scarpe-viola-rosso-schuhed">bambini scarpe viola rosso</a> <a href="http://www.connectbsl.com/nike-air-max-penny-1-varsity-rojo-chaussuresd">nike air max penny 1 varsity rojo</a> <a href="http://www.aradefemalhas.com/air-jordan-4-retro-og-hvit-cemennt-for-salg-obuvf">air jordan 4 retro og hvit cemennt for salg</a> <a href="http://www.funyari.com/herren-asics-gel-quantum-360-orange-blau-kurpese">herren asics gel quantum 360 orange blau</a> <a href="http://www.cubanosocial.com/nike-air-jordan-true-flight-blanc-bleu-jaune-schuhed">nike air jordan true flight blanc bleu jaune</a> <a href="http://www.mrtuckshop.com/free-flyknit-4.0-gr%C3%A5-kit-butyg">free flyknit 4.0 gr氓 kit</a>
    [url=http://www.bladeid.com/]bladeid[/url]

  10. avatar nike shox nz custom

    <a href="http://www.dalemarcell.com/clippers-3-chris-paul-blue-revolution-30-stitched-nba-jersey-nflt">clippers 3 chris paul blue revolution 30 stitched nba jersey</a> <a href="http://www.chitrapuri.com/mens-nike-dallas-cowboys-97-taco-charlton-game-white-nfl-jersey-nflu">mens nike dallas cowboys 97 taco charlton game white nfl jersey</a> <a href="http://www.thetabletmac.com/air-jordan-11-noir-varsity-rouge-blanc-kurpesc">air jordan 11 noir varsity rouge blanc</a> <a href="http://www.lukulosdekalb.com/nike-lebron-15-purple-germany-shoeso">nike lebron 15 purple germany</a> <a href="http://www.eklipsepro.com/nike-flyknit-lunar1-gr%C3%A5-r%C3%B8d-hvid-obuvb">nike flyknit lunar1 gr氓 r酶d hvid</a> <a href="http://www.essebicinema.com/oakley-sunglasses-eyewear-graphics-sunglassesd">oakley sunglasses eyewear graphics</a>
    nike shox nz custom http://www.embarquelibre.com/nike-shox-nz-custom-trainersd

  11. avatar 天津伸缩门

    数据库挺复杂的

  12. avatar shoejordan

    直接操作表 呼呼

  13. avatar payday loan online

    惊人的博客!你有任何的提示和暗示为有抱负的作家?我打算尽快开始我自己的网站,但我有点失去一切。你会推荐一个像WordPress的免费平台开始,或去一个支付选项?有这么多的选择,在那里,我完全混淆..任何想法?多谢了!

  14. avatar 仪网

    专业!

  15. avatar 电视棒

    学习才能进步

  16. avatar nikeshoxshoes

    试一试

  17. avatar 新型制砂机

    学习了啊  回头我试试灵不灵

  18. avatar 谈话死

    新博上线,期待博主回访!

  19. avatar 莱步淘淘网

    学习了,不一定会用,看看也好的

欢迎留言




用户登录

sitemap