Installing Informix on Linux

Create an informix user and group:

     su
     /usr/sbin/useradd -c "Informix database" -m informix

If you want to give the new userid a password:

     su
     passwd informix

Load the latest tar files for the Linux distribution onto a suitable Linux machine (e.g. CentOS 4, 5, 6, RedHat 9, RedHat EL4, El5 or EL6). At a minimum, the three files for the 4GL RDS, SQL Development and Informix SE are required. You may also have files for the debugger and esql for C. And, finally, you will probably need to have the files for the client SDK and possibly connect.

For later versions of Informix, the tar files will have names like CZ22MEN.tar and C57Z3NA.tar. You'll just have to keep the names straight, as the files are named by IBM to indicate what version of the software they supply, not the names of the components actually contained within the tar files. You may be able to figure out which file installs which component by listing the contents of the tar file and looking for the install program itself. For example:

     tar -tf CZ22MEN.tar

Even if you can figure out which component is contained within a file, you'll still have to remember which version it represents and whether it is 32-bit or 64-bit, and carefully pick the one that you want. Below are some examples of Informix install files that we know to work on different versions of Linux.

The install files for RedHat Linux, versions 8 and 9 are:

     4GL_RDSDeveloper-7.32.UC1.tar
     ClientSDK.2.81.UC3.LINUX-I32.tar
     SQLDevelopment-7.32.UC1.tar
     InformixSE-7.25.UC6.tar

The install files for RedHat Enterprise Linux (4 or 5) or CentOS, version 5 are:

     C97BLNA.tar - contains install4db (4GL debugger)
     C97BJNA.tar - contains install4gp
     C97BMNA.tar - contains installsql
     se.7.25.uc6r1.linux32.tar - contains installse

Later versions of Enterprise Linux 5 or CentOS (5.5) are known to work with these install files:

     CZFQ1EN.tar - contains install4db (4GL debugger)
     CZFV6EN.tar - contains install4gp
     CZFZ5EN.tar - contains installsql
     C56DANA.tar - contains installse (7.25.UC6R1)

CentOS 6.3 and 6.4 (and presumably RedHat 6) work with the following install files:

     CZ22QEN.tar - contains install4db (7.50.FC3, 4GL debugger, 32-bit)
     CZ22MEN.tar - contains install4gp (7.50.FC3, 32-bit)
     C57Z3NA.tar - contains esql.rpm
     CZ22EEN.tar - contains installsql (7.50.FC3, 32-bit)
     C56DANA.tar - contains installse (7.25.UC6R1)

In the last case, the files are all 32-bit files. Be sure that you have the correct install files (i.e. all 32-bit or all 64-bit), depending on the OS that you've installed. The RDS, for example, comes in two files CZ22MEN.tar and CZ22MEN.tar. The first is 32-bit and the later is the 64-bit version. If in doubt, install the 32-bit versions since they should also run on a 64-bit OS.

Informix is typically installed in the /usr/share/informix directory. You will need to create this directory like this:

     su
     mkdir /usr/share/informix
     chown informix:informix /usr/share/informix

The tar files should be placed in a suitable archive location. Since you created an informix user, their home directory (e.g. /home/informix) is a good spot for the archive. Or, an "informix" subdirectory in the home directory of the installing user is another possible spot where the tar files can be archived. You will also need to temporarily copy them to /usr/share/informix, because you will be untarring them there. For example:

     cp /home/informix/distributions/CZ22MEN.tar /usr/share/informix

The install program doesn't do much. Basically, you untar the distribution files in the top level directory where they will live (/usr/share/informix) and tar builds the ultimate directory structure. The install scripts just set up file permissions and a few links and things, and register the installed modules, but don't do any actual copying. This clever move was done in order to make it much easier for the guy who wrote the installation script but it does nothing but create trouble for the guy installing the product.

Because of the way installation is done, you must always install the Informix software in the following order:

     Application development tools like the 4GL debugger, rapid development
     system, and the SQL development environment (oldest to newest)
     SQL APIs like esqlc (oldest to newest)
     Database servers like Informix SE (oldest to newest)
     Any additional products like documentation (oldest to newest)

Failure to do so will result in a major disaster. The reason being that the extracted files from the later component installations will overwrite those files with the same names from the earlier component installations. Since the Informix database server is the most important component, if its files were overwritten by the debugger's files, problems could arise. Installing the debugger, and other, lesser components first precludes this from happening.

So, if you have any other distributions than those specifically mentioned herein, install them in the order shown above.

Begin the installation by setting the Informix environment variable INFORMIXDIR and exporting it:

     export INFORMIXDIR=/usr/share/informix

Untar the distribution files directly in /usr/share/informix:

     su informix
     cd /usr/share/informix
     tar -xvf install_file_1
          .
          .
          .
     tar -xvf install_file_n

