hross: August 2009 Archives

Configuring Oracle XE

| | Comments (0) | TrackBacks (0)

Lately I have found myself setting up a lot of Amazon EC2 instances, new computers, virtual machines and the like. As such, I’ve come to know and love Oracle XE. While it “just works”, there are a few tweaks that vastly improve performance and behavior. All of these tweaks require you to log in as the system user and run the noted SQL. In no particular order, they are:

  1. Modifying the default listening port of the web server (why is it listening on the default Tomcat port?!):
    begin
    	dbms_xdb.sethttpport('7080');
    	dbms_xdb.setftpport('2100');
    end;
  2. Increasing the number of sessions and processes so you don’t get locked out of the database:
    alter system set sessions=250 scope=spfile;
    alter system set processes=200 scope=spfile;
  3. Making the web server available for non-local access (in case you are running out of a console):
    begin 
    	dbms_xdb.setlistnerlocalaccess(false); 
    end;

Here are the original links for these tips:

Finally, I have a tip of my own. If you are running Oracle XE in an EC2 instance (see this article), you will undoubtedly notice that when you restart your brand new AMI with a new IP, Oracle will fail to start (doh!). In order to fix this, you need to do the following:

  1. Make copies of your listener.ora and tnsnames.ora files. Modify them so that your current hostname in EC2 is replaced with “localhost”, and rename them to listener.ora.localhost and tnsnames.ora.localhost.
  2. Add this script to the /etc/init.d/oracle-xe startup script (under start is preferable):
    NEWHOST=`hostname`
    
    sed s/localhost/$NEWHOST/ /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin/listener.ora.localhost > /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin/listener.ora
    sed s/localhost/$NEWHOST/ /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin/tnsnames.ora.localhost > /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin/tnsnames.ora
  3. Profit (you may want to modify the above to run as the oracle user -- not as root).

(sorry Windows users, you will have to create your own variation of this)

About this Archive

This page is a archive of recent entries written by hross in August 2009.

hross: May 2009 is the previous archive.

hross: September 2009 is the next archive.

Blogroll


Integryst

Function1

Fabien Sanglier

Bill Benac

Jordan Rose

Chris Bucchere

Robert Herrera

Nanek Blog Aggregator

Spartan Java




if you'd like to be listed here.




I don't blog about non-tech issues here, but you can check my Google Reader Shared Items if you want to know what I'm currently interested in.

Categories