title: Setting up a default ORACLE_SID in linux
body: <p>Every time I log in to oracle, I am given an error:</p>
  
  <blockquote>
    <p><code>ORA-12162 TNS:net service name is incorrectly specified</code></p>
  </blockquote>
  
  <p>So I am forced to run this:</p>
  
  <pre><code>ORACLE_SID=mydb; export ORACLE_SID
  </code></pre>
  
  <p>I'd like to set <code>mydb</code> to be the default <code>ORACLE_SID</code>. I have searched for ways to do this, but I'm too rusty on linux to pull this off. Here's what I've tried so far:</p>
  
  <pre><code>[oracle]$ --&gt; in .profile add export ORACLE_SID=mydb
  -bash: in: Permission denied
  
  [root]$ chsh -s /bin/bash oracle
  Changing shell for oracle.
  Shell changed.
  </code></pre>
  
  <p>Here's what my tnsnames.ora looks like:</p>
  
  <pre><code>MYDB=
       (DESCRIPTION=
               (ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))
               (CONNECT_DATA=
                       (SERVICE_NAME=mydb,
                       SID=mydb)
               )
       )
  </code></pre>