{"id":1436,"date":"2019-10-09T10:28:57","date_gmt":"2019-10-09T09:28:57","guid":{"rendered":"https:\/\/dbafox.com\/?p=1436"},"modified":"2019-10-09T10:34:25","modified_gmt":"2019-10-09T09:34:25","slug":"oracle-sql-demo-deadlock","status":"publish","type":"post","link":"https:\/\/dbafox.com\/?p=1436","title":{"rendered":"Oracle &#8211; SQL &#8211; demo deadlock"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">create table t (processed_flag varchar(1));<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ncreate bitmap index t_idx on t(processed_flag);\n\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">From Tom Kyte &#8220;Expert Oracle Database Architecture &#8211; 3rd Edition&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">insert into t values (&#8216;N&#8217;);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">declare<br>\n  pragma autonomous_transaction;<br>\nbegin<br>\n  insert into t values (&#8216;N&#8217;);<br>\n  commit;<br>\nend;<br>\n\/<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">declare<br>\n*<br>\nERROR at line 1:<br>\nORA-00060: deadlock detected while waiting for resource<br>\nORA-06512: at line 4<\/p>\n","protected":false},"excerpt":{"rendered":"<p>create table t (processed_flag varchar(1)); create bitmap index t_idx on t(processed_flag); From Tom Kyte &#8220;Expert Oracle Database Architecture &#8211; 3rd Edition&#8221; insert into t values (&#8216;N&#8217;); declare pragma autonomous_transaction; begin insert into t values (&#8216;N&#8217;); commit; end; \/ declare * ERROR at line 1: ORA-00060: deadlock detected while waiting for resource ORA-06512: at line 4<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","pgc_sgb_lightbox_settings":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-1436","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Oracle - SQL - demo deadlock - dbafox<\/title>\n<meta name=\"description\" content=\"Create a deadlock scenario using autonomous_transaction pragma. (The only useful, safe scenario for using autonomous transaction pragma is for logging).\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/dbafox.com\/?p=1436\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Oracle - SQL - demo deadlock - dbafox\" \/>\n<meta property=\"og:description\" content=\"Create a deadlock scenario using autonomous_transaction pragma. (The only useful, safe scenario for using autonomous transaction pragma is for logging).\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dbafox.com\/?p=1436\" \/>\n<meta property=\"og:site_name\" content=\"dbafox\" \/>\n<meta property=\"article:published_time\" content=\"2019-10-09T09:28:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-10-09T09:34:25+00:00\" \/>\n<meta name=\"author\" content=\"Ray Fox\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ray Fox\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/dbafox.com\\\/?p=1436#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/dbafox.com\\\/?p=1436\"},\"author\":{\"name\":\"Ray Fox\",\"@id\":\"https:\\\/\\\/dbafox.com\\\/#\\\/schema\\\/person\\\/287adc474c1aebd398752ac4dcfe27eb\"},\"headline\":\"Oracle &#8211; SQL &#8211; demo deadlock\",\"datePublished\":\"2019-10-09T09:28:57+00:00\",\"dateModified\":\"2019-10-09T09:34:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/dbafox.com\\\/?p=1436\"},\"wordCount\":62,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/dbafox.com\\\/#\\\/schema\\\/person\\\/287adc474c1aebd398752ac4dcfe27eb\"},\"articleSection\":[\"Uncategorized\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/dbafox.com\\\/?p=1436#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/dbafox.com\\\/?p=1436\",\"url\":\"https:\\\/\\\/dbafox.com\\\/?p=1436\",\"name\":\"Oracle - SQL - demo deadlock - dbafox\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/dbafox.com\\\/#website\"},\"datePublished\":\"2019-10-09T09:28:57+00:00\",\"dateModified\":\"2019-10-09T09:34:25+00:00\",\"description\":\"Create a deadlock scenario using autonomous_transaction pragma. (The only useful, safe scenario for using autonomous transaction pragma is for logging).\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/dbafox.com\\\/?p=1436#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/dbafox.com\\\/?p=1436\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/dbafox.com\\\/?p=1436#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/dbafox.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Oracle &#8211; SQL &#8211; demo deadlock\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/dbafox.com\\\/#website\",\"url\":\"https:\\\/\\\/dbafox.com\\\/\",\"name\":\"dbafox\",\"description\":\"DBA Technical Information\",\"publisher\":{\"@id\":\"https:\\\/\\\/dbafox.com\\\/#\\\/schema\\\/person\\\/287adc474c1aebd398752ac4dcfe27eb\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/dbafox.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/dbafox.com\\\/#\\\/schema\\\/person\\\/287adc474c1aebd398752ac4dcfe27eb\",\"name\":\"Ray Fox\",\"logo\":{\"@id\":\"https:\\\/\\\/dbafox.com\\\/#\\\/schema\\\/person\\\/image\\\/\"},\"sameAs\":[\"http:\\\/\\\/www.dbafox.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Oracle - SQL - demo deadlock - dbafox","description":"Create a deadlock scenario using autonomous_transaction pragma. (The only useful, safe scenario for using autonomous transaction pragma is for logging).","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/dbafox.com\/?p=1436","og_locale":"en_GB","og_type":"article","og_title":"Oracle - SQL - demo deadlock - dbafox","og_description":"Create a deadlock scenario using autonomous_transaction pragma. (The only useful, safe scenario for using autonomous transaction pragma is for logging).","og_url":"https:\/\/dbafox.com\/?p=1436","og_site_name":"dbafox","article_published_time":"2019-10-09T09:28:57+00:00","article_modified_time":"2019-10-09T09:34:25+00:00","author":"Ray Fox","twitter_misc":{"Written by":"Ray Fox"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/dbafox.com\/?p=1436#article","isPartOf":{"@id":"https:\/\/dbafox.com\/?p=1436"},"author":{"name":"Ray Fox","@id":"https:\/\/dbafox.com\/#\/schema\/person\/287adc474c1aebd398752ac4dcfe27eb"},"headline":"Oracle &#8211; SQL &#8211; demo deadlock","datePublished":"2019-10-09T09:28:57+00:00","dateModified":"2019-10-09T09:34:25+00:00","mainEntityOfPage":{"@id":"https:\/\/dbafox.com\/?p=1436"},"wordCount":62,"commentCount":0,"publisher":{"@id":"https:\/\/dbafox.com\/#\/schema\/person\/287adc474c1aebd398752ac4dcfe27eb"},"articleSection":["Uncategorized"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/dbafox.com\/?p=1436#respond"]}]},{"@type":"WebPage","@id":"https:\/\/dbafox.com\/?p=1436","url":"https:\/\/dbafox.com\/?p=1436","name":"Oracle - SQL - demo deadlock - dbafox","isPartOf":{"@id":"https:\/\/dbafox.com\/#website"},"datePublished":"2019-10-09T09:28:57+00:00","dateModified":"2019-10-09T09:34:25+00:00","description":"Create a deadlock scenario using autonomous_transaction pragma. (The only useful, safe scenario for using autonomous transaction pragma is for logging).","breadcrumb":{"@id":"https:\/\/dbafox.com\/?p=1436#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dbafox.com\/?p=1436"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/dbafox.com\/?p=1436#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dbafox.com\/"},{"@type":"ListItem","position":2,"name":"Oracle &#8211; SQL &#8211; demo deadlock"}]},{"@type":"WebSite","@id":"https:\/\/dbafox.com\/#website","url":"https:\/\/dbafox.com\/","name":"dbafox","description":"DBA Technical Information","publisher":{"@id":"https:\/\/dbafox.com\/#\/schema\/person\/287adc474c1aebd398752ac4dcfe27eb"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dbafox.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"https:\/\/dbafox.com\/#\/schema\/person\/287adc474c1aebd398752ac4dcfe27eb","name":"Ray Fox","logo":{"@id":"https:\/\/dbafox.com\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/www.dbafox.com"]}]}},"_links":{"self":[{"href":"https:\/\/dbafox.com\/index.php?rest_route=\/wp\/v2\/posts\/1436","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dbafox.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dbafox.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dbafox.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dbafox.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1436"}],"version-history":[{"count":4,"href":"https:\/\/dbafox.com\/index.php?rest_route=\/wp\/v2\/posts\/1436\/revisions"}],"predecessor-version":[{"id":1440,"href":"https:\/\/dbafox.com\/index.php?rest_route=\/wp\/v2\/posts\/1436\/revisions\/1440"}],"wp:attachment":[{"href":"https:\/\/dbafox.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1436"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dbafox.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1436"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dbafox.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1436"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}