Local installation of Oracle 11g Express Edition XE on Windows 7

  1. Download “latest” http://www.oracle.com/technetwork/database/database-technologies/express-edition/overview/index.html
  2. Install to dir without spaces e.g. c:/dev/env/
  3. Type”services” in Windows programs search to start services program. View service names starting with Oracle. You should see:
    1. OracleJobSchedulerXE
    2. OracleMTSRecoveryService
    3. OracleServiceXE
    4. OracleXEClrAgent
    5. OracleXETNSListener
  4. Change startup type to manual for all of them. When you want to start Oracle XE just start manually: OracleServiceXE and OracleXETNSListener
  5. When you cannot connect to the listener due to:
    Caused by: oracle.net.ns.NetException: Listener refused the connection with the following error:
    ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
    

    then check port and hostname in listener.ora and tnsanmes.org (present for my installation in C:\dev\env\oracle11gXE\app\oracle\product\11.2.0\server\network\ADMIN) :

    ...
    
    LISTENER =
     (DESCRIPTION_LIST =
     (DESCRIPTION =
     (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
     (ADDRESS = (PROTOCOL = TCP)(HOST = DCNU251B78K.mydomain.com)(PORT = 1521))
     )
     )
    
    DEFAULT_SERVICE_LISTENER = (XE)
    

    and

     XE =
     (DESCRIPTION =
     (ADDRESS = (PROTOCOL = TCP)(HOST = DCNU251B78K.mydomain.com)(PORT = 1521))
     (CONNECT_DATA =
     (SERVER = DEDICATED)
     (SERVICE_NAME = XE)
     )
     )
    ...
    

    Here my host is DCNU251B78K.mydomain.com and port 1521

  6. Then make sure you SqlDeveloper settions are:
    1. Connection type: Basic
    2. Role: default
    3. Hostname: localhost
    4. Port: 1521
    5. Selected SID: XE
  7. If you still cannot connect due to listener problem then open Windows command line (type CMD in Windows program) and type:
    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.
    
    C:\Users\me>sqlplus "/as sysdba"
    
    SQL*Plus: Release 11.2.0.2.0 Production on Wed Aug 10 13:27:24 2016
    
    Copyright (c) 1982, 2014, Oracle. All rights reserved.
    
    Connected to:
    Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
    
    SQL> alter system set LOCAL_LISTENER='(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))' scope=both;
    
    System altered.
    
    SQL> alter system register;
    
    System altered.
    
    SQL>
    
    

and try to reconnect using SqlDeveloper or your app. Alternatively restart OracleServiceXE and OracleXETNSListener services and run the SQL alter statements.

8. Output of the command below should list now XE (which was missing earlier for ORA-12514)

C:\Users\me>lsnrctl status

LSNRCTL for 64-bit Windows: Version 11.2.0.2.0 - Production on 10-AUG-2016 14:09:27

Copyright (c) 1991, 2014, Oracle. All rights reserved.

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 - Production
Start Date 10-AUG-2016 13:03:59
Uptime 0 days 1 hr. 5 min. 34 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Default Service XE
Listener Parameter File C:\dev\env\oracle11gXE\app\oracle\product\11.2.0\server\network\admin\listener.ora
Listener Log File C:\dev\env\oracle11gXE\app\oracle\diag\tnslsnr\DCNU251B78K\listener\alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=DCNU251B78K.mycompany.com)(PORT=1521)))
(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...
Service "XEXDB" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
Service "xe" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
The command completed successfully

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s