How to install and use Informix SE and ESQL/C on Linux
This is a "HOWTO" document on the installation and
configuration of the Informix Standard Engine (SE) database
engine and ESQL/C development tool on Linux. This document was
originally created by Nils Myklebust and is a work in progress.
It should, however give you the most essential install
information. More work needs to be done on how to use the
products, particularly ESQL/C.
Nils can be reached at
NM Data AS
P.O.Box 9090 Gr—nland
N-0133 Oslo
Norway
E-mail:
Nils.Myklebust@nmdata.com
Phone: +47 22 05 30 00
Fax: +47 22 05 31 11
Install the products
Do all the following while you are logged in as root:
- Download or install the distribution files in some
temporary directory, not where
you plan to install the product. If you downloaded from
the Informix site, you will need to unzip the files. If
you have the CD you can use them directly off that. You
end up with 3 tar files called ESQL.TAR, SE.TAR and
CONNECT.TAR. If you unziped them they are probably in
three similarly named directories (ESQLC, SE and ICONNECT
respectively).
- Create a group called informix
- Create a user called informix. This user should be a
member of the informix group and no other.
- If it hasn't already done, create the directory where you
want the Informix programs to be installed. Probably
something like /usr/local/informix or wherever it's
common to install local binaries and supporting files on
Linux.
- Set informix as owner and group on this directory and mode 755.
- Set the INFORMIXDIR environement variable to the full
path of this directory. For example, if the product will
be installed in the /usr/local/informix directory, you
would add:
export
INFORMIXDIR=/usr/local/informix (korn/bourne
shell)
setenv
INFORMIXDIR=/usr/local/informix (csh)
to your, and other user's environments.
- Change to this directory. Now you need to install each
product in a specific order: tools first (ESQL/C in this
case), then the engine (SE). Do this as follows:
A. Use tar to install the files for ESQL/C:
tar xvf
/your_path_to_this_file/ESQL.TAR
B. Type./installesql to
install and brand the ESQL/C product. You will be prompted
for a serial number and key. These are case sensitive and
should be entered as received.
C. Use tar again to install the SE engine:
tar xvf
/your_path_to_this_file/SE.TAR
D. Type: ./installse to
install and brand the engine. You will be prompted again for
a serial number and key.
E. Change to the etc subdirectory of the INFORMIXDIR
directory. Copy the sqlhosts file found there to another
name:
cp sqlhosts sqlhosts.org
F. Edit the sqlhosts file. Towards the end it contains the
following two lines:
demo_on onipcshm on_hostname
on_servername
demo_se seipcpip se_hostname sqlexec
Delete the first of these two lines, it's for the Informix
Dynamic Server engine which isn't ported yet. If you have one
on installed on another machine you can define it here for
remote access, but don't do that until the SE engine works
locally. For now, delete that line.
On the last remaining line, change the se_hostname entry to the real name of
your machine.
You may also want to change the seipcpip
entry for two reasons:
a. This entry means that the communication between
your programs and the database engine will be via unnamed
pipes. For some reason that may not work on your version
of Linux.
b. The alternative is to use sesoctcp
instead in this field. If so, it means TCP/IP will be
used for communication between your programs and the
database engine even when both run on the same machine.
Save this file with the same name and location:
$INFORMIXDIR/etc/sqlhosts.
If you used seipcpip in the
second field on the line in the sqlhosts file, you are now
finished with the basic installation of the programs from
Informix. You still have to set up users properly though.
If you used sesoctcp for
TCP/IP based connections to the engine you also have to
change the /etc/service file.
You then add the following line to that file:
sqlexec 1526/tcp # Informix SE
If this is the last line in that file you should make sure
there is at least one blank line after it. In some cases
there have been a bug where the communication didn't work
without that blank line.
If an entry with the name sqlexec
already exists in the /etc/services file, you may change sqlexec to anything you want, but must
then also change the entry in the last field of the sqlhosts
file.
If port number 1526 should allready be in use (it exists
on some other line in the /etc/services file) you can use any
other port number. Later if you want to communicate from
other machines you have to use the same port number there.
It's common to use port numbers from 1526 and up for Informix
engines.
Now you have finished installing the base product.
I-Connect
I-Connect is something you need only if you want to connect to
a database on a remote machine. You install that essentially like
the other products.
1. Remember you are supposed to be in the Informix main
install directory, the one defined by INFORMIXDIR above (but
on another machine now). Use tar to install the I-Connect
product:
tar xvf
/your_path_to_this_file/CONNECT.TAR
2. Type: ./installconn to
install and brand the products. You will be prompted for a
serial number and key.
There will be more info on how to use this product later.
Create a database
You should not ever create a database while you are logged in
as informix. For management of SQL databases you should create
one special user for the sole purpose of creating databases,
tables and do all other management tasks for all databases.
(Sometimes you may want more than one such user if you create
multiple databases. One database should however always be created
and managed by one and the same user.) The username you use for
this creation and management of databases should not be the same
you use for normal tasks like creating programs or otherwise
using the database. For pure testing purposes where you will be
the sole user of the database you may of course create databases
while logged in with your regular login name as well.
Create the user that is going to create and manage the
database. This user needs a special home directory where the
database or databases this user creates will later be stored.
Make sure there is enough space on the device for the databases
you intend to create. This user can not be a member of the
informix group. That would break all security built into the
database engine. Make this user a member of whatever other group
you find convenient.
In the login script of this user (or in some common login
script for all or many users) you have to set up some key
environement variables. You have to set up at least the
following:
INFORMIXDIR=/whatever_dir_you_installed_the_informix_products_in
In the above example you would set this to /usr/local/informix
INFORMIXSERVER=demo_se
Remember to make sure these are exported if you use a shell
where that is required.
Append $INFORMIXDIR/bin to the end of the PATH variable. The
following should work if you use sh, bash, ksh or a similar
shell:
PATH=$PATH$INFORMIXDIR
export PATH
Later it is highly likely that you will want to set the DBPATH
variable. This should be set to point to the directory where you
install your databases. Normaly the home directory of the
database administrator login you created above. You may however
leave it out initially. In that case all databases must be in the
current directory whenever you execute a command that needs
access to that database.
There are several other environement variables that you may
want to set. See the documentation available at
http://www-3.ibm.com/software/data/informix/pubs/library/
You should set up the same environement variables for the
informix user created earlier and for your own regular login.
If you want to create a database to start working on you can
now log in as this database administration user and use dbaccess to create the database and it's tables and other things you may want in it.
If you are not well versed in Informix products you may want
to install the dbaccess (sql) demonstration and/or the ESQL/C
demonstration. I would do that the first time while logged in
with my regular user name (not the database administration user
name from above). I would also create a separate subdirectory for
each of these demonstrations before I installed them.
To install these demonstrations go to the new empty directory
and type:
dbaccessdemo7
A database called stores7 is created. This consists of a
subdirectory called stores7.dbs where a set of .dat files
contains each table in the database and corresponding .idx files
contains the indexes for each table. A set of .sql files are also
copied to the current directory.
Start dbaccess by typing dbaccess
Select Query-language in the ring menu
Select the stores7 database (the only one that will be displayed now).
Use the Choose menu choice and select
one of the commands starting with "sel_
Use the Run menu to run it. You are
alive if all this worked.
To install the ESQL/C demo with it's C programs you should
create a special new subdirectory somewhere for that. Change to
this directory and type the command:
esqldemo7
The same stores7 database will be installed in this
subdirectory as well as several ESQL/C program files (those
ending in .ec) and some other files. Unfortunately Informix
forgot to include both a readme or howto file and a makefile. I
don't know how to proceed from here. I hope however that someone
who does will write about it and possibly add it to this HOWTO.
Hopefully they will also include a very simple and useful
makefile for the purpose. (There have been an unfortunate
tendency by many to create very complex makefiles that are hard
to understand. Some such are available at the
http://www.iiug.org site.)
Further information
For further information the following list of sites may be
useful:
http://www.iiug.org - particularly the software repository where many utilities and other things can be found.
Of course the http://www.informix.com/idn
site where more information will be posted by Informix.
The http://www-3.ibm.com/software/data/informix/pubs/library/ is good to know about to find all relevant manuals.
Now read all the relevant manuals and you will be able to
develop a lot of advanced and high performance database
applications.
If you are of the type that do not read manuals now is the
time to change that. It's not that Informix products requires
much more reading than any other product. It's just that reading
manuals will make everything so much easier and faster for you as
you work with these excellent products. At least read fast
through the manuals so you gain an understanding of what is
there. That makes it so easy later to just look up what you need.
Back to Top
Back to Technical Information:
Deploying Informix's Products on Linux