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

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

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
看了本文是不是觉得很赞,那就赶紧点击下面按钮分享给身边的朋友吧!

26 条评论

  1. <a href="http://www.artbyzona.com/nike-lunarglide-6-hombres-negro-guys-scarpee">nike lunarglide 6 hombres negro guys</a> <a href="http://www.classiccarslb.com/jordan-4-noir-for-vente-obuvc">jordan 4 noir for vente</a> <a href="http://www.seonnagittens.com/nike-free-3.0-v5-cool-gris-jordans-scarpea">nike free 3.0 v5 cool gris jordans</a> <a href="http://www.lbclubmitu.com/herre-nike-air-max-tailwind-7-orange-lyser%C3%B8d-chaussuresg">herre nike air max tailwind 7 orange lyser酶d</a> <a href="http://www.mntartanday.com/nike-zoom-winflo-3-rosa-gull-kurpesf">nike zoom winflo 3 rosa gull</a> <a href="http://www.adanazuzu.com/nike-roshe-run-hyp-orange-gelb-obuva">nike roshe run hyp orange gelb</a>
    galinaontop http://www.galinaontop.com/

  2. <a href="http://www.agichipay.com/nike-free-5.0-dam%C3%A4nner-lila-orange-chaussuresa">nike free 5.0 dam盲nner lila orange</a> <a href="http://www.millsbulb.com/16-game-joe-montana-san-francisco-49ers-jersey-breast-cancer-awareness-pink-nflf">16 game joe montana san francisco 49ers jersey breast cancer awareness pink</a> <a href="http://www.hamshrd.com/nike-free-flyknit-4.0-brown-silver-runningg">nike free flyknit 4.0 brown silver</a> <a href="http://www.lroyroofing.com/35-authentic-grant-hill-detroit-pistons-jersey-mens-adidas-nba-purple-throwback-1995-all-nflv">35 authentic grant hill detroit pistons jersey mens adidas nba purple throwback 1995 all</a> <a href="http://www.golfbodyshop.com/air-max-2014-navy-trainersa">air max 2014 navy</a> <a href="http://www.yufnsyb.com/nike-hyperdunk-2015-mid-lyser%C3%B8d-brun-scarped">nike hyperdunk 2015 mid lyser酶d brun</a>
    milapioffret http://www.milapioffret.com/

  3. <a href="http://www.cheapcoatsfr.com/nike-air-max-95-svart-mono-prm-schuhea">nike air max 95 svart mono prm</a> <a href="http://www.mylinkstv.com/nike-free-run-2-gelb-himmelblau-scarpeb">nike free run 2 gelb himmelblau</a> <a href="http://www.phxfam.com/womens-nike-huarache-utility-black-denmark-shoeso">womens nike huarache utility black denmark</a> <a href="http://www.shanibazaar.com/nike-flyknit-lunar-1-m%C3%A6nd-r%C3%B8d-guld-kurpesb">nike flyknit lunar 1 m忙nd r酶d guld</a> <a href="http://www.imannequins.com/nike-air-max-95-le-toddlers-zapatost">nike air max 95 le toddlers</a> <a href="http://www.irentevent.com/girls-high-converse-shoesz">girls high converse</a>
    puurderleven http://www.puurderleven.com/

  4. <a href="http://www.smsteachers.com/nike-roshe-run-fb-oyster-grigio-rosso-scarpee">nike roshe run fb oyster grigio rosso</a> <a href="http://www.viviancontigo.com/salomon-xt-hawk-s%C3%B8lv-butya">salomon xt hawk s酶lv</a> <a href="http://www.drlunaworld.com/nike-air-max-90-rose-guld-kvinders-oxfords-chaussuresf">nike air max 90 rose guld kvinders oxfords</a> <a href="http://www.eatisrael.com/roshe-run-blanc-hot-lava-butya">roshe run blanc hot lava</a> <a href="http://www.ebikingcenter.com/nike-blazer-pale-rosa-schuheg">nike blazer pale rosa</a> <a href="http://www.eulatestnews.com/ralph-lauren-hommes-bleu-shirt-polo-polo-in-oxford-pique-slim-fit-polou">ralph lauren hommes bleu shirt polo polo in oxford pique slim fit</a>
    johnklymshyn http://www.johnklymshyn.com/

  5. <a href="http://www.freizeittrend.com/adidas-zx-flux-xeno-glow-in-the-dark-skob">adidas zx flux xeno glow in the dark</a> <a href="http://www.instanalo.com/diamond-supply-co-black-hat-hatb">diamond supply co black hat</a> <a href="http://www.olafhuth.com/nike-cortez-shorts-jogger-runninge">nike cortez shorts jogger</a> <a href="http://www.pecanfirewood.com/mennns-nike-free-run-5.0-v4-oransje-gr%C3%A5-schuhea">mennns nike free run 5.0 v4 oransje gr氓</a> <a href="http://www.ezzolawaz.com/nike-zoom-kobe-7-galaxy-for-salg-scarpec">nike zoom kobe 7 galaxy for salg</a> <a href="http://www.suchmeldungen.com/nike-air-max-2019-green-uk-shoeso">nike air max 2019 green uk</a>
    lapthelakes http://www.lapthelakes.com/

  6. <a href="http://www.opendekalbinc.com/nike-air-max-2014-dark-gr%C3%A5-scarpeg">nike air max 2014 dark gr氓</a> <a href="http://www.playhousecash.com/nike-free-rn-olive-verde-giant-obuvd">nike free rn olive verde giant</a> <a href="http://www.realcoolclub.com/yeezy-boost-550-amarillo-rojo-scarpea">yeezy boost 550 amarillo rojo</a> <a href="http://www.sfgchina.com/air-jordan-1-nero-og-schuhec">air jordan 1 nero og</a> <a href="http://www.synergysimple.com/tress-way-washington-redskins-womens-game-nike-jersey-white-nflr">tress way washington redskins womens game nike jersey white</a> <a href="http://www.xpressvod.com/nike-wesley-woodyard-navy-blue-backer-tennessee-titans-nfl-59-t-shirt-nflx">nike wesley woodyard navy blue backer tennessee titans nfl 59 t shirt</a>
    hawkmatix http://www.hawkmatix.com/

  7. <a href="http://www.chipcolley.com/nike-air-max-thea-wolf-grigio-bianca-kurpesf">nike air max thea wolf grigio bianca</a> <a href="http://www.golfthebeach.com/hommes-nike-air-max-2015-gris-rouge-schuheg">hommes nike air max 2015 gris rouge</a> <a href="http://www.krzysztofkrol.com/nike-air-max-2015-gr%C3%B8nn-gul-schuheb">nike air max 2015 gr酶nn gul</a> <a href="http://www.ondecktrivia.com/new-balance-m998br-made-in-usa-marrone-nero-chaussuresd">new balance m998br made in usa marrone nero</a> <a href="http://www.gopinksoccer.com/lebron-12-low-bianca-oro-butyg">lebron 12 low bianca oro</a> <a href="http://www.iamfitshop.com/nike-hyperdunk-2014-low-barato-scarpea">nike hyperdunk 2014 low barato</a>
    uffelfinn http://www.uffelfinn.com/

  8. <a href="http://www.miendiation.com/air-jordan-reveal-verde-bianca-kurpesb">air jordan reveal verde bianca</a> <a href="http://www.powfarm.com/light-green-womens-converse-zapatost">light green womens converse</a> <a href="http://www.nongmobacon.com/custom-painted-converse-uk-shoesz">custom painted converse uk</a> <a href="http://www.rentalloka.com/adidas-pr%C3%B8dator-fingersave-alleround-schuheb">adidas pr酶dator fingersave alleround</a> <a href="http://www.casamentosweb.com/nike-mens-laadrian-waddle-limited-gray-jersey-new-england-patriots-nfl-68-rush-drift-fashion-nflu">nike mens laadrian waddle limited gray jersey new england patriots nfl 68 rush drift fashion</a> <a href="http://www.perheopas.com/old-adidas-tubular-skou">old adidas tubular</a>
    bootsoffprice http://www.bootsoffprice.com/

  9. <a href="http://www.ibrahimvdb.com/new-balance-1010-skor">new balance 1010</a> <a href="http://www.reppardwalker.com/stephen-curry-gold-jersey-nflr">stephen curry gold jersey</a> <a href="http://www.altekkozmetik.com/oakland-raiders-15-michael-crabtree-olive-2017-salute-to-service-limited-jersey-nflv">oakland raiders 15 michael crabtree olive 2017 salute to service limited jersey</a> <a href="http://www.sanvalmotor.com/navy-blue-shirt-ralph-lauren-polor">navy blue shirt ralph lauren</a> <a href="http://www.daunkatuk.com/billig-nike-kobe-9-low-menns-r%C3%B8d-trainersce">billig nike kobe 9 low menns r酶d</a> <a href="http://www.tzoning.com/polarized-tortoise-ray-ban-wayfarer-sunglassesr">polarized tortoise ray ban wayfarer</a>
    alexisellen http://www.alexisellen.com/

  10. <a href="http://www.exomotors.com/basket-adidas-originals-zx-750-skow">basket adidas originals zx 750</a> <a href="http://www.perlai.com/mackage-jacket-sale-toronto-mackager">mackage jacket sale toronto</a> <a href="http://www.vloansltd.com/billig-nike-free-5.0-2015-dam%C3%A4nner-silber-skod">billig nike free 5.0 2015 dam盲nner silber</a> <a href="http://www.alloweducates.com/elite-jaylen-watkins-youth-jersey-philadelphia-eagles-37-alternate-black-nflc">elite jaylen watkins youth jersey philadelphia eagles 37 alternate black</a> <a href="http://www.ozkaratasorg.com/hermes-belt-website-beltr">hermes belt website</a> <a href="http://www.myshinnies.com/oakley-oil-rig-sunglasses-brown-frame-brown-lens-cheap-sunglassesb">oakley oil rig sunglasses brown frame brown lens cheap</a>
    epointsclub http://www.epointsclub.com/

  11. <a href="http://www.nfabag21.com/kobe-5-tout-star-chaussures-butyc">kobe 5 tout star chaussures</a> <a href="http://www.ui94pysr.com/nike-tiempo-legend-vi-fg-fluorescent-gr%C3%B8n-sort-scarpeb">nike tiempo legend vi fg fluorescent gr酶n sort</a> <a href="http://www.j55wlfhw.com/nike-free-3.0-kvinders-hvid-himmelbl%C3%A5-kurpesf">nike free 3.0 kvinders hvid himmelbl氓</a> <a href="http://www.2o14lqiq.com/air-max-90-rosso-velvet-glove-scarpea">air max 90 rosso velvet glove</a> <a href="http://www.43mpu1b4.com/gr%C3%A5-nike-roshe-laces-obuvb">gr氓 nike roshe laces</a> <a href="http://www.iwayvx85.com/nike-free-run-2-hvit-and-gr%C3%A5-chaussuresd">nike free run 2 hvit and gr氓</a>
    s5h5f9lc http://www.s5h5f9lc.com/

  12. <a href="http://www.pulselocums.com/chicago-blackhawks-8-bill-mosienko-green-salute-to-service-stitched-nhl-jersey-nflg">chicago blackhawks 8 bill mosienko green salute to service stitched nhl jersey</a> <a href="http://www.topangafire.com/cheap-air-max-97-sale-skoa">cheap air max 97 sale</a> <a href="http://www.eniszczarki.com/blue-pink-womens-nike-dunk-shoes-runningd">blue pink womens nike dunk shoes</a> <a href="http://www.synthcourses.com/nike-air-force-1-flyknit-high-herre-s%C3%B8lv-runninge">nike air force 1 flyknit high herre s酶lv</a> <a href="http://www.chatavalanche.com/purple-sacramento-kings-mitchell-and-ness-nba-solid-snapback-new-era-cap-hate">purple sacramento kings mitchell and ness nba solid snapback new era cap</a> <a href="http://www.katjehempel.com/nike-sb-stefan-janoski-max-hommes-vert-trainersg">nike sb stefan janoski max hommes vert</a>
    torsenli http://www.torsenli.com/

  13. <a href="http://www.haubenblick.com/nike-air-max-95-white-orange-skoc">nike air max 95 white orange</a> <a href="http://www.drketogenic.com/bon-march%C3%A9-nike-free-3.0-v2-femmes-or-skob">bon march茅 nike free 3.0 v2 femmes or</a> <a href="http://www.rvandco.com/adidas-superstar-2-light-blau-shoesv">adidas superstar 2 light blau</a> <a href="http://www.evenbayhout.com/nike-flyknit-lunar-1-pink-silver-runninga">nike flyknit lunar 1 pink silver</a> <a href="http://www.harryselite.com/ray-ban-arctic-cats-sunglassesr">ray ban arctic cats</a> <a href="http://www.clgfamilies.com/reebok-gl-6000-white-shoesv">reebok gl 6000 white</a>
    urevomedia http://www.urevomedia.com/

  14. <a href="http://www.sfhires.com/billig-new-balance-420-kvinners-s%C3%B8lv-trainersa">billig new balance 420 kvinners s酶lv</a> <a href="http://www.myenergytruth.com/bvlgari-b.zero1-small-white-gold-earrings-jewelryr">bvlgari b.zero1 small white gold earrings</a> <a href="http://www.klarinettino.com/blue-yellow-mens-nike-air-force-1-flyknit-low-shoes-sneakerf">blue yellow mens nike air force 1 flyknit low shoes</a> <a href="http://www.printonlypros.com/north-face-jacket-fleece-lined-northfacer">north face jacket fleece lined</a> <a href="http://www.ralfwentz.com/gold-disney-pandora-charms-pandorar">gold disney pandora charms</a> <a href="http://www.hotelsuixlara.com/pandora-3-pearl-ring-pandorar">pandora 3 pearl ring</a>
    webgiganten http://www.webgiganten.com/

  15. <a href="http://www.matkailuvarkaus.net/nike-lunarglide-6-femmes-bleu-ciel-rose-butye">nike lunarglide 6 femmes bleu ciel rose</a> <a href="http://www.medmanage.net/asics-gel-kayano-21-performance-l%C3%B8ping-sko-kvinners-day-schuhea">asics gel kayano 21 performance l酶ping sko kvinners day</a> <a href="http://www.medsample.net/nike-darwin-rotdit-user-chaussuresa">nike darwin rotdit user</a> <a href="http://www.metacommunities.net/nike-dunk-sky-high-wedge-rosso-and-nero-obuva">nike dunk sky high wedge rosso and nero</a> <a href="http://www.metalinquisition.net/kyrie-2-jaune-vert-vtoutey-butyd">kyrie 2 jaune vert vtoutey</a> <a href="http://www.michigangolfguide.net/dam%C3%A4nner-nike-free-tr-fit-marine-scarpec">dam盲nner nike free tr fit marine</a>
    [url=http://www.casatienda.net/]casatienda[/url]

  16. avatar collegeprepcoach

    <a href="http://www.bursatiket.net/nike-hyperdunk-2014-low-amarillo-verde-kurpesd">nike hyperdunk 2014 low amarillo verde</a> <a href="http://www.buxpix.net/zx-flux-xeno-sort-kurpesc">zx flux xeno sort</a> <a href="http://www.buyggauto.net/nike-hypervenom-phantom-negro-rosado-scarpec">nike hypervenom phantom negro rosado</a> <a href="http://www.carlinandcompany.net/jordan-4-money-gr%C3%B8n-schuhee">jordan 4 money gr酶n</a> <a href="http://www.carrymebike.net/nike-flyknit-lunar-1-wolf-grau-uk-obuvf">nike flyknit lunar 1 wolf grau uk</a> <a href="http://www.casatienda.net/hommes-nike-huarache-noir-and-rouge-butya">hommes nike huarache noir and rouge</a>
    [url=http://www.collegeprepcoach.net/]collegeprepcoach[/url]

  17. avatar araricambi

    <a href="http://www.trafassi.com/mennns-nike-air-max-90-hvit-shoesn">mennns nike air max 90 hvit</a> <a href="http://www.youtubetune.com/boss-tie-bar-tier">boss tie bar</a> <a href="http://www.iseejanemary.com/hermes-scarf-sale-scarfr">hermes scarf sale</a> <a href="http://www.polurnetsucks.com/nobis-mens-bomber-jacket-nobisr">nobis mens bomber jacket</a> <a href="http://www.esmokecanada.com/billig-air-jordan-retro-10-herre-s%C3%B8lv-trainersa">billig air jordan retro 10 herre s酶lv</a> <a href="http://www.caberrals.com/links-of-london-sweetie-bracelet-large-jewelryr">links of london sweetie bracelet large</a>
    araricambi http://www.araricambi.com/

  18. avatar 天津伸缩门

    数据库挺复杂的

  19. avatar shoejordan

    直接操作表 呼呼

  20. avatar payday loan online

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

  21. avatar 仪网

    专业!

  22. avatar 电视棒

    学习才能进步

  23. avatar nikeshoxshoes

    试一试

  24. avatar 新型制砂机

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

  25. avatar 谈话死

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

  26. avatar 莱步淘淘网

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

欢迎留言




用户登录

sitemap