This will build the proper directory structure, unpack the files that belong in it and create install scripts for each distribution. Run the install scripts as super user, in this order:

     su
     ./install4db (if you have the debugger and this install file is present)
     ./install4gp
     ./installsql
     ./installse

Note that the install may ask for license numbers and keys. It does not seem to be too discriminating. We have used license keys from many years ago and they still seem to be acceptable. So, give whatever number/key you have on hand a try and see what happens before you spend a lot of time looking for the "proper" one, if its not readily available.

It would appear that the client SDK is also required for Informix applications to work on most versions of Linux. If it turns out to be required on your version of Linux (if in doubt, it probably is), load its tar file onto the system and untar it:

     cp /home/informix/distributions/clientsdk.tar /usr/share/informix
     su informix
     cd /usr/share/informix
     tar -xvf clientsdk.tar

For earlier versions of the Client SDK, untarring the distribution file will add some doc files to the documentation directory and then create a cpio file. Run the command to extract the cpio file.

     cpio -i <csdk.cpi

Several smaller cpio files and some install files will result. With the INFORMIXDIR environment variable still set and running as super user, do the install:

     su
     ./installclientsdk

For later versions of the Client SDK (and the Connect component), it would appear that some genius has decided that what used to be a simple install script should now be a Java application from InstallShield. Apart from the good news that you now require about 24M of bloatware to do a few simple copies, there is a requirement in this fabulous code, for certain runtime routines, that preclude it from working with the standard Open Java Project JRE that is installed by your OS.

Consequently, to get this piece of junk to work, you either need to go to the Oracle Web site and get the proper Java runtime from Larry, if your OS is CentOS or RedHat or any of the other operating systems that use RPMs to install packages, or, if your OS is Ubuntu, you need to install the proper runtime from the Partner Repository.

Unfortunately, there is one other wrinkle. The latest Java runtime also appears not to work -- only the SE 6 version is any good. Luckily, it is still available from Oracle and Canonical.

Under CentOS/RedHat/etc., begin by selecting and downloading the latest SE 6 update from this site:

     http://www.oracle.com/technetwork/java/javase/downloads/index.html

On the page mentioned above, under the "Java SE 6 Update xx" row, you’ll see a button for "JRE Download". Click that button and, on the page that ensues, select the Linux x86 "rpm.bin" file (e.g. jre-6u37-linux-i586-rpm.bin). Save the downloaded file somewhere where you can run it.

At some point in time, the latest 7uxx version of Java will be fixed and it no longer will cause conflicts with almost every Java application currently in use, including Libre Office. At that time, you can use it instead. Until then, when Oracle fixes it, stick with the latest update for 6uxx.

The downloaded file is not your typical RPM. To install it, make sure it has execute permissions and then, as root, run it:

     chmod ugo+x jre-6u37-linux-i586-rpm.bin
     su
     ./jre-6u37-linux-i586-rpm.bin

If you wish, since the Oracle version of the Java runtime is better than the Open Java Project runtime, which is typically bundled with most versions of Linux, you can tell the OS to start using this version of Java. This is done by pointing the alternative Java at the one we've just installed:

     /usr/sbin/alternatives --install /usr/bin/java java \
       /usr/java/default/bin/java 20000

If you are doing this, you should also make Mozilla and any other browser in the system, use this new Java. We'll use the alternatives command once again:

     /usr/sbin/alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so \
       libjavaplugin.so /usr/java/default/jre/lib/i386/libnpjp2.so 20000

Under Ubuntu, the Oracle/Sun Java has been moved to the Partner Repository but it still can be easily installed by apt-get, if you add the Partner Repository to the list of repositories that apt-get uses. The instructions for installing from the Partner Repository depend on which version of Ubuntu you are running. Where the word "osvername" appears, you should replace that name with the name of your OS version:

     Ubuntu 10.04 LTS  - lucid
     Ubuntu 10.10      - maverick
     Ubuntu 11.04      - natty
     Ubuntu 11.10      - oneric
     Ubuntu 12.04 LTS  - precise
     Ubuntu 12.10      - quantal

Here are the instructions:

     su
     add-apt-repository "deb http://archive.canonical.com/ osvername partner"
     apt-get update
     apt-get install sun-java6-jre sun-java6-plugin

As with CentOS/RedHat, since the Oracle version of the Java runtime is better than the Open Java Project runtime which is bundled with Ubuntu, if you wish, you can tell the OS to start using this version of Java. This is done by pointing the alternative Java at the one we've just installed:

     su
     update-alternatives --config java

After you install the Oracle/Sun Java, you should be able to run the install script. As far as we can tell, except for being a major pain in the butt, the new install script does nothing that a plain old shell script wouldn't have done (buy, hey, this is progress). Apparently, IBM doesn't see the irony in requiring you to install software from the OTHER database vendor before you can install their database.

