return to first page linux journal archive
keywordscontents

Installation and Configuration

Installation is straightforward using the following steps:

  1. Use the su command to become root.

  2. Create a users' group named informix.

  3. Create a user named informix, whose group is informix and whose home directory is the directory containing the Informix files.

  4. Use unzip to unpack the archive. This creates the directory /LINUX_se_bundle724UC5, which in turn contains directories /ESQLC, /ICONNECT and /SE. Each of the three newly created directories includes a tar archive:

  5. Move each archive into the directory into which you wish to install Informix. For this example, we'll call it /opt/informix.

  6. Use cd to move to the /opt/informix directory. Set environmental variable INFORMIXDIR to /opt/informix. INFORMIXDIR must match the current directory, or installation will fail.

  7. Unpack the tar archive file CONNECT.TAR. Execute script installconn. You will be asked to enter the serial number and key that Informix mailed to you on registration. Be sure that you execute the script before you unpack another archive.

  8. Unpack the archive file ESQL.TAR, then execute script installesql.

  9. Unpack SE.TAR, then execute script installse.

Configuration

Configuration is more complex than installation. The following directions assume that you want to install Informix to use a socket connection.

  1. Select the name and socket number for the Informix service. In this example, we'll call the Informix service sqlexec. You can, of course, have multiple Informix services running simultaneously.

  2. Edit /etc/services to describe the Informix service. For example:
    	sqlexec	8000/tcp
    
  3. Select the name of the Informix server you wish to set. You can set multiple Informix servers, each of which communicates with a given Informix service in its own way (sockets, shared memory, named pipes or whatever). In this example, we'll call the service dbexample.

  4. Set the environmental variable INFORMIXSERVER to the server name you've selected.

  5. Edit file $INFORMIXDIR/etc/sqlhosts to describe the server. Each entry in this file has four arguments, as follows:

    	dbexample  sesoctcp  myhost  sqlexec
    
  6. Add directory $INFORMIXDIR/bin to your PATH.

  7. Make the shared libraries in directories /usr/lib, $INFORMIXDIR/lib and $INFORMIXDIR/lib/esql visible to Informix. (/usr/lib holds libcrypt, which Informix requires.) You can do this by either adding them to LD_LIBRARY_PATH or adding them to the /etc/ld.so.conf file and typing /sbin/ldconfig. The latter method is preferred, as it speeds up program loading.

  8. To run Informix, fire up the server with this command:
	$INFORMIXDIR/lib/sqlexecd dbexample

Testing

Informix comes with an example database called stores, and a set of example programs. We'll set up the database, then compile and run one of the example programs.

To create the database, do the following:

  1. Execute command $INFORMIXDIR/bin/dbaccessdemo7. The output will indicate whether you can connect to the Informix server.

  2. By default, Informix creates the directory that holds database files in the current directory. To access the database from throughout your system, set environmental variable DBPATH to point to the directory that holds the database. If you are working with more than one database, name each directory in the DBPATH.
To do a test compilation, do the following:

  1. Copy file $INFORMIXDIR/demo/esqlc/demo1.ec into the current directory.

  2. The file should compile and link quickly. Type the command:
    	$INFORMIXDIR/bin/esql demo1.ec -o demo1
    
  3. Run the compiled program with the command demo1. You should see the following output:
    	DEMO1 Sample ESQL Program running.
    	SQLSTATE after fetch is 24000
    	DEMO1 Sample Program over.
    

Now You're On Your Own

At this point, you're on your own. You will probably want to add a script that turns on Informix when you boot your system and modify /etc/profile to set up the appropriate environment whenever you log in.

You can obtain a copy of the Informix documentation from the Informix site. Be sure to obtain a copy of the Informix-SE Administrator's Guide; this is a short document, but is invaluable to running Informix-SE.