{"id":9,"date":"2009-05-14T07:57:07","date_gmt":"2009-05-14T14:57:07","guid":{"rendered":"http:\/\/www.vinodsr.com\/myblog\/?p=9"},"modified":"2009-05-14T08:05:46","modified_gmt":"2009-05-14T15:05:46","slug":"how-to-get-the-locked-tables-list-in-oracle","status":"publish","type":"post","link":"https:\/\/vinodsr.com\/myblog\/2009\/05\/how-to-get-the-locked-tables-list-in-oracle\/","title":{"rendered":"How to Get the Locked Tables List In Oracle"},"content":{"rendered":"<p>Here is the query to get the locked tables in oracle<\/p>\n<blockquote><p>SELECT l.inst_id,SUBSTR(L.ORACLE_USERNAME,1,8) ORA_USER, SUBSTR(L.SESSION_ID,1,3) SID,<br \/>\nS.serial#,<br \/>\nSUBSTR(O.OWNER||&#8217;.&#8217;||O.OBJECT_NAME,1,40) OBJECT, P.SPID OS_PID,<br \/>\nDECODE(L.LOCKED_MODE, 0,&#8217;NONE&#8217;,<br \/>\n1,&#8217;NULL&#8217;,<br \/>\n2,&#8217;ROW SHARE&#8217;,<br \/>\n3,&#8217;ROW EXCLUSIVE&#8217;,<br \/>\n4,&#8217;SHARE&#8217;,<br \/>\n5,&#8217;SHARE ROW EXCLUSIVE&#8217;,<br \/>\n6,&#8217;EXCLUSIVE&#8217;,<br \/>\nNULL) LOCK_MODE<br \/>\nFROM sys.GV_$LOCKED_OBJECT L, DBA_OBJECTS O, sys.GV_$SESSION S, sys.GV_$PROCESS P<br \/>\nWHERE L.OBJECT_ID = O.OBJECT_ID<br \/>\nand l.inst_id = s.inst_id<br \/>\nAND L.SESSION_ID = S.SID<br \/>\nand s.inst_id = p.inst_id<br \/>\nAND S.PADDR = P.ADDR(+)<br \/>\norder by l.inst_id\u00a0 ;<\/p><\/blockquote>\n<p><span style=\"text-decoration: underline;\">And to get the details of a particular session given by the sid in the above query use this query <\/span><\/p>\n<blockquote><p>select STATUS ,\u00a0 PROCESS , PROGRAM , LOGON_TIME\u00a0 from v$session where sid=&lt;SID&gt;<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Here is the query to get the locked tables in oracle SELECT l.inst_id,SUBSTR(L.ORACLE_USERNAME,1,8) ORA_USER, SUBSTR(L.SESSION_ID,1,3) SID, S.serial#, SUBSTR(O.OWNER||&#8217;.&#8217;||O.OBJECT_NAME,1,40) OBJECT, P.SPID OS_PID, DECODE(L.LOCKED_MODE, 0,&#8217;NONE&#8217;, 1,&#8217;NULL&#8217;, 2,&#8217;ROW&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[45],"class_list":["post-9","post","type-post","status-publish","format-standard","hentry","category-oracle","tag-oracle"],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/vinodsr.com\/myblog\/wp-json\/wp\/v2\/posts\/9","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vinodsr.com\/myblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vinodsr.com\/myblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vinodsr.com\/myblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vinodsr.com\/myblog\/wp-json\/wp\/v2\/comments?post=9"}],"version-history":[{"count":5,"href":"https:\/\/vinodsr.com\/myblog\/wp-json\/wp\/v2\/posts\/9\/revisions"}],"predecessor-version":[{"id":24,"href":"https:\/\/vinodsr.com\/myblog\/wp-json\/wp\/v2\/posts\/9\/revisions\/24"}],"wp:attachment":[{"href":"https:\/\/vinodsr.com\/myblog\/wp-json\/wp\/v2\/media?parent=9"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vinodsr.com\/myblog\/wp-json\/wp\/v2\/categories?post=9"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vinodsr.com\/myblog\/wp-json\/wp\/v2\/tags?post=9"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}