In this article I will write about installing the Oracle Database 10g XE on Windows and changing the default port number for HTTP and optionally for FTP. The installer does not provide any customization option and you end up with the DB server instantly up and running reserving the port 1521 (a default for Oracle database servers), including an embedded HTTP listener set to a default port of 8080 which might conflict with some existing Java application servers or servlet containers such as Tomcat, JBoss Application Server and Glassfish which use the same port by default. Although it’s easy to start and stop the Oracle database with the shortcuts pre-installed in the Start menu, its http listener remains “on” at all times with no shortcut to be turned on and off easily.
In my case I already have Tomcat and Glassfish which are set to use the 8080 port as well, so I will show you how to modify the port number of Oracle 10g XE as I go along.
About APEX or what I would normally call Oracle (Application Express) 10g XE
Oracle Database 10g Express Edition (Oracle Database XE also goes by an abbreviated code name APEX) is an entry-level, small-footprint database based on the Oracle Database 10g Release 2 code base that’s free to develop, deploy, and distribute; fast to download; and simple to administer. Oracle Database XE is a great starter database for:
- Developers working on PHP, Java, .NET, XML, and Open Source applications
- DBAs who need a free, starter database for training and deployment
- Independent Software Vendors (ISVs) and hardware vendors who want a starter database to distribute free of charge
- Educational institutions and students who need a free database for their curriculum.
With Oracle Database XE, you can now develop and deploy applications with a powerful, proven, industry-leading infrastructure, and then upgrade when necessary without costly and complex migrations.
Welcome to Gökhan Ozar’s personal web site and blog!Welcome to Gökhan Ozar’s personal web site and blog!
Installing Oracle Database 10g Express Edition
Just download the double-clickable installer (named OracleXEUniv.exe ) from Oracle’s web site whose URL at the time of this writing was: http://www.oracle.com/technetwork/database/express-edition/downloads/index.html
Alternatively from the following (fast & direct download) link:
Double-click OracleXEUniv.exe and you should see a typical InstallShield window:
Changing the default port number of APEX (the port # 8080 of the http listener)
Now I don’t want APEX to block my Java EE application servers who need (and probably deserve) the 8080 port more. I’m quite OK with the light database server itself which is listening the port 1521.
In the console window type the commands as shown below and in the screenshot:
SQL> -- get current status
SQL> select dbms_xdb.gethttpport as "HTTP-Port"
, dbms_xdb.getftpport as "FTP-Port" from dual;
You can change the http port and the ftp port to whatever you like (keep in mind that you need special privileges for ports < 1024 on Unix/Linux systems).
SQL> -- set http port and ftp port
PL/SQL procedure successfully completed.
SQL> select dbms_xdb.gethttpport as “HTTP-Port”
, dbms_xdb.getftpport as “FTP-Port” from dual;
In my case I’m changing the HTTP port to 8888.
There I’m also changing the FTP port to 2100 which was 0 (disabled) by default.
If you only want to use the database without allowing access via HTTP or FTP then you can disable both:
SQL> -- disable http and ftp access SQL> begin 2 dbms_xdb.sethttpport('0'); 3 dbms_xdb.setftpport('0'); 4 end; 5 / PL/SQL procedure successfully completed. SQL> -- get current status SQL> select dbms_xdb.gethttpport as "HTTP-Port" , dbms_xdb.getftpport as "FTP-Port" from dual; HTTP-Port FTP-Port ---------- ---------- 0 0