Weblog

Oracle XE installation on Debian

I just tried installing Oracle Express Edition on Debian 3.1, but without much luck. I guess this really is a beta release.

The linux version is currently distributed as an rpm file, so i converted it to a deb file using alien:

alien -d --test  -c --verbose oracle-xe-10.2.0.1-0.1.i386.rpm

Next I installed the deb file using apt-get, this worked without problems:

debian:/etc# apt-get install oracle-xe
Reading Package Lists... Done
Building Dependency Tree... Done
The following NEW packages will be installed:
  oracle-xe
0 upgraded, 1 newly installed, 0 to remove and 6 not upgraded.
Need to get 0B/198MB of archives.
After unpacking 384MB of additional disk space will be used.
(Reading database ... 13700 files and directories currently installed.)
Unpacking oracle-xe (from .../oracle-xe_10.2.0.1-1.1_i386.deb) ...
Setting up oracle-xe (10.2.0.1-1.1) ...
Executing Post-install steps..........

You must run '/etc/init.d/oracle-xe configure' as root user to
configure the database.

So far, so good. But this is where the problems start. I tried running the oracle-xe script as indicated in the apt-get output:

debian:/etc/init.d# /etc/init.d/oracle-xe configure
/etc/init.d/oracle-xe: line 16: /etc/init.d/functions: No such file or directory
/etc/init.d/oracle-xe: line 99: init_status: command not found
...
...
Configuring Database...
/etc/init.d/oracle-xe: line 131: /etc/sysconfig/oracle-xe-config: No such file or directory
Starting Oracle Net Listener.
/etc/init.d/oracle-xe: line 493: /sbin/chkconfig: No such file or directory
You need to configure Oracle Database 10g Express Edition before you can start it.

So now i’m pretty much stuck. Anybody know how to solve this, or is this release just too beta?

Update:
This article is really outdated. There’s nothing easier than installing the production version of Oracle XE on Debian. You can apt-get install the database, no sweat.

Oracle Express Edition

Oracle is going to release a free version of it’s database: Oracle 10G Express Edition. You can read about it on CRN: Free Oracle Database Takes On MySQL, SQL Server Express, CNET: Oracle to offer free database, Sergio’s Blog: Oracle Database 10g Express Edition Comes With HTML DB Pre-configured, and Wim Coekaerts’ Blog: oracle express edition. It’s currently still in beta. Included with Oracle XE is HTMLDB.

According to Sergio it’s very quick to install: “I guarantee you that you’ve never seen a database up and running this quickly”. This is something i doubted. How can it beat “apt-get install mysql-server”? Well, it doesn’t beat it, but it still matches the installation speed. The linux version is distributed as an easy to install rpm. Installing mysql is probably still faster, thanks to the smaller size of mysql. Anyway, good enough.

It’s good to see Oracle supporting standard installation procedures on Linux. This has always been one of the attractions of linux for me: the easy of installation. Do you want a web server? “apt-get install apache”. Need a database? “apt-get install mysql-server”. Need to get the latest security patches? More apt-get.

The biggest problem with the current Oracle release for linux is that it’s only certified on two expensive linux distributions (although you can use a Red Hat Enterprise Linux clone like Centos). This is not really a good situation for a free database. If you don’t want to pay for a database, why would you want to pay large sums of money for your operating system? I’m glad to see that this has also been addressed: Debian 3.1 and Fedora Core 4 are among the supported linux distributions.

My first Ruby on Rails experience..

Tired after a week of work, I decided to dive into the world of Ruby and its budy Rails. Together they are known as Ruby on Rails. I was made enthousiastic about Ruby and Ruby on Rails by the positive stories from users on the web.

Shortly explained, Ruby is an full OO language developed in the mid-90s by a Japanese guy who was not satisfied with scripting languages like perl or python. He wanted to create his own language that was more powerfull than Perl or Python and is more OO than Python. In Japan, Ruby is now more popular than Python.

Rails is a full-stack, open-source web framework in Ruby for writing real-world applications with joy and less code than most frameworks spend doing XML sit-ups (definition from the Ruby on Rails homepage). One great benefit of Rails is that it does not use any XML descriptor files/configuration files, compared to other commonly used MVC frameworks (Spring, JSF and Struts). Instead of using XML configuration, Ruby on Rails relies on naming-conventions in the code. So you can now say that Ruby is the OO-language part of Ruby on Rails and Rails is the MVC part of it.

