{"id":1872,"date":"2019-07-04T15:51:49","date_gmt":"2019-07-04T13:51:49","guid":{"rendered":"http:\/\/www.ludovicocaldara.net\/dba\/?p=1872"},"modified":"2020-08-18T16:01:56","modified_gmt":"2020-08-18T14:01:56","slug":"sw_only-install-rac_off","status":"publish","type":"post","link":"https:\/\/www.ludovicocaldara.net\/dba\/sw_only-install-rac_off\/","title":{"rendered":"Oracle SW_ONLY install leads to relink with rac_off at every attachHome"},"content":{"rendered":"<p>OK, I really do not know what other title I should use for this post.<\/p>\n<p>I have developed and presented a few times my personal approach to Oracle Home provisioning and patching. <a href=\"https:\/\/www.ludovicocaldara.net\/dba\/blog-series-oracle-home-management\/\">You can read more in this series<\/a>.<\/p>\n<p>With this approach:<\/p>\n<ul>\n<li>I install the software (either GI or RDBMS) with the option SW_ONLY once<\/li>\n<li>I patch it to the last version<\/li>\n<li>I create a golden image that I evolve for the rest of the release lifecycle<\/li>\n<\/ul>\n<p>When I need to install it, I just unzip the golden image and attach it to the Central Inventory.<\/p>\n<p>I have discovered quite longtime ago that, every time I was attaching the home to the inventory, <strong>the binaries were relinked with rac_off<\/strong>, disregarding the fact that the home that I zipped actually had RAC enabled. This is quite annoying at my work at CERN, as all our databases are RAC.<\/p>\n<p>So my solution to the problem is to detect if the server is on a cluster, and relink on the fly:<\/p>\n<pre class=\"lang:sh decode:true\">### EARLIER, IN THE ENVIRONMENT SCRIPTS\r\nif [ -f \/etc\/oracle\/olr.loc ] ; then\r\n        export CRS_EXISTS=1\r\nelse\r\n        export CRS_EXISTS=0\r\nfi\r\n\r\n### LATER, AFTER ATTACHING THE ORACLE_HOME:\r\npushd $ORACLE_HOME\/rdbms\/lib\r\nif [ $CRS_EXISTS -eq 1 ] ; then\r\n\tmake -f ins_rdbms.mk rac_on\r\nelse\r\n\tmake -f ins_rdbms.mk rac_off\r\nfi\r\nmake -f ins_rdbms.mk ioracle<\/pre>\n<p>This is a simplified snippet of my actual code, but it gives the idea.<\/p>\n<p><strong>What causes the relink with rac_off?<\/strong><\/p>\n<p>I have discovered recently that the steps used by the runInstaller process to attach the Oracle Home are described in this file:<\/p>\n<pre class=\"lang:plsql highlight:0 decode:true \">$ORACLE_HOME\/inventory\/make\/makeorder.xml<\/pre>\n<p>and in my case, for all my golden images, it contains:<\/p>\n<pre class=\"lang:xhtml decode:true \">&lt;ohmd:MAKE\r\nMAKEPATH=\"\/usr\/bin\/make\" FILENAME=\"rdbms\/lib\/ins_rdbms.mk\" &gt;\r\n&lt;ohmd:TARGET ACTIONTYPE=\"INSTALL\" TARGETNAME=\"rac_off\" &gt;\r\n&lt;ohmd:INPUT_LIST&gt;\r\n&lt;ohmd:INPUT VAL=\"ORACLE_HOME=%ORACLE_HOME%\"\/&gt;\r\n&lt;\/ohmd:INPUT_LIST&gt;\r\n&lt;ohmd:COMP_LIST&gt;\r\n&lt;ohmd:COMP NAME=\"oracle.rdbms\" VERSION=\"18.0.0.0.0\"\/&gt;\r\n&lt;\/ohmd:COMP_LIST&gt;\r\n&lt;\/ohmd:TARGET&gt;\r\n&lt;\/ohmd:MAKE&gt;\r\n<\/pre>\n<p>So, it does not matter how I prepare my images: unless I change this file and put rac_on, the runInstaller keeps relinking with rac_off.<\/p>\n<p>I have thought about changing the file, but then realized that I prefer to check and recompile at runtime, so I can reuse my images also for standalone servers (in case we need them).<\/p>\n<p>Just to avoid surprises, it is convenient to check if a ORACLE_HOME is linked with RAC with this small function:<\/p>\n<pre class=\"lang:sh decode:true\">$ type isRACoh\r\nisRACoh is a function\r\nisRACoh ()\r\n{\r\n    OH2CHECK=${1:-$ORACLE_HOME};\r\n    ar -t $OH2CHECK\/rdbms\/lib\/libknlopt.a | grep --color=auto kcsm.o &gt; \/dev\/null;\r\n    if [ $? -eq 0 ]; then\r\n        echo \"Enabled\";\r\n    else\r\n        echo \"Disabled\";\r\n        false;\r\n    fi\r\n}\r\n<\/pre>\n<p>This is true especially for Grid Infrastructure golden images, as they have the very same behavior of RDBMS homes, with the exception that they might break out-of-place patching if RAC is not enabled: the second ASM instance will not mount because the first will be exclusively mounted without the RAC option.<\/p>\n<p>&nbsp;<\/p>\n<p>HTH.<\/p>\n<p>&#8212;<\/p>\n<p>Ludovico<\/p>\n","protected":false},"excerpt":{"rendered":"<p>OK, I really do not know what other title I should use for this post. I have developed and presented a few times my personal approach to Oracle Home provisioning and patching. You can read more in this series. With &hellip; <a href=\"https:\/\/www.ludovicocaldara.net\/dba\/sw_only-install-rac_off\/\">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":{"footnotes":""},"categories":[321,327,326,3,330,149],"tags":[],"class_list":["post-1872","post","type-post","status-publish","format-standard","hentry","category-aced","category-oracle-maa","category-oracle","category-oracledb","category-oracle-inst-upg","category-oracle-rac"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts\/1872","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/comments?post=1872"}],"version-history":[{"count":1,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts\/1872\/revisions"}],"predecessor-version":[{"id":1873,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts\/1872\/revisions\/1873"}],"wp:attachment":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/media?parent=1872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/categories?post=1872"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/tags?post=1872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}