{"id":363,"date":"2018-05-13T17:11:23","date_gmt":"2018-05-13T17:11:23","guid":{"rendered":"https:\/\/www.spotonoracle.com\/?p=363"},"modified":"2018-05-13T18:25:12","modified_gmt":"2018-05-13T18:25:12","slug":"home-is-where-the-oracle_home-is","status":"publish","type":"post","link":"https:\/\/www.spotonoracle.com\/?p=363","title":{"rendered":"Home is where the ORACLE_HOME is"},"content":{"rendered":"<p>Here&#8217;s a little SQL that may be helpful in certain troubleshooting situations. It can answer questions like:<\/p>\n<ul>\n<li>Which ORACLE_HOME is my database running from?<\/li>\n<li>Which server-side sqlnet.ora is used by my connection (TNS_ADMIN)?<\/li>\n<\/ul>\n<p>Or more generally speaking: what&#8217;s the value of a given environment variable for my session&#8217;s server process.<\/p>\n<pre class=\"brush: sql; collapse: false; title: ; wrap-lines: false; notranslate\" title=\"\">\r\nwith\r\n  function get_env(var in varchar2)\r\n  return varchar2\r\n  is\r\n    val varchar2(32767);\r\n  begin\r\n    dbms_system.get_env(get_env.var, get_env.val);\r\n    return get_env.val;\r\n  end;\r\nselect get_env('&amp;var_name.') env_val from dual\r\n\/\r\n<\/pre>\n<p>Examples:<\/p>\n<pre class=\"brush: sql; collapse: false; title: ; wrap-lines: false; notranslate\" title=\"\">\r\nSQL&gt; r\r\nEnter value for var_name: ORACLE_HOME\r\n\r\nENV_VAL                                                                                                                                                                                                            \r\n--------------------------------\r\n\/u01\/app\/oracle\/product\/ora12201                      \r\n\r\nSQL&gt; r\r\nEnter value for var_name: TNS_ADMIN\r\n\r\nENV_VAL                                                                                                                                                                                                            \r\n--------------------------------\r\n\/u01\/app\/oracle\/network\/admin\r\n\r\nSQL&gt; r\r\nEnter value for var_name: PATH\r\n\r\nENV_VAL                                                                                                                                                                                                            \r\n--------------------------------\r\n \r\n<\/pre>\n<p>Note, Oracle apparently intentionally redacts the value for certain environment variables, e.g. PATH.<br \/>\nBut for the use cases above I&#8217;ve found it extremely useful&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a little SQL that may be helpful in certain troubleshooting situations. It can answer questions like: Which ORACLE_HOME is my database running from? Which server-side sqlnet.ora is used by my connection (TNS_ADMIN)? Or more generally speaking: what&#8217;s the value of a given environment variable for my session&#8217;s server process. with function get_env(var in varchar2) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-363","post","type-post","status-publish","format-standard","hentry","category-internals"],"_links":{"self":[{"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=\/wp\/v2\/posts\/363","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=363"}],"version-history":[{"count":7,"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=\/wp\/v2\/posts\/363\/revisions"}],"predecessor-version":[{"id":370,"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=\/wp\/v2\/posts\/363\/revisions\/370"}],"wp:attachment":[{"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}