title: Cannot connect to Oracle XE 11g2
body: <p>This has been driving me crazy for two days. I recently installed Oracle Express Edition 11g2 on my localhost (Windows 7 Enterprise). I can start the database and the listener, but I am unable to connect. </p>
  
  <p>When I try connecting from SQL Developer with the following parameters:</p>
  
  <pre><code>Username: SYSTEM
  Password: ***********
  Hostname: localhost
  Port: 1521
  Service name: XE
  </code></pre>
  
  <p>I get the following error: <code>An error was encountered... IO Error: The Network Adapter could not establish the connection. Vendor code 17002</code>
  Which apparently is SQL Developer speak for <code>ORA-12541: TNS no listener</code>.</p>
  
  <p>When i try to connect from an SQL Command Line:</p>
  
  <pre><code>SQL&gt; connect
  Enter user-name: system
  Enter password:
  ERROR:
  ORA-12638: Credential retrieval failed
  </code></pre>
  
  <p>My <code>ORACLE_HOME</code> is set to <code>C:\oraclexe\app\oracle\product\11.2.0\server</code>.</p>
  
  <pre><code>C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN\tnsnames.ora:
  
  XE =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = LOCALHOST)(PORT = 1521))
      (CONNECT_DATA =
        (SERVER = DEDICATED)
        (SERVICE_NAME = XE)
      )
    )
  
  EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
      )
      (CONNECT_DATA =
        (SID = PLSExtProc)
        (PRESENTATION = RO)
      )
    )
  
  ORACLR_CONNECTION_DATA = 
    (DESCRIPTION = 
      (ADDRESS_LIST = 
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1)) 
      ) 
      (CONNECT_DATA = 
        (SID = CLRExtProc) 
        (PRESENTATION = RO) 
      ) 
    ) 
  
  #bohort  =
  #  (DESCRIPTION=
  #    (ADDRESS=(PROTOCOL=tcp)(HOST=LOCALHOST)(PORT=1521))
  #    (CONNECT_DATA=(SID=bohort))
  #    (HS=OK)
  #  ) 
  </code></pre>
  
  <p>-</p>
  
  <pre><code>C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN\listener.ora:
  
  SID_LIST_LISTENER =
    (SID_LIST =
      (SID_DESC =
        (SID_NAME = PLSExtProc)
        (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
        (PROGRAM = extproc)
      )
      (SID_DESC =
        (SID_NAME = CLRExtProc)
        (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
        (PROGRAM = extproc)
      )
  #   (SID_DESC=
  #    (SID_NAME=bohort)
  #    (ORACLE_HOME= C:\oraclexe\app\oracle\product\11.2.0\server)
  #    (PROGRAM=dg4odbc)
  #   )   
    )
  
  LISTENER =
    (DESCRIPTION_LIST =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
        (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
      )
    )
  
  DEFAULT_SERVICE_LISTENER = (XE)
  </code></pre>
  
  <p>-</p>
  
  <pre><code>C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN\sqlnet.ora:
  
  # This file is actually generated by netca. But if customers choose to 
  # install "Software Only", this file wont exist and without the native 
  # authentication, they will not be able to connect to the database on NT.
  
  SQLNET.AUTHENTICATION_SERVICES = (NTS)
  </code></pre>
  
  <p>Starting the listener seems to work fine:</p>
  
  <pre><code>C:\Users\&lt;Username&gt;&gt;lsnrctl start
  
  LSNRCTL for 64-bit Windows: Version 11.2.0.2.0 - Production on 04-F╔VR.-2015 10:
  45:27
  
  Copyright (c) 1991, 2014, Oracle.  All rights reserved.
  
  Starting tnslsnr: please wait...
  
  TNSLSNR for 64-bit Windows: Version 11.2.0.2.0 - Production
  System parameter file is C:\oraclexe\app\oracle\product\11.2.0\server\network\ad
  min\listener.ora
  Log messages written to C:\oraclexe\app\oracle\diag\tnslsnr\&lt;Username&gt;\listener\a
  lert\log.xml
  Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc
  )))
  Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
  
  Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
  STATUS of the LISTENER
  ------------------------
  Alias                     LISTENER
  Version                   TNSLSNR for 64-bit Windows: Version 11.2.0.2.0 - Produ
  ction
  Start Date                04-F╔VR.-2015 10:45:32
  Uptime                    0 days 0 hr. 0 min. 5 sec
  Trace Level               off
  Security                  ON: Local OS Authentication
  SNMP                      OFF
  Default Service           XE
  Listener Parameter File   C:\oraclexe\app\oracle\product\11.2.0\server\network\a
  dmin\listener.ora
  Listener Log File         C:\oraclexe\app\oracle\diag\tnslsnr\&lt;Username&gt;\listener
  \alert\log.xml
  Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
  Services Summary...
  Service "CLRExtProc" has 1 instance(s).
    Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
  Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
  The command completed successfully
  </code></pre>
  
  <p>I am sure the answer is out there somewhere but two days of googling have not led to a solution ... </p>