{"id":3635,"date":"2020-11-09T16:59:18","date_gmt":"2020-11-09T16:59:18","guid":{"rendered":"https:\/\/nenadnoveljic.com\/blog\/?p=3635"},"modified":"2020-11-10T07:32:36","modified_gmt":"2020-11-10T07:32:36","slug":"improved-ora-04036-diagnostics-in-oracle-19c","status":"publish","type":"post","link":"https:\/\/nenadnoveljic.com\/blog\/improved-ora-04036-diagnostics-in-oracle-19c\/","title":{"rendered":"Improved ORA-04036 Diagnostics in Oracle 19c"},"content":{"rendered":"<p>ORA-04036 incident file shows the private memory allocations by the victim process:<\/p>\n<pre><code>=======================================\nPRIVATE MEMORY SUMMARY FOR THIS PROCESS\n---------------------------------------\n******************************************************\nPRIVATE HEAP SUMMARY DUMP\n33 MB total:\n    32 MB commented, 486 KB permanent\n   660 KB free (0 KB in empty extents),\n      23 MB,   3 heaps:   \"callheap       \"            38 KB free held\n    6539 KB,   1 heap:    \"kxs-heap-c     \"            257 KB free held\n    2879 KB,   1 heap:    \"session heap   \"            290 KB free held)<\/code><\/pre>\n<p>The information above is useless, because the victim allocated only a tiny fraction of the configured memory &#8211; 33MB out of 2GB. We rather need the information about top consumers, but that&#8217;s missing in the releases below 19c. Simply put, such incident file is only useful when the victim is a top consumer.<\/p>\n<p>We can get the top consumers from v$process_memory &#8211; if we&#8217;re lucky enough to capture them when the error is occuring:<\/p>\n<pre><code>column spid format a5\nselect spid,pname,round(allocated\/1024\/1024) alloc_MB \n  from v$process_memory m, v$process p \n  where m.pid = p.pid order by allocated;\n\nSPID  PNAME   ALLOC_MB\n----- ----- ----------\n...\n25465 W01A         155\n5316  W00K         155\n24014 W00N         155\n2432  W01Q         155\n24646 W02Q         155\n10527 W01N         155\n4523  W028         155\n7139  W01W         155\n28124 W030         155\n6468  W012         155<\/code><\/pre>\n<p>I executed the query above long after the error. Since the space background processes had still been holding the memory, I was able to identify the top consumers. But generally that need not be the case. pga_allocated in v$active_session_history wouldn&#8217;t have helped either, because these sessions have mostly been inactive and therefore not captured by ASH.<\/p>\n<p>The PGA heap dump reveals the main allocation reason:<\/p>\n<pre><code>oradebug setospid 6468\noradebug dump heapdump 1<\/code><\/pre>\n<pre><code>148560936 bytes, 471 chunks: \"control file i\/o buffer   \"  SQL\n          kxs-heap-w      ds=7fffaf9dcca0  dsprt=7fffbd929050<\/code><\/pre>\n<p>It&#8217;s unusual that background space processes are keeping that much memory allocated for weeks. For some reason all these processes haven&#8217;t released &#8220;control file i\/o buffer&#8221; allocations, but you can kill them when they become inactive.<\/p>\n<p>Notice that I limited the damage by reducing the number of processes to 10 (the default is 1024 &#8211; far too high):<\/p>\n<pre><code>show parameter bg\n\nNAME                                 TYPE        VALUE\n------------------------------------ ----------- ------------------------------\n_max_spacebg_slaves                  integer     10<\/code><\/pre>\n<p>Oracle enhanced the diagnostics in 19c &#8211; the incident dump file includes the top consumers now:<\/p>\n<pre><code>Private memory usage per Oracle process\n\n-------------------------\nTop 10 processes:\n-------------------------\n(percentage is of 2074 MB total allocated memory)\n77% ospid 11023       (J001): 1580 MB used, 1598 MB alloc &lt;= CURRENT PROC\n 2% ospid 16559       (M003): 33 MB used, 35 MB alloc, 896 KB freeable\n 2% ospid 9485        (M000): 31 MB used, 33 MB alloc, 832 KB freeable\n 1% ospid 9490        (M001): 28 MB used, 31 MB alloc, 896 KB freeable\n 1% ospid 14965       (M002): 28 MB used, 29 MB alloc, 320 KB freeable\n 1% ospid 5088        (M004): 25 MB used, 27 MB alloc, 1024 KB freeable\n 1% ospid 9354        (MMON): 5621 KB used, 22 MB alloc, 320 KB freeable\n 1% ospid 13713       (TT00): 18 MB used, 19 MB alloc\n 1% ospid 13715       (ARC0): 18 MB used, 19 MB alloc, 320 KB freeable\n 1% ospid 13722       (ARC1): 18 MB used, 19 MB alloc<\/code><\/pre>\n<p>In conclusion, with the improved diagnostic in 19c it became easy to identify the culprit. In the older releases you&#8217;d need to sample v$process_memory and hope to capture the top consumers.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Top consumer information included in the incident file. <a href=\"https:\/\/nenadnoveljic.com\/blog\/improved-ora-04036-diagnostics-in-oracle-19c\/\" class=\"more-link\">Continue Reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[36,5,35],"tags":[],"class_list":["post-3635","post","type-post","status-publish","format-standard","hentry","category-19c","category-oracle","category-pga"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Improved ORA-04036 Diagnostics in Oracle 19c - All-round Database Topics<\/title>\n<meta name=\"description\" content=\"Top consumer information included in the incident file.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/nenadnoveljic.com\/blog\/improved-ora-04036-diagnostics-in-oracle-19c\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Improved ORA-04036 Diagnostics in Oracle 19c - All-round Database Topics\" \/>\n<meta property=\"og:description\" content=\"Top consumer information included in the incident file.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/nenadnoveljic.com\/blog\/improved-ora-04036-diagnostics-in-oracle-19c\/\" \/>\n<meta property=\"og:site_name\" content=\"All-round Database Topics\" \/>\n<meta property=\"article:published_time\" content=\"2020-11-09T16:59:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-11-10T07:32:36+00:00\" \/>\n<meta name=\"author\" content=\"Nenad Noveljic\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@NenadNoveljic\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nenad Noveljic\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/improved-ora-04036-diagnostics-in-oracle-19c\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/improved-ora-04036-diagnostics-in-oracle-19c\\\/\"},\"author\":{\"name\":\"Nenad Noveljic\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/#\\\/schema\\\/person\\\/51458d9dd86dbbdd19f5add451d44efa\"},\"headline\":\"Improved ORA-04036 Diagnostics in Oracle 19c\",\"datePublished\":\"2020-11-09T16:59:18+00:00\",\"dateModified\":\"2020-11-10T07:32:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/improved-ora-04036-diagnostics-in-oracle-19c\\\/\"},\"wordCount\":275,\"commentCount\":2,\"articleSection\":[\"19c\",\"Oracle\",\"PGA\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/improved-ora-04036-diagnostics-in-oracle-19c\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/improved-ora-04036-diagnostics-in-oracle-19c\\\/\",\"url\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/improved-ora-04036-diagnostics-in-oracle-19c\\\/\",\"name\":\"Improved ORA-04036 Diagnostics in Oracle 19c - All-round Database Topics\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/#website\"},\"datePublished\":\"2020-11-09T16:59:18+00:00\",\"dateModified\":\"2020-11-10T07:32:36+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/#\\\/schema\\\/person\\\/51458d9dd86dbbdd19f5add451d44efa\"},\"description\":\"Top consumer information included in the incident file.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/improved-ora-04036-diagnostics-in-oracle-19c\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/improved-ora-04036-diagnostics-in-oracle-19c\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/improved-ora-04036-diagnostics-in-oracle-19c\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Improved ORA-04036 Diagnostics in Oracle 19c\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/\",\"name\":\"All-round Database Topics\",\"description\":\"Nenad Noveljic\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/#\\\/schema\\\/person\\\/51458d9dd86dbbdd19f5add451d44efa\",\"name\":\"Nenad Noveljic\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a97b796613ea48ec8a7b79c8ffe1c685dcffc920c68121f6238d5caab5070670?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a97b796613ea48ec8a7b79c8ffe1c685dcffc920c68121f6238d5caab5070670?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a97b796613ea48ec8a7b79c8ffe1c685dcffc920c68121f6238d5caab5070670?s=96&d=mm&r=g\",\"caption\":\"Nenad Noveljic\"},\"sameAs\":[\"nenad-noveljic-9b746a6\",\"https:\\\/\\\/x.com\\\/NenadNoveljic\"],\"url\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/author\\\/nenad\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Improved ORA-04036 Diagnostics in Oracle 19c - All-round Database Topics","description":"Top consumer information included in the incident file.","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:\/\/nenadnoveljic.com\/blog\/improved-ora-04036-diagnostics-in-oracle-19c\/","og_locale":"en_US","og_type":"article","og_title":"Improved ORA-04036 Diagnostics in Oracle 19c - All-round Database Topics","og_description":"Top consumer information included in the incident file.","og_url":"https:\/\/nenadnoveljic.com\/blog\/improved-ora-04036-diagnostics-in-oracle-19c\/","og_site_name":"All-round Database Topics","article_published_time":"2020-11-09T16:59:18+00:00","article_modified_time":"2020-11-10T07:32:36+00:00","author":"Nenad Noveljic","twitter_card":"summary_large_image","twitter_creator":"@NenadNoveljic","twitter_misc":{"Written by":"Nenad Noveljic","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/nenadnoveljic.com\/blog\/improved-ora-04036-diagnostics-in-oracle-19c\/#article","isPartOf":{"@id":"https:\/\/nenadnoveljic.com\/blog\/improved-ora-04036-diagnostics-in-oracle-19c\/"},"author":{"name":"Nenad Noveljic","@id":"https:\/\/nenadnoveljic.com\/blog\/#\/schema\/person\/51458d9dd86dbbdd19f5add451d44efa"},"headline":"Improved ORA-04036 Diagnostics in Oracle 19c","datePublished":"2020-11-09T16:59:18+00:00","dateModified":"2020-11-10T07:32:36+00:00","mainEntityOfPage":{"@id":"https:\/\/nenadnoveljic.com\/blog\/improved-ora-04036-diagnostics-in-oracle-19c\/"},"wordCount":275,"commentCount":2,"articleSection":["19c","Oracle","PGA"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/nenadnoveljic.com\/blog\/improved-ora-04036-diagnostics-in-oracle-19c\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/nenadnoveljic.com\/blog\/improved-ora-04036-diagnostics-in-oracle-19c\/","url":"https:\/\/nenadnoveljic.com\/blog\/improved-ora-04036-diagnostics-in-oracle-19c\/","name":"Improved ORA-04036 Diagnostics in Oracle 19c - All-round Database Topics","isPartOf":{"@id":"https:\/\/nenadnoveljic.com\/blog\/#website"},"datePublished":"2020-11-09T16:59:18+00:00","dateModified":"2020-11-10T07:32:36+00:00","author":{"@id":"https:\/\/nenadnoveljic.com\/blog\/#\/schema\/person\/51458d9dd86dbbdd19f5add451d44efa"},"description":"Top consumer information included in the incident file.","breadcrumb":{"@id":"https:\/\/nenadnoveljic.com\/blog\/improved-ora-04036-diagnostics-in-oracle-19c\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/nenadnoveljic.com\/blog\/improved-ora-04036-diagnostics-in-oracle-19c\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/nenadnoveljic.com\/blog\/improved-ora-04036-diagnostics-in-oracle-19c\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/nenadnoveljic.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Improved ORA-04036 Diagnostics in Oracle 19c"}]},{"@type":"WebSite","@id":"https:\/\/nenadnoveljic.com\/blog\/#website","url":"https:\/\/nenadnoveljic.com\/blog\/","name":"All-round Database Topics","description":"Nenad Noveljic","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/nenadnoveljic.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/nenadnoveljic.com\/blog\/#\/schema\/person\/51458d9dd86dbbdd19f5add451d44efa","name":"Nenad Noveljic","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/a97b796613ea48ec8a7b79c8ffe1c685dcffc920c68121f6238d5caab5070670?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/a97b796613ea48ec8a7b79c8ffe1c685dcffc920c68121f6238d5caab5070670?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a97b796613ea48ec8a7b79c8ffe1c685dcffc920c68121f6238d5caab5070670?s=96&d=mm&r=g","caption":"Nenad Noveljic"},"sameAs":["nenad-noveljic-9b746a6","https:\/\/x.com\/NenadNoveljic"],"url":"https:\/\/nenadnoveljic.com\/blog\/author\/nenad\/"}]}},"_links":{"self":[{"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/posts\/3635","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/comments?post=3635"}],"version-history":[{"count":1,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/posts\/3635\/revisions"}],"predecessor-version":[{"id":3638,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/posts\/3635\/revisions\/3638"}],"wp:attachment":[{"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/media?parent=3635"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/categories?post=3635"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/tags?post=3635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}