{"id":4297,"date":"2022-07-18T17:18:25","date_gmt":"2022-07-18T17:18:25","guid":{"rendered":"https:\/\/nenadnoveljic.com\/blog\/?p=4297"},"modified":"2022-07-18T17:18:28","modified_gmt":"2022-07-18T17:18:28","slug":"troubleshooting-tfa-start","status":"publish","type":"post","link":"https:\/\/nenadnoveljic.com\/blog\/troubleshooting-tfa-start\/","title":{"rendered":"Troubleshooting TFA Start"},"content":{"rendered":"<p>Oracle Clusterware installation 21.3 sets up Oracle Trace File Analyzer (TFA). TFA is controlled through a dedicated service:<\/p>\n<pre><code>systemctl list-units *tfa*\nUNIT               LOAD   ACTIVE SUB     DESCRIPTION\noracle-tfa.service loaded active running Oracle Trace File Analyzer<\/code><\/pre>\n<p>One of the TFA benefits is OSWatcher, an extremely useful Oracle utility for collecting and archiving performance data:<\/p>\n<pre><code>ps -e -o cmd | grep OSW\n\/bin\/sh .\/OSWatcher.sh 30 48 NONE \/u00\/oracle\/GI\/gridbase\/oracle.ahf\/data\/repository\/suptools\/host\/oswbb\/grid\/archive\n\/bin\/sh .\/OSWatcherFM.sh 48 \/u00\/oracle\/GI\/gridbase\/oracle.ahf\/data\/repository\/suptools\/host\/oswbb\/grid\/archive<\/code><\/pre>\n<p>TFA wasn&#8217;t initialized properly on one of our servers &#8211; OSWatcher wasn&#8217;t running:<\/p>\n<pre><code>ps -e -o cmd | grep OSW | grep -v grep<\/code><\/pre>\n<p>, although the TFA service was started:<\/p>\n<pre><code>systemctl list-units oracle-tfa.service\nUNIT               LOAD   ACTIVE SUB     DESCRIPTION\noracle-tfa.service loaded active running Oracle Trace File Analyzer<\/code><\/pre>\n<p>I traced the creation of new processes during service startup to get an idea where the workflow might had been stuck:<\/p>\n<pre><code>sudo  \/usr\/share\/bcc\/tools\/<a href=\"https:\/\/www.brendangregg.com\/blog\/2014-07-28\/execsnoop-for-linux.html\">execsnoop<\/a><\/code><\/pre>\n<p>The init process started:<\/p>\n<pre><code>PCOMM            PID    PPID   RET ARGS\ninit.tfa         1462210 1        0 \/etc\/init.d\/init.tfa run &gt;\/dev\/null 2&gt;&amp;1 <\/code><\/pre>\n<p>But all it did was sleeping immediately after reading the file \/opt\/oracle.ahf\/tfa\/install\/<span style=\"color:red\">TFAMainrun<\/span>:<\/p>\n<pre><code>PCOMM            PID    PPID   RET ARGS\ninit.tfa         <span style=\"color:red\">1462210<\/span> 1        0 \/etc\/init.d\/init.tfa run &gt;\/dev\/null 2&gt;&amp;1 1462210   0 \/bin\/cat \/opt\/oracle.ahf\/tfa\/install\/TFAMainrun\n<span style=\"color:red\">sleep<\/span>            1462233 <span style=\"color:red\">1462210<\/span>   0 \/bin\/sleep 10\nsleep            1462343 1462210   0 \/bin\/sleep 30<\/code><\/pre>\n<p>The file <span style=\"color:red\">TFAMainrun<\/span> isn&#8217;t documented. Since the process went sleeping after reading this file, I assumed that the file contained some control information that made the process go to sleep. The file contained the string &#8220;<span style=\"color:red\">stop<\/span>&#8220;:<\/p>\n<pre><code>cat \/opt\/oracle.ahf\/tfa\/install\/<span style=\"color:red\">TFAMainrun<\/span>\n<span style=\"color:red\">stop<\/span><\/code><\/pre>\n<p>The timestamp of the last change was the time just before the server crashed.<br \/>\nIn contrast, on another server, where everything was running properly, the file contained the text &#8220;<span style=\"color:green\">start<\/span>&#8220;:<\/p>\n<pre><code>cat \/opt\/oracle.ahf\/tfa\/install\/TFAMainrun\n<span style=\"color:green\">start<\/span><\/code><\/pre>\n<p>After inserting &#8220;start&#8221; into TFAMainrun on the faulty server and restarting the TFA service, the OSWatcher started properly:<\/p>\n<pre><code>systemctl stop oracle-tfa.service\necho <span style=\"color:green\">start<\/span> &gt; \/opt\/oracle.ahf\/tfa\/install\/TFAMainrun\nsystemctl start oracle-tfa.service<\/code><\/pre>\n<pre><code>ps -e -o pid,ppid,cmd | grep OSW\n1488483       1 \/bin\/sh .\/OSWatcher.sh 30 48 NONE \/u00\/oracle\/GI\/gridbase\/oracle.ahf\/data\/repository\/suptools\/host\/oswbb\/grid\/archive\n1488967 1488483 \/bin\/sh .\/OSWatcherFM.sh 48 \/u00\/oracle\/GI\/gridbase\/oracle.ahf\/data\/repository\/suptools\/host\/oswbb\/grid\/archive<\/code><\/pre>\n<p>execsnoop captured TFA starting OSWatcher:<\/p>\n<pre><code>PCOMM            PID    PPID   RET ARGS\ntfactl.tfa       <span style=\"color:green\">1487812<\/span> 1487810   0 \/opt\/oracle.ahf\/tfa\/bin\/tfactl.tfa -initstart\n\nperl             <span style=\"color:green\">1487831 1487812<\/span>   0 \/bin\/perl \/opt\/oracle.ahf\/tfa\/bin\/tfactl.pl -initstart\n\nsh               1488463 <span style=\"color:green\">1487831<\/span>   0 \/bin\/sh -c cd \/u00\/oracle\/GI\/gridbase\/oracle.ahf\/data\/repository\/suptools\/host\/oswbb\/grid\/oswbb;su grid -c '.\/startOSWbb.sh 30 48 NONE\nsu               1488464 1488463   0 \/usr\/bin\/su grid -c .\/startOSWbb.sh 30 48 NONE \/u00\/oracle\/GI\/gridbase\/oracle.ahf\/data\/repository\/suptools\/host\/oswbb\/grid\/archive\n\nOSWatcher.sh     1488483 1        0 .\/OSWatcher.sh 30 48 NONE \/u00\/oracle\/GI\/gridbase\/oracle.ahf\/data\/repository\/suptools\/host\/oswbb\/grid\/archive\nOSWatcherFM.sh   1488967 1488483   0 .\/OSWatcherFM.sh 48 \/u00\/oracle\/GI\/gridbase\/oracle.ahf\/data\/repository\/suptools\/host\/oswbb\/grid\/archive<\/code><\/pre>\n<p>In summary, the content of the file \/opt\/oracle.ahf\/tfa\/install\/TFAMainrun has an impact on TFA initialization. This file is being rewritten on every TFA start and stop. If an operation performed by tfactl.ctl was interrupted due to a server crash, for example, the file might contain a wrong information that could perturb the next service start. You can recover from the error by writing the string &#8220;start&#8221; into the TFAMainrun file. Disclaimer: this is an undocumented procedure.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A server crash can prevent a correct TFA start. <a href=\"https:\/\/nenadnoveljic.com\/blog\/troubleshooting-tfa-start\/\" 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":[53,56],"tags":[],"class_list":["post-4297","post","type-post","status-publish","format-standard","hentry","category-ebpf","category-tfa"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Troubleshooting TFA Start - All-round Database Topics<\/title>\n<meta name=\"description\" content=\"A server crash can prevent a correct TFA start.\" \/>\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\/troubleshooting-tfa-start\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Troubleshooting TFA Start - All-round Database Topics\" \/>\n<meta property=\"og:description\" content=\"A server crash can prevent a correct TFA start.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/nenadnoveljic.com\/blog\/troubleshooting-tfa-start\/\" \/>\n<meta property=\"og:site_name\" content=\"All-round Database Topics\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-18T17:18:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-07-18T17:18:28+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\\\/troubleshooting-tfa-start\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/troubleshooting-tfa-start\\\/\"},\"author\":{\"name\":\"Nenad Noveljic\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/#\\\/schema\\\/person\\\/51458d9dd86dbbdd19f5add451d44efa\"},\"headline\":\"Troubleshooting TFA Start\",\"datePublished\":\"2022-07-18T17:18:25+00:00\",\"dateModified\":\"2022-07-18T17:18:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/troubleshooting-tfa-start\\\/\"},\"wordCount\":272,\"commentCount\":0,\"articleSection\":[\"eBPF\",\"TFA\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/troubleshooting-tfa-start\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/troubleshooting-tfa-start\\\/\",\"url\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/troubleshooting-tfa-start\\\/\",\"name\":\"Troubleshooting TFA Start - All-round Database Topics\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/#website\"},\"datePublished\":\"2022-07-18T17:18:25+00:00\",\"dateModified\":\"2022-07-18T17:18:28+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/#\\\/schema\\\/person\\\/51458d9dd86dbbdd19f5add451d44efa\"},\"description\":\"A server crash can prevent a correct TFA start.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/troubleshooting-tfa-start\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/troubleshooting-tfa-start\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/troubleshooting-tfa-start\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Troubleshooting TFA Start\"}]},{\"@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":"Troubleshooting TFA Start - All-round Database Topics","description":"A server crash can prevent a correct TFA start.","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\/troubleshooting-tfa-start\/","og_locale":"en_US","og_type":"article","og_title":"Troubleshooting TFA Start - All-round Database Topics","og_description":"A server crash can prevent a correct TFA start.","og_url":"https:\/\/nenadnoveljic.com\/blog\/troubleshooting-tfa-start\/","og_site_name":"All-round Database Topics","article_published_time":"2022-07-18T17:18:25+00:00","article_modified_time":"2022-07-18T17:18:28+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\/troubleshooting-tfa-start\/#article","isPartOf":{"@id":"https:\/\/nenadnoveljic.com\/blog\/troubleshooting-tfa-start\/"},"author":{"name":"Nenad Noveljic","@id":"https:\/\/nenadnoveljic.com\/blog\/#\/schema\/person\/51458d9dd86dbbdd19f5add451d44efa"},"headline":"Troubleshooting TFA Start","datePublished":"2022-07-18T17:18:25+00:00","dateModified":"2022-07-18T17:18:28+00:00","mainEntityOfPage":{"@id":"https:\/\/nenadnoveljic.com\/blog\/troubleshooting-tfa-start\/"},"wordCount":272,"commentCount":0,"articleSection":["eBPF","TFA"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/nenadnoveljic.com\/blog\/troubleshooting-tfa-start\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/nenadnoveljic.com\/blog\/troubleshooting-tfa-start\/","url":"https:\/\/nenadnoveljic.com\/blog\/troubleshooting-tfa-start\/","name":"Troubleshooting TFA Start - All-round Database Topics","isPartOf":{"@id":"https:\/\/nenadnoveljic.com\/blog\/#website"},"datePublished":"2022-07-18T17:18:25+00:00","dateModified":"2022-07-18T17:18:28+00:00","author":{"@id":"https:\/\/nenadnoveljic.com\/blog\/#\/schema\/person\/51458d9dd86dbbdd19f5add451d44efa"},"description":"A server crash can prevent a correct TFA start.","breadcrumb":{"@id":"https:\/\/nenadnoveljic.com\/blog\/troubleshooting-tfa-start\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/nenadnoveljic.com\/blog\/troubleshooting-tfa-start\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/nenadnoveljic.com\/blog\/troubleshooting-tfa-start\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/nenadnoveljic.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Troubleshooting TFA Start"}]},{"@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\/4297","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=4297"}],"version-history":[{"count":1,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/posts\/4297\/revisions"}],"predecessor-version":[{"id":4308,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/posts\/4297\/revisions\/4308"}],"wp:attachment":[{"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/media?parent=4297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/categories?post=4297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/tags?post=4297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}