title: What does Oracles 'alter system set local_listener' do exactly
body: <h3>Why I am curious:</h3>
  
  <p>I have always had issues when installing an Oracle Express Database.  As in I have never had it work right the first time round.  The next time I boot my computer after installing Oracle Express I consistently receive the <a href="https://stackoverflow.com/questions/5661610/tns-12505-tnslistener-does-not-currently-know-of-sid-given-in-connect-descript">common error</a>:</p>
  
  <blockquote>
    <p>TNS-12505: TNS:listener does not currently know of SID given in connect descriptor</p>
  </blockquote>
  
  <p>I have managed to fix this issue using various methods however I have learned that the best method that works for me these days is to Reconfigure the Listener using SQL Plus.  When the Listener fails SQL Plus is the only way I can connect to the OracleXE Server and after searching the Internet I'm not alone here.</p>
  
  <p>The DDL that fixes this error - run from SQL Plus:</p>
  
  <pre><code>alter system set local_listener='(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521))' scope=both;
  </code></pre>
  
  <h3>The Question:</h3>
  
  <p>Why does re-configuring the Listener work?  What does it do?  I monitored my listener.ora file along with my TNSNames.ora file and they remain the same before and after I run the above code.  So what did it do?</p>
  
  <p>I read this entire Oracle <a href="https://docs.oracle.com/database/121/NETAG/listenercfg.htm#NETAG292" rel="nofollow noreferrer">LISTENER</a> Documentation and I did not come out of it enlightened. Can anyone enlighten me?</p>