To get familiar with Ruby On Rails, I tried a nice tutorial from O’reilly: Rolling with Ruby on Rails. This tutorial starts with explaining how to install Ruby and Rails and how to integrate it with a MySQL database. It explains how to use Ruby on Rails with a Cookbook case.

Doing the tutorial, several things caught my attention:

  • The ease of developing a model-layer from database tables, relying on naming conventions and using the Ruby feature of dynamically populating a method with new methods.
  • The use of build-in generation scripts for default-skeletons model and controller classes or to set up a default application directory tree.
  • Everything is written in Ruby and you do not have to bother about configuration files. For example, urls are mapped to def-attributes in the controller-class. So when you make a change in your code you can just reload the page to test it.

After completed the tutorial, I certainly want to know more about the functionality and features of Ruby on Rails. My opinion (for so far I know Ruby on Rails and read blog-postings by others) about Ruby on Rails is that it is a complete MVC framework in which you can build rapidly web-applications in a OO way.

However, I do not have a clear view to compare Ruby on Rails fairly with other MVC frameworks for web development at this moment.

Conclusion: go and try it yourself!

Technorati Tags: ,

BPEL seminar

bpel logo

Are you interested in learning from a real life BPEL case? IT-eye consultants Mike van Alst and Peter Paul van de Beek have been doing nothing but BPEL for the last months. November 24th they will present their experiences with the BPEL process manager at an IT-eye seminar called: Where SOA needs BPEL. This seminar is in de Meern, the Netherlands, (Oracle offices) and will be in dutch. More info on the IT-eye website.

8i and the AL32UTF8 Character set

The project I am currently working on is in the process of migrating several 8.1.7.4 databases to 10.2.0.1. The 10gR2 databases have been created with the AL32UTF8 character set. There are several other sites that wont be upgraded for several months, these sites will be fed with exports from one of the 10GR2 databases.

During the first test to see if the replication still works the 8i export utility crashes when run against the 10GR2 database without any error codes. Using trace=y during the export and the help of Oracle support it was quickly determined that the AL32UTF8 character set was the problem.

Oracle8i has problems using databases with the AL32UTF8 set, searching metalink it is clear that these problems are not solely with the export utility but with the whole range eg database links, Sql*Plus client etc. As the existing patches, now up to 8.1.7.4. Patch 23, for the 8i client don’t solve the problem the only way to perform a export against a 10GR2 database is to use the UTF8 database character set.

From metalink note 237593.1 Problems connecting to AL32UTF8 databases from older versions (8i and lower)

Besides the difference in Unicode version the “big difference” is that
AL32UTF8 has build in support for “Surrogate Pairs”
(also known as Surrogate characters or “Supplementary characters” ).

Practically this means that in 99% of the cases you can use UTF8
instead of AL32UTF8 without any problem.

There are only a few situations where Surrogate Pairs are already used
on client side. Windows systems with HKSCS (1999 & 2001 hong kong extension)
is one of those.

And

Note that if you now use UTF8 as database character set and -in the future-
You do a roll out of new 9i or higher clients and all your other databases are
upgraded to 9i or higher, you can simply do a alter database characterset
to go from UTF8 to AL32UTF8 so downtime will be limited to a few minutes
if the need to go to AL32UTF8 should arise.
There is no performance impact on staying on UTF8 vs AL32UTF8

When the other sites are also using 10GR2 we will upgrade the last database to AL32UTF8 meaning all our databases will once again use the same character set.

Bulletproof web design

Bulletproof web design

While preparing a presentation on XHTML and CSS last week i found “Bulletproof web design” in my local bookstore. This is really a must have book if you’re starting with CSS and you want to know what works in most browsers.

CSS can be a pain when you start using it, sometimes it seems like every browser renders your html page differently. This is where Bulletproof web design really helps. It doesn’t just teach you CSS, instead it shows you how to use CSS in a way which will work in all browsers.

Topics covered in the book are flexible text (making sure everybody can resize the text of a webpage), resizeable and accessible tabs, layout, and a lot more. It illustrates how you use background images in CSS to determine the look and feel of your website.

Highly recommended.

Invoking the Connection Manager on a Pocket PC from a Java application

Recently, I have developed a Java application that uses Oracle Lite to access enterprise data. Whenever the java application inserts new data into the appropriate olite tables on the PDA it invokes the synchronization mechanism of Oracle Lite to synchronize with the server. For this the application uses the functions in sync.jar.

This works fine whenever the PDA is connected to the internet through GPRS. When the PDA is not connected the sync-mechanism of oracle lite (and the Connection manager on the PDA) does not automatically restore the connection, but just returns with an error message. This can become unhandy when you walk through an area where you sometimes have GPRS coverage and sometimes have not. You do not want to force the user to manually restore the connection each time the GPRS coverage is restored.

