title: Oracle Enterprise Manager Could Not Complete Configuration
body: <p>I'm running 11g R2 on Solaris and EM looks to not have installed. When I try and create the repository manually</p>
  
  <pre><code>emca -config dbcontrol db -repos create
  </code></pre>
  
  <p>I get the following message:</p>
  
  <pre><code>Sep 16, 2013 1:00:32 PM oracle.sysman.emcp.EMConfig perform
  SEVERE:
  
  Database connection through listener failed. Fix the error and run EM Configuration Assistant again.
  </code></pre>
  
  <p>Some of the possible reasons may be:</p>
  
  <ol>
  <li>Listener port 1521 provided is incorrect. Provide the correct port.</li>
  <li>Listener is not up. Start the Listener.</li>
  <li>Database service dbservice is not registered with listener. Register the database service.</li>
  <li>Listener is up on physical host and ORACLE_HOSTNAME environment variable is set to virtual host. Unset ORACLE_HOSTNAME environment variable.</li>
  <li>Listener is up on virtual host. Set environment variable ORACLE_HOSTNAME=.</li>
  <li>/etc/hosts does not have correct entry for hostname.</li>
  </ol>
  
  <p>Refer to the log file at <code>/u01/app/oracle/cfgtoollogs/emca/database/emca_2013_09_16_12_58_54.log</code> for more details.</p>
  
  <p>Could not complete the configuration. Refer to the log file at <code>/u01/app/oracle/cfgtoollogs/emca/database/emca_2013_09_16_12_58_54.log</code> for more details.</p>
  
  <p>The log file basically states the same thing.</p>
  
  <pre><code>Database connection through listener failed. Fix the error and run EM Configuration Assistant again.
  </code></pre>
  
  <p>Some of the possible reasons may be:</p>
  
  <ol>
  <li>Listener port 1521 provided is incorrect. Provide the correct port.</li>
  <li>Listener is not up. Start the Listener.</li>
  <li>Database service <code>dbservice</code> is not registered with listener. Register the database service.</li>
  <li>Listener is up on physical host and <code>ORACLE_HOSTNAME</code> environment variable is set to virtual host. Unset <code>ORACLE_HOSTNAME</code> environment variable.</li>
  <li>Listener is up on virtual host. Set environment variable <code>ORACLE_HOSTNAME=&lt;virtual host&gt;</code>.</li>
  <li><p><code>/etc/hosts</code> does not have correct entry for hostname.</p>
  
  <pre><code>    at oracle.sysman.emcp.ParamsManager.checkListenerStatusForDBControl(ParamsManager.java:3342)
      at oracle.sysman.emcp.EMDBPreConfig.performConfiguration(EMDBPreConfig.java:858)
      at oracle.sysman.emcp.EMDBPreConfig.invoke(EMDBPreConfig.java:288)
      at oracle.sysman.emcp.EMDBPreConfig.invoke(EMDBPreConfig.java:198)
      at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:250)
      at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:599)
      at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1482)
      at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:583)
      at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:529)
  </code></pre>
  
  <p>Sep 16, 2013 1:00:32 PM oracle.sysman.emcp.EMConfig restoreOuiLoc
  CONFIG: Restoring oracle.installer.oui_loc to /u01/app/oracle/product/11.2.0/dbhome_1/oui</p></li>
  </ol>
  
  <p>The listener port is 1521.</p>