migrating mod_plsql application to Oracle REST Data Services

My shop is pretty much in the same situation as you are. We also have some very large mod_plsql/htp based applications and will have to migrate to the Oracle REST Data Services at some point.

We have already spend quite some time in testing different ORDS configuration and our overall conclusions are:

  • only APEX applications are fully supported
  • key functionality is still available
  • harder to configure and maintain
  • slight performance degradation
  • some mod_plsql configuration options do no longer exist or have changed

The biggest problems we are currently facing (and actually preventing us from switching to ORDS) are some restrictions when using non-APEX (pure HTF/HTP) applications. We already filed some SR's because some functionality in ORDS (for example the file upload and download API) is only available when running an APEX application.


Doug McMahon (Oracle employee) has a great open source module for Apache. Apache PL/SQL Gateway Module (mod_owa)

https://oss.oracle.com/projects/mod_owa/dist/documentation/modowa.htm

I am using it in a production environment and I highly recommend it. It's really fast and rock solid.

You need to do some compiling but it's worth it being able to use Apache 2.4 and mod_plsql.

Steps:

  1. download httpd 2.4.? from apache.org + extract
  2. If Centos 6 or less download apr and apr-util
  3. configure with enable-so, make and make install

    ./configure --enable-so --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr

  4. Download mod_owa + unzip

  5. create empty directory. Copy all files from "apache24" into new folder. Copy all files from "src" to new folder

  6. enter new folder and edit modowa.mk <-- important add $ORACLE_HOME, edit APACHE_TOP

  7. Copy mod_owa.so to apache's modules

  8. Add a modowa.conf in Apache's conf/ dir.

Example modowa.conf:

loadModule owa_module modules/mod_owa.so

<Location /pls>
    Options        None
    SetHandler     owa_handler
    OwaUserid      user/pass
    OwaNLS         AMERICAN_AMERICA.AL32UTF8
    OwaPool        100
    OwaStart       "package.procedure"
    OwaDocProc     "wwv_flow_file_mgr.process_download"
    OwaDocTable    photos_upload BLOB_CONTENT
    OwaUploadMax   50M
    OwaCharset     "utf8"
    order          deny,allow
    allow          from all
    OwaReset       LAZY
    OwaCharsize    4
    OwaFlex        package.procedure
    OwaHttp        REST 
</Location>

Before starting httpd ORACLE_HOME, NLS_LANG needs to be set (ORACLE_SID also if local). It needs access to an Oracle Home with libclntsh.so. (Oracle client will do).

I simply added oracle.conf (one line full path to oracle home/lib) under /etc/ld.so.conf.d (+ ldconfig)

Really scalable and a much cleaner setup then OHS.