title: Can't connect to oracle XE DB
body: <p>So I copied an running VM with openSUSE. When I started the machine I did <code>lsnrctrl start</code> like always and then everything worked. Usually I got the following output then: </p>
  
  <pre><code># lsnrctl status
  
  LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 11-AUG-2015 19:46:46
  
  Copyright (c) 1991, 2011, Oracle.  All rights reserved.
  
  Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
  STATUS of the LISTENER
  ------------------------
  Alias                     LISTENER
  Version                   TNSLSNR for Linux: Version 11.2.0.2.0 - Production
  Start Date                11-AUG-2015 19:46:43
  Uptime                    0 days 0 hr. 0 min. 3 sec
  Trace Level               off
  Security                  ON: Local OS Authentication
  SNMP                      OFF
  Default Service           XE
  Listener Parameter File   /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
  Listener Log File         /u01/app/oracle/product/11.2.0/xe/log/diag/tnslsnr/lpdev/listener/alert/log.xml
  Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
  Services Summary...
  Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
  The command completed successfully
  #
  </code></pre>
  
  <p>my XE instance was cooming up much later. But then later XE came up and like I said, everything worked fine. Now I did the same, but my XE Service is not cooming up.</p>
  
  <pre><code>lpdev:~ # tnsping xe
  
  TNS Ping Utility for Linux: Version 11.2.0.2.0 - Production on 11-AUG-2015 19:53:05
  
  Copyright (c) 1997, 2011, Oracle.  All rights reserved.
  
  Used parameter files:
  
  
  Used TNSNAMES adapter to resolve the alias
  Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = xe)))
  OK (0 msec)
  lpdev:~ #
  </code></pre>
  
  <p>listener.ora</p>
  
  <pre><code>SID_LIST_LISTENER =
    (SID_LIST =
      (SID_DESC =
        (SID_NAME = PLSExtProc)
        (ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe)
        (PROGRAM = extproc)
      )
    )
  
  LISTENER =
    (DESCRIPTION_LIST =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
      )
    )
  
  DEFAULT_SERVICE_LISTENER = (XE)
  </code></pre>
  
  <p>tnsnames.ora</p>
  
  <pre><code>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 = EXTPROC_FOR_XE))
      )
      (CONNECT_DATA =
        (SID = PLSExtProc)
        (PRESENTATION = RO)
      )
    )
  </code></pre>
  
  <p>sqlplus output:</p>
  
  <pre><code>lpdev:~ # sqlplus lp@xe
  
  SQL*Plus: Release 11.2.0.2.0 Production on Tue Aug 11 19:58:14 2015
  
  Copyright (c) 1982, 2011, Oracle.  All rights reserved.
  
  Enter password:
  ERROR:
  ORA-12514: TNS:listener does not currently know of service requested in connect
  descriptor
  </code></pre>
  
  <p>When running my perl script I get:</p>
  
  <pre><code>AH01215: DBI connect('XE','username',...) failed: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor (DBD ERROR: OCIServerAttach) at /srv/www/cgi-bin/lib/myfunctions.pm line 372., referer: http://192.168.0.13/
  </code></pre>
  
  <p>I have no clue what is going on here, can anyone help me quickly please? Need to finish some stuff :/</p>