Configuring Informix and creating a database
Having installed Informix (see
InstallingInformixSpatial), we need to configure it. These notes are taken from a visit of John Pickford of IBM, 16th June 2004.
Throughout this, assume that you must be logged in as the
informix user unless otherwise stated (for most steps, you could be logged on as any user that is a member of the
informix group).
Setting up the environment
The following environment variables need to be set (this is probably best done in the logon script for the
informix user):
setenv INFORMIXDIR /opt/informix # root of the Informix installation
setenv INFORMIXSERVER reading # name of the online system
setenv ONCONFIG onconfig.reading # name of the configuration file (located in $INFORMIXDIR/etc)
Note that we haven't set up the online system or the config file yet - we'll do that now.
Edit sqlhosts file
We need to add a new online system to the sqlhosts file, corresponding to the
$INFORMIXSERVER environment variable. To do this add a line similar to:
reading onsoctcp 192.171.166.118 reading_tcp
This means "set up an online instance called
reading, on the machine with IP
192.171.166.118, which we shall connect to using TCP sockets. The port number is set up in /etc/services under the entry =reading_tcp=". (note that you could use the name of the machine instead of its IP address.
Add an entry to /etc/services (you'll probably need to log on as root to do this) like this:
reading_tcp 1527/tcp # IBM Informix reading server
This specifies that the instance will listen on port 1527 (could use any port).
Edit onconfig.reading file
You will probably need to create this file, which should reside in
$INFORMIXDIR/etc. There are a large number of options here, so the easiest way to begin is by copying the
onconfig.std file. The copy currently in use here is linked
here. Key parts of this file include:
- The
ROOTNAME and ROOTPATH values give the name and location of the root dbspace. For this application, we were happy for this to be simply a file in the filesystem (it could be a raw device). You will need to create this file (call it rootdbs) as an empty file in $INFORMIXDIR/dbspaces (perhaps using touch), chown-ing it to informix/informix, chmod-ing the directory $INFORMIXDIR/dbspaces to 755 and chmod-ing the rootdbs file to 660.
- Similarly, you will have to create the
SBSPACENAME file (called sbspace in this example) to hold the dbspace for SmartBlobs . You'll then have to run onspaces -c -S sbspace -p /opt/informix/dbspaces/sbspace -o 0 -s 100000 to prepare the space, then ontape -s -L 0 to pretend to back the system up (in reality the tape device is /dev/null in this system, as specified in onconfig.reading, so nothing will happen but it keeps the system happy).
Initialise the database
We should now be ready to initialise the database. Do this by running:
oninit -iy
WARNING: running this completely wipes all databases and tables. Use the
finderr command to identify any error messages that might come up.
Related Manuals
For more information on how to install the database server, set environment variables, and put the database server online, see the manuals for your database server listed below:
| Task or Feature |
Topic |
Manual |
| Installing the database server |
|
Installation Guide |
| Setting environment variables |
.cshrc or .login |
Installation Guide, IBM Informix Guide to SQL:Reference |
| Setting UNIX permissions |
chmod |
UNIX Documentation |
| Putting database server online |
oninit |
Administrator's Guide |
| Creating database spaces |
onspaces |
IBM Informix Guide to SQL:Reference |
These manuals are available online at
http://www-306.ibm.com/software/data/informix/pubs/library/ids_94.html
--
JonBlower - 16 Jun 2004