To overcome this problem, I have implemented a C++ dll that contains a function that recoveres the connection programmatically by using the Connection Manager API provided by WinCe. Using this API you can establish a connection from within an application (Inter Explorer on the PDA does the same trick).

I used the Embedded Visual C++ Studio from Microsoft to develop the DLL containing the C-function showed in the code fragment below. Here’s is the C++ code (Note the JNI and Java prefixes!):

#include "stdafx.h"
//Import of the JNI header file
#include "nl_comp_fifa_JNIConnMgr.h"

#include <winsock.h>

#define INITGUID

#if !defined(AFX_CONNECTION_H__33D8B1CD_31D7_409D_8565_D53240608E57__INCLUDED_)
#define AFX_CONNECTION_H__33D8B1CD_31D7_409D_8565_D53240608E57__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <initguid.h>
#include <connmgr.h>
#include <connmgr_proxy.h>
#pragma comment( lib, "cellcore.lib" )
#endif;

/*
extern const GUID IID_ConnPrv_IProxyExtension;
*/

    HANDLE  m_hConnection;  // Connection Manager Handle
    DWORD   m_dwStatus;
	DWORD   dwStatus;

    /*
	 * JNI function call
	 * nl.comp.fifa
	 */
	JNIEXPORT jstring JNICALL Java_nl_comp_fifa_JNIConnMgr_connectionRecovery
	(JNIEnv* env, jclass cl)
	{
		jstring jstr;
		char debug[] = "Debug\n";
		jstr = env -> NewStringUTF(greeting);

        CONNMGR_CONNECTIONINFO ConnInfo={0};
        ConnInfo.cbSize=sizeof(ConnInfo);
        ConnInfo.dwParams=CONNMGR_PARAM_GUIDDESTNET;
        ConnInfo.dwFlags= 0;
        ConnInfo.dwPriority=CONNMGR_PRIORITY_USERINTERACTIVE ;
        ConnInfo.guidDestNet=IID_DestNetInternet;
		ConnInfo.bExclusive=FALSE;
        ConnInfo.bDisabled=FALSE;

		HRESULT hr = ConnMgrEstablishConnectionSync(&ConnInfo,&m_hConnection,60000, &dwStatus);
		m_dwStatus = dwStatus;

		//DEBUG INFO

		if(m_dwStatus == CONNMGR_STATUS_CONNECTED)
		{
		   sprintf(debug, "Status Conn: %d", hr);
		}
		else
		{
		   sprintf(debug, "Status FAI: %d", hr);
		}

		jstr = env -> NewStringUTF(greeting);
		return jstr;
	}

In the above code-fragment you can see that the function name contains JNI and Java fragments. This reveals that I have used a JNI bridge to call C functions from Java. This is needed because yoy can not directly invoke the Connection Manager APi from Java.

In the code fragment below is the code fragment that invokes the function Java_nl_comp_fifa_JNIConnMgr_connectionRecovery. Note that the package full name is visible in the name of the header file (generated with javah) as well as in the function name. This needed to find the function in the dll.

package nl.comp.fifa;

/**
 * This class is used
 * to invoke the Connection Manager
 * through JNI.
 *
 * The class contains a single static method that is invoked
 * to recover the GPRS connection.
 */
public class JNIConnMgr
{
 public static native String connectionRecovery();

 //Load the library
 static{
 System.loadLibrary("JNIConnMgr");
 }

}

Note that you have to put the .dll file under the Windows-dir on the pda. Otherwise, you have to specify the location of dll explicitly by using the -Djava.library.path argument on the command-line.

You can now use this function to reconnect the PDA whenever this is needed. Note that the c-function only tries to connect when the PDA is not already connected.

Checkboxes and Struts DynaActionForms

Checkbox values are not submitted in a request when they are unchecked. This means that the corresponding value of a checkbox is not updated when you use a DynaActionForm (or ActionForm).
This behaviour results in the situtation that values of the checkboxes remains true from the moment you have selected them.

So, what’s the problem? we still have a reset() that is called implicitly before each repopulation of the form property-values in the form.

The problem is that, instead of the reset() method of an ActionForm, the reset() method of a DynaActionForm does nothing. So the simple solution for the “checkbox” problem is to overwrite the reset() method in a subclass and use the subclass instead of the default DynaActionForm.

Technology
Ben jij slim genoeg voor IT-eye