{"id":95,"date":"2009-05-07T09:23:04","date_gmt":"2009-05-07T14:23:04","guid":{"rendered":"http:\/\/appcrawler.com\/wordpress\/?p=95"},"modified":"2011-07-06T09:54:22","modified_gmt":"2011-07-06T14:54:22","slug":"troubleshooting-enq-tm-contention-after-the-fact","status":"publish","type":"post","link":"http:\/\/appcrawler.com\/wordpress\/2009\/05\/07\/troubleshooting-enq-tm-contention-after-the-fact\/","title":{"rendered":"Troubleshooting enq: TM contention \u2013 after the fact"},"content":{"rendered":"<p>We began to experience this event yesterday afternoon.\u00a0 Normally, oracle takes the TM enqueue (table lock) out when activity is occurring such as an insert and we want to ensure the structure is not changed during the insert.<\/p>\n<pre>\r\nvariable min_snap number\r\nvariable max_snap number\r\n\r\nbegin\r\n  select min(snap_id) into :min_snap from dba_hist_snapshot where begin_interval_time > sysdate - &start_of_problem;\r\n  select min(snap_id) into :max_snap from dba_hist_snapshot where begin_interval_time > sysdate - &end_of_problem;\r\nend;\r\n\/\r\n\r\nselect count(*),sql_id,p2 object_id \r\n  from dba_hist_active_sess_history \r\n  where snap_id between :min_snap and :max_snap \r\n    and event = 'enq: TM - contention' group by sql_id,p2;\r\n\r\nselect owner,object_type,object_name,last_ddl_time \r\n  from dba_objects \r\n  where object_id = &object_id_above;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>We began to experience this event yesterday afternoon.\u00a0 Normally, oracle takes the TM enqueue (table lock) out when activity is occurring such as an insert and we want to ensure the structure is not changed during the insert. variable min_snap&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/appcrawler.com\/wordpress\/2009\/05\/07\/troubleshooting-enq-tm-contention-after-the-fact\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[19,22],"tags":[],"_links":{"self":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/95"}],"collection":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/comments?post=95"}],"version-history":[{"count":9,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/95\/revisions"}],"predecessor-version":[{"id":167,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/95\/revisions\/167"}],"wp:attachment":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/media?parent=95"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/categories?post=95"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/tags?post=95"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}