Thursday, September 27, 2007

Onmonitor

I used 'onmode -kuy' to bring down the engine after adding the chunks. For no good reason at all I'm going to run 'oninit -i' once again. Well, the double plus ungood reason is that I want to verify once again that I don't get any errors bringing up the engine.

OK... I'm up and error free.

I have gone into onmonitor and set up my chunks again.

/data/informix/chunk1 size was set by onconfig.std (I think)
/data/informix/chunk2 10GB
/data/informix/chunk3 10GB
/data/informix/chunk4 10GB

Chunks and Onmonitor

A little summary before I go on. Yesterday I added all my data chunks, but filled my hard disk space in the process. So I have removed all my chunks. Since this blog is really a letter to my future self, I'm going to review what I've done with chunks and 'onmonitor'.

cd to /data/informix/ to create the chunk files. I figured out that it is quicker to 'su' to 'informix' before I 'touch chunkx' so that I don't have to add the step changing the user and group. So I
# touch chunk1
and repeat on through chunk4, since that's all I have room for.

Once the chunks have been created, I 'chmod 660 chunk*' so I have the right permissions.

Once again I oninit -i so that I can get the engine up. Once I finish this blunder-through process finished, I'm going to create a walkthrough so that you only have to oninit -i once.

Assuming that the db engine started correctly, I then proceed to run 'onmonitor'. BTW, Colin told me that 'scoansi' works well for the TERM in onmonitor. And he's right!

So start 'onmonitor' Go to 'Info' and display the information for 'rootdbs'. Most likely chunk1 is already there. The size for chunk is set in the 'onconfig.std' so I need to set up chunks2-4. Exit 'Info' and enter 'Add_chunk'. Set the pathname to '/data/informix/chunk2' and make the size 10GB. Press Esc and it will verify the size on the disk and add the chunk to dbspace. Repeat as many times as necessary. Go to 'Info' to verify the existence of the chunks.

Exit 'onmonitor'.

Wednesday, September 26, 2007

Setting up the Chunks

In the last post, I set up /data/informix/chunk1/ through chunk7/ as directories. They are not directories, they are files. Deleting all those chunk directories and touching them as files.

# touch chunk1


Doing an 'onmonitor' to set up the chunks. However, onmonitor doesn't like my termtype.

I'll try this one first

# TERM=vt100
# export TERM
# echo $TERM
vt100

OK it doesn't like vt100.

Found a reference to altos2 on this page.

Exported TERM=altos2.

This at least brought up a menu when I run 'onmonitor'. Apparently vt100 is a good termtype to use, but I seem to have something set wrong in my PuTTY.

I'll have to get my TERM isues fixed before I can use 'onmonitor'.

Onconfid.std Changes

Here are the changes I made to onconfig.std so that it matches our production server.

ROOTPATH /data/informix/chunk1 # Path for device containing root dbspace

*** I'll need to go create that directory structure next.

PHYSDBS physdbs # Location (dbspace) of physical log

*** Not sure if I need to do something else.


LOGFILES 10 # Number of logical log files
LOGSIZE 3000 # Logical log size (Kbytes)

DBCREATE_PERMISSION informix

DBSERVERNAME rhinformixrd1 # Name of default database server
DBSERVERALIASES rhinformixrd1tcp # List of alternate dbservernames

Created the following directories:
/data/informix/chunk1/
/data/informix/chunk2/
/data/informix/chunk3/
/data/informix/chunk4/
/data/informix/chunk5/
/data/informix/chunk6/
/data/informix/chunk7/

After committing these changes, I'm running 'onconfig -i' again to see what else erors.

And here it is! INFORMIXSERVER does not match DBSERVERNAME or any of the DBSERVERALIASES.
FAILED

# INFORMIXSERVER=rhinformixrd1
# export INFORMIXSERVER
# echo $INFORMIXSERVER
rhinformixrd1

One more try at oninit -i

oninit: DBSERVERNAME 'rhinformixrd1tcp' not in sqlhosts file or sqlhosts file contents
are damaged.

Added this to sqlhosts. What I did earlier was crap. This probably is too.
rhinformixrd1 onsoctcp 10.0.0.162 online
rhinformixrd1 onsoctcp 10.0.0.162 online

09:20:49 listener-thread: err = -931: oserr = 0: errstr = online: Cannot locate online service/tcp service in /etc/services.

Added this to /etc/services:
online 1536/tcp # Informix

Running oninit -i again.

Crap! This one looks serious.

09:27:40 listener-thread: err = -25572: oserr = 98: errstr = : Network driver cannot bind a name to the port.
System error = 98.

Ran 'finderr 25572'. Got this:

A system call has failed. The sqlexecd daemon or database server cannot
access the network port that is specified by the servicename in the
sqlhosts file. This situation might occur because the network port is
already in use by another sqlexecd, database server, or other
application. Use a different servicename on the command line (prior to
Version 6.0) or in the sqlhosts file (beginning with Version 6.0).
Contact your system administrator for assistance.


Ahh... I think this was caused by putting the same thing in sqlhosts twice.

Figured it out. This is what should be in /etc/profile:

INFORMIXSERVER=rhinformixrd1tcp
export INFORMIXSERVER


Somehow when I printed the production sqlhosts the first line was cut off. So I added this to sqlhosts:
rhinformixrd1 onipcshm 10.0.0.162 rhinformixrd1

Now when I run oninit -i, I crash on the chunks. I'll write about that in the next post.

Tuesday, September 25, 2007

Sqlhosts File

Invalid value of DUMPDIR '/usr/informix/tmp' in onconfig file. Setting it to default value '/opt/IBM/informix/tmp'...08:48:24


