{"id":1889,"date":"2019-08-23T14:59:29","date_gmt":"2019-08-23T12:59:29","guid":{"rendered":"http:\/\/www.ludovicocaldara.net\/dba\/?p=1889"},"modified":"2020-08-18T16:00:10","modified_gmt":"2020-08-18T14:00:10","slug":"remote-listener-tns-alias","status":"publish","type":"post","link":"https:\/\/www.ludovicocaldara.net\/dba\/remote-listener-tns-alias\/","title":{"rendered":"Parameter REMOTE_LISTENER pointing to a TNS alias? Beware of how it registers."},"content":{"rendered":"<p>On an Oracle Database instance, if I set:<\/p>\n<pre class=\"lang:plsql decode:true \">alter system set remote_listener='cluster-scan:1521';<\/pre>\n<p>The instance tries to resolve the cluster-scan name to detect if it is a SCAN address.<br \/>\nSo, after it solves, it stores all the addresses it gets and registers to them.<br \/>\nI can check which addresses there are with this query:<\/p>\n<pre class=\"lang:plsql decode:true\">SQL&gt;  select type, value from v$listener_network where type='REMOTE LISTENER';\r\n\r\nTYPE             VALUE\r\n---------------- ---------------------------------------------------------------------------------------------------\r\nREMOTE LISTENER  (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.0.1)(PORT=1521)))\r\nREMOTE LISTENER  (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.0.2)(PORT=1521)))\r\nREMOTE LISTENER  (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.0.3)(PORT=1521)))\r\n<\/pre>\n<p>In this case, the instance registers to the three addresses discovered, which is OK: all three SCAN listeners will get service updates from the instance.<\/p>\n<p>But if I have this TNS alias:<\/p>\n<pre class=\"lang:plsql decode:true \">REMOTE_LISTENER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(PORT=1521)(HOST=cluster-scan)))<\/pre>\n<p>and I set:<\/p>\n<pre class=\"lang:plsql decode:true \">alter system set remote_listener='remote_listener';<\/pre>\n<p>I get:<\/p>\n<pre class=\"lang:plsql decode:true\">SQL&gt;  select type, value from v$listener_network where type='REMOTE LISTENER';\r\n\r\nTYPE             VALUE\r\n---------------- ---------------------------------------------------------------------------\r\nREMOTE LISTENER  (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(PORT=1521)(HOST=cluster-scan)))\r\n<\/pre>\n<p>the result is that the instance registers only at the first IP fot from the DNS, leaving the other SCANs without the service registration and thus random<\/p>\n<pre class=\"lang:plsql decode:true \">ORA-12514, TNS:listener does not currently know of service requested in connect descriptor<\/pre>\n<p>This is in my opinion quite annoying, as my goal here was to have all the DBs set with:<\/p>\n<pre class=\"lang:plsql decode:true\">local_listener=local_listener\r\nremote_listener=remote_listener<\/pre>\n<p>in order to facilitate changes of ports, database migrations from different clusters, clones, etc.<\/p>\n<p>So the solution is either to revert to the syntax &#8220;cluster-scan:port&#8221;, or specifying explicitly all the endpoints in the address list:<\/p>\n<pre class=\"lang:plsql decode:true \">REMOTE_LISTENER = (DESCRIPTION= (ADDRESS_LIST=\r\n  (ADDRESS= (PROTOCOL=TCP) (PORT=1521) (HOST=10.0.0.1))\r\n  (ADDRESS= (PROTOCOL=TCP) (PORT=1521) (HOST=10.0.0.2))\r\n  (ADDRESS= (PROTOCOL=TCP) (PORT=1521) (HOST=10.0.0.3))\r\n ))<\/pre>\n<p>I am sure it is &#8220;working as designed&#8221;, but I wonder if it could be an enhancement to have the address expended fully also in case of TNS alias&#8230;.<br \/>\nOr&#8230; do you know any way to do it from a TNS alias without having the full IP list?<\/p>\n<p>Cheers<\/p>\n<p>&#8212;<\/p>\n<p>Ludo<\/p>\n","protected":false},"excerpt":{"rendered":"<p>On an Oracle Database instance, if I set: alter system set remote_listener=&#8217;cluster-scan:1521&#8242;; The instance tries to resolve the cluster-scan name to detect if it is a SCAN address. So, after it solves, it stores all the addresses it gets and &hellip; <a href=\"https:\/\/www.ludovicocaldara.net\/dba\/remote-listener-tns-alias\/\">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-1889","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\/1889","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=1889"}],"version-history":[{"count":1,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts\/1889\/revisions"}],"predecessor-version":[{"id":1890,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts\/1889\/revisions\/1890"}],"wp:attachment":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/media?parent=1889"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/categories?post=1889"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/tags?post=1889"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}