Monthly Archives: January 2008

Oracle SID != SERVICE_NAME

… or how to setup your Oracle XE database so that JDBC database urls will work like they traditionally have.

For many years Oracle has been telling everyone Oracle SID != SERVICE_NAME.

Java Developers have always smiled and nodded with this statement as the oracle thin client jdbc url would always be something like:

jdbc:oracle:thin:@server:1521:SERVICE_NAME, or
jdbc:oracle:thin:@server:1521:SID 

which would work because databases always either had the SID and SERVICE_NAME as the same, or there was some magic that the Oracle listeners did to make this work.

Somewhere in the past couple of releases of Oracle this transparent mapping has ceased to exist. In particular Oracle 10G XE out of the box doesn’t support this sort of option.

It seems the new preferred way of doing Oracle JDBC URLs is:
jdbc:oracle:thin:@server:1521/SERVICE_NAME.

I discovered this information while working with making a WebSphere Portal instance use Oracle as it’s data repository. The documentation for doing this suggested using the old school SID style of url.  I tried this first as it felt familiar, but things didn't work.  Changing the url to use the PORT/SERVICE_NAME approach looked to mostly work, but didn’t quite spread the changes to everywhere required. I needed to run WPSConfig connect-database to update all the hidden bits of configuration around the portal installation. Unfortunately, this failed as the wpsconfig script calls out to programs that expect the url to follow the old school syntax (the stack trace show an index-out-of-bounds exception while parsing connect srings). I then had to go in and update the configuration on the database to enable connection via the old SID style approach.

This was done by working on the listener.ora file
(C:\oraclexe\app\oracle\product\10.2.0\server\NETWORK\ADMIN) to add in a SID_LIST_LISTENER entry for the database.

This was simply to add:
(SID_DESC =
    (GLOBAL_NAME = XE)
    (SID_NAME = XE)
    (ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
)

to the SID_LIST of the SID_LIST_LISTENER

I ended up with a SID_LIST_LISTENER that looks like this:

SID_LIST_LISTENER =
    (SID_LIST =
        (SID_DESC =
            (SID_NAME = PLSExtProc)
            (ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
            (PROGRAM = extproc)
        )
        (SID_DESC =
            (SID_NAME = CLRExtProc)
            (ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
            (PROGRAM = extproc)
        )
        (SID_DESC =
            (GLOBAL_NAME = XE)
            (SID_NAME = XE)
            (ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
        )
    )

This configuration works with an out of the box Oracle XE installation, and lets me use the jdbc:oracle:thin:@server:1521:SID.

Drupal First Impressions

As I recently posted, I’ve been using wordpress everywhere currently. It is simple and easy to use. I am, however, always prepared to learn new things, and use the appropriate tools for a job. So, after hearing drupal come up as an open source CMS at the CMPros summit in Boston, I figured that I’d try it out.

The basic install process was pretty straight forward. Download and untar the install available from drupal.org. I created the user for the database on my mysql instance, and followed the simple install guide to get it up and running, which finished with me having created an admin account and logging in as admin.

After completing the basic install, it was relatively easy to go and create content. The front page includes a create content link available, making it easy to create stories and static pages. I could go in and do this quickly, and get some nice rapid gratification by creating content. Unfortunately the urls were kinda ugly and drupalish. I wasn’t happy, figured that someone had to have come up with a way to do nice urls. I started with a quick look at the admins screen, and almost ran away after seeing the huge number of options.

Drupal Admin Screens

Google came to the rescue, and I downloaded the pathauto tool, and started reading documentation. Getting the friendly urls definately isn’t as easy as in wordpress. I had to go in and edit the .htaccess and set the path option:  RewriteBase /~rob/drupal-5.3

Installing a module is pretty straight forward, and simply consists of copying it into the modules directory. It is then enabled through the gui, using: Administer>Modules. When I did this for pathauto I noticed dependancies on the path, and token modules, which needed to be resolved before pathauto could be run.

As token wasn’t installed by default I had to pause my installation of pathauto. So I was left with exploring path, and the rest of drupal. Path actually works ok. It makes it easy to specify friendly urls for your pages and stories, via a simple text field.

Pathauto works pretty well to. After getting it installed (just unpackaging the tars for pathauto and node into the modules directory) I was easily able to update the configuration to ensure friednly paths are created. Functionally this ends up making the urls work as well as wordpress. The admin interface also provides heaps of additional options (which I didn’t really need).

I’ve started putting together a proof-of-concept module for EditLive! as well. After some input from the legendary support engineer (Suneth), we got this working.

Overall drupal seems to be much more powerful that wordpress. Like wordpress has a rich module system, allowing people to customise and enrich their installation. It is a good enough system, and while I don’t plan on replacing my wordpress installations with it, I can see that it may be useful for bigger sites.