I changed DUMPDIR in onconfig.std to '/opt/IBM/informix/tmp'.

IBM Informix Dynamic Server Started.
oninit: DBSERVERNAME 'rootdb' not in sqlhosts file or sqlhosts file contents
are damaged.


Sqlhosts file is located at '$INFORMIXDIR/etc/sqlhosts'.

I added this, but I'm 99% sure it is wrong:
rootdb onipshm on_hostname on_servername

Initializing the DB and Editing 'onconfig.std'

This morning I'm going to get the database engine initialized, and make the necessary changes to onconfig.std. My goal is to document all these changes so that in the future I don't have to do it onesy-twosy.

To initialize the engine:
# oninit -i

The first error message is: INFORMIXSERVER does not match DBSERVERNAME or any of the DBSERVERALIASES. Apparently, I have neither a $INFORMIXSERVER set as a global variable nor a DBSERVERNAME set in the onconfig.std.

Set the environment variable
# INFORMIXSERVER=rootdb
# export INFORMIXSERVER
# echo $INFORMIXSERVER
rootdb

Edit the onconfig.std
DBSERVERNAME rootdb # Name of default database server

Monday, September 24, 2007

Holy Crap Batman!

After a couple of hours trying to get the IDS (Informix Dynamic Server) initialized, reinstalling because I was SURE I'd missed something when the 'Custom Install' option never appeared, I finally realized that the installation wizard was not liking it that I was installing from a network share. I copied the install tarball to my home directory, then ran it again. The 'Custom' option was there for the IDS 11.1 this time! I went ahead and installed the Demo database. I figure that I can edit the onconfig.std file from it rather than creating a new one from scratch. Long story slightly less long: the Informix engine is up and running.

I'll do some testing and whatnot before I go edit the onconfig.std.

$PATH

# PATH=$PATH:/opt/IBM/informix
# export PATH
# echo $PATH

Installing Dynamic Server with Selected Features

No sense delaying it any longer. It's time to run the setup.

# ids_install

Do you want to run installer in GUI mode [y/n] : n

Apparently you have to have a DISPLAY environment variable set to use GUI mode.

*Choose (4) Begin Installation

Welcome to the InstallShield Wizard for IBM Informix Dynamic Server Version 11.10 Bundle

Accept the license agreement without reading it. You may have just contractually obligated your soul to IBM, but you'll never know, because you don't ever read license agreements.

Select the products you would like to install:

To select/deselect a product or to change its setup type, type its number:

Product Setup Type
------------------------------------------------ ------------------------
1. [ ] IBM Informix IConnect Version 3.00
2. [x] IBM Informix Client-SDK Version 3.00 Typical
3. [x] IBM Informix JDBC Driver Version 3.10

Other options:

0. Continue installing


BLAH BLAH BLAH. I accepted all the default suggestions. It installed successfully, but when I tried to run dbaccessdemo, I realized that I never put /opt/IBM/informix in my PATH environmental variable.

Informix User and Group

Need to add the informix group and username.

# groupadd informix
# useradd -g informix informix

Back to the Install

After a diversion to take care of the Samba mount, I installed the JRE to /usr/java.

The documentation says I'm ready load the product files now. Uncompressing the install file.

# tar xvf C1228NA.tar

It takes quite a while to un-tar everything. While that is running, The onstat Quick Reference looks like it will be very useful in the future.

Mounting the Samba Share

For me, these installs are rarely a linear event moving from point A to B on through to the finish. I have hit my first digression. I downloaded the installation media at my desktop machine, which is Windows based. The files are saved on a network share which is accessible to Linux as a samba share. However, I never mounted that directory, so I need to go back and fix that.

# vi /etc/fstab
Because I'm connecting to a CIFS share, I add this line:

//server/files_directory$ /mnt/files_directory cifs user=administrator,pass=xxxxxxxx,domain=domain.com

# cd /mnt/
# mkdir files_directory
# mount /mnt/files_directory

Now that I've mounted the fileshare, I can go back to what I was doing.

Java Runtime Environment

In earlier attempts to install Informix, I've run into headaches and frustrations with the JRE. The installation instructions are not very clear on the JRE. It says you need the JRE that came bundled with the software to uninstall. The installation process will search to see if JRE ver. 1.4.2 or later is on the system. If it is not, it automatically extracts the correct JRE from the .jvm.bin file included with the installation media.

After a couple of close readings of the instructions, I've decided to manually install the copy of the JRE that came with the software.

Setting the Environment Variables

IBM Informix refers to the installation directory as $INFORMIXDIR. I'm installing it into /opt/IBM/informix, so I cd /opt then mkdir IBM and cd IBM and mkdir informix. I'm sure there's an easier way to do it, but I don't want to get bogged down this early in the install. Now, I have /opt/IBM/informix created.

I'm using this Tips for Linux page as a reference for creating my environment variables. I need to set $INFORMIXDIR to be /opt/IBM/informix.


# INFORMIXDIR=/opt/IBM/informix
# export $INFORMIXDIR
-bash: export: `/opt/IBM/informix': not a valid identifier
# echo $INFORMIXDIR
/opt/IBM/informix

Not entirely sure why I get that "not a valid identifier" error, because when I display $INFORMIXDIR, it is correct.

Getting Started

I'm using the "IBM Informix Dynamic Server Installation Guide for UNIX and Linux" that is provided with the Informix 11.1 download from IBM's Passport Advantage. There are a couple of Informix gurus in the office that I may refer to, but my goal is to be able to install and configure an Informix server on my own. I'm sharing my installation notes via this blog so that someone else travelling the same path in the future might find the breadcrumbs I've dropped.