Just in case you now find yourself in another directory from the Informix install directory, you should change back to it. You should also make sure that the Informix environment variable INFORMIXDIR is set correctly and then take care to export it. Once these are done, become super user and run the client install:

     cd /usr/share/informix
     export INFORMIXDIR=/usr/share/informix
     su
     ./installclientsdk

If you still get an error message or the install fails, under CentOS/RedHat you can try:

     ./installclientsdk -javahome /usr/java/default

Under Ubuntu you can try:

     ./installclientsdk -javahome /usr/lib/jvm/java-6-sun/jre/

Some intermediate versions of Informix may require Connect for your Informix applications to work. If this proves to be the case (it doesn't appear to be so with the latest version of Informix), begin by loading its tar file onto the Linux machine and untarring it. For example:

     tar -xvf connect.3.50.UC6.LINUX.tar

This will contain the installconnect script, which you should then run as super user:

     su
     ./installconnect

Note that the main install appears to install GLS and the messages so there is no need to run install_gls or install_msg. Also note that we say "No" for version 9 of the engine as this seems to be a good choice.

As we noted earlier, the Informix software must always be installed in the following order because failure to do so will result in a major disaster:

     Application development tools (oldest to newest)
     SQL APIs (oldest to newest)
     Database servers (oldest to newest)
     Any additional products like documentation (oldest to newest)

This being the case, if you have any other distributions than those that we have explicitly covered in these instructions, you will need to figure out where they fit in the big scheme of things and install them in correct order.

Once all of the installs are done and before you proceed too much further, you may wish to test a few of the Informix programs that were installed. Testing them can be as simple as typing their names at the command line. For example, we'd suggest you try:

     /usr/share/informix/bin/dbaccess
     /usr/share/informix/bin/fglpc
     /usr/share/informix/bin/isql
     /usr/share/informix/bin/secheck

These commands will test most of the installed packages and let you know if the basic Informix functionality will run. If you see an error that says "cannot execute binary file", it is probable that you installed the wrong version of Informix on your system. For example, on a system that has the 32-bit C-library installed, you've installed the 64-bit version of Informix. You can find out more information about the executables that you've installed with the file command, like this:

     file /usr/share/informix/bin/isql

The output from this command should reveal what type of executable is installed. For example, you might see:

     /usr/share/informix/bin/isql: ELF 32-bit LSB executable, Intel 80386,
       version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux
       2.2.5, not stripped

If your system is a 32-bit system, you're in top shape. If it is a 64-bit system, your day just got worse. You might consider reinstalling (in the proper order) the Informix packages again, but this time using the correct ones.

Whether Informix is to be invoked by remote clients, through TCP, or locally in loopback mode, you need to assign a service number for the database server in /etc/services (if you think the unnamed pipes/IPC thing works, give your head a shake). Since Informix didn't see fit to request a well-known port from IANA, we'll use the Sybase port (1498). Hack /etc/services and change or add port 1498:

     informix      1498/tcp                   # Sybase (usurped by Informix)

Rename the sqlhosts file in the /usr/share/informix/etc subdirectory to sqlhosts.demo and then make a copy of it as sqlhosts:

     cd /usr/share/informix/etc
     mv sqlhosts sqlhosts.demo
     cp sqlhosts.demo sqlhosts

If you are just setting up a database server that can be used by TCP clients, hack the sqlhosts file to read:

     servname sesoctcp machname informix

Where servname is the name you'll call the Informix service (can be equal to the machine name for simplicity sake), "sesoctcp" specifies that TCP sockets are to be used (remember that unnamed pipes are a losing proposition), machname is the name of the machine that runs the database (as defined in /etc/hosts or resolved through DNS) and "informix" is the well-known port name of the database server, as defined in /etc/services.

If you want to use IPX, you'll need to read the Database Server Administrator's Guide because it is beyond what we care enough about to describe herein.

Note that, in order for the server and all its clients to play the same game, they must all be shown the same files at /usr/share/informix/etc/sqlhosts and /etc/services. Here is an example of /usr/share/informix/etc/sqlhosts:

     #*************************************************************************
     #
     # File used to describe Informix servers, which protocols they use and
     # what is run to service the requests.
     #
     #*************************************************************************
     deltoids       sesoctcp  deltoids       informix  # Well-known port

Before you can do anything with the database server, you must start it as root. As a matter of fact, a good test to see whether Informix is properly installed is to start it as root. The following shell commands will take care of starting it:

     su
     export INFORMIXDIR=/usr/share/informix
     $INFORMIXDIR/lib/sqlexecd deltoids -l /var/log/sqlexecd.log

Note that, if you get a -930 error, it is probably because your host's name does not appear in the /etc/hosts file, exactly the way Informix is looking for it or the name is not being looked up properly in DNS. The message that accompanies the -930 error indicates which host name Informix is looking for.