Installation and Configuration
Installation is straightforward using the following steps:
- Use the su command to become root.
- Create a users' group named informix.
- Create a user named informix, whose group is
informix and whose home directory is the directory
containing the Informix files.
- 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:
- ESQLC/ESQL.TAR: ESQL-C libraries, headers and
tools
- ICONNECT/CONNECT.TAR: Informix networking tools
- SE/SE.TAR: The Informix standard engine and tools
- Move each archive into the directory into which you wish to install
Informix. For this example, we'll call it /opt/informix.
- 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.
- 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.
- Unpack the archive file ESQL.TAR, then execute script installesql.
- 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.
- 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.
- Edit /etc/services to describe the Informix service. For example:
sqlexec 8000/tcp
- 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.
- Set the environmental variable INFORMIXSERVER to the server name
you've selected.
- Edit file $INFORMIXDIR/etc/sqlhosts to describe the server. Each
entry in this file has four arguments, as follows:
- Characters 1-2 indicate the type of engine being accessed:
se: Informix standard engine
for Linux.
- Characters 3-5 indicate the method of connection:
(shared memory) can be used only for
processes running on the local host.
tli: transport-layer interface
soc: Berkeley sockets
- Characters 6-8: IPC mechanism or network protocol:
pip: named pipes
tcp: TCP/IP protocol
spx: IPX/SPX protocol
Note that not all combinations work under Linux.
For this example, we insert the following entry into sqlhosts:
dbexample sesoctcp myhost sqlexec
- Add directory $INFORMIXDIR/bin to your PATH.
- 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.
- 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:
- Execute command $INFORMIXDIR/bin/dbaccessdemo7. The output will
indicate whether you can connect to the Informix server.
- 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:
- Copy file $INFORMIXDIR/demo/esqlc/demo1.ec into the current
directory.
- The file should compile and link quickly. Type the command:
$INFORMIXDIR/bin/esql demo1.ec -o demo1
- 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.