Sunday, March 3, 2013

Deploying IBM Informix over Microsoft Windows

Currently we are working on adding IBM Informix support for WSO2 Carbon. One challenge was to get Informix up and running on Linux or on MAC. Either case had its own issues, so ended up deploying Informix on Microsoft Windows. Tried out with a Windows 7 VM, but hopefully the steps will be the same for other windows versions as well with minor changes.

1. Download IBM Informix Developer version from here. Select "Ultimate Edition or Developer Edition AIX, HP-UX, Linux, Mac OS, Solaris, Windows" and then pick Informix Developer Edition for Windows 64 Version 11.70FC7DE.

2. Install it following the default/typical configuration options.

3. While installing it will create a user called "informix" and a group called "Informix-Admin". For the user you need to give a password.

4. After completing the installation you will see following in the Windows Start Menu.





















5. Login to system as "informix" user. 

6. You can create any number of Server Instances using the 'Server Instance Manager" tool from the Start Menu. By default it creates an instance called ol_informix1170.

7. To start the ol_informix1170 instance, right click on "ol_informix1170" from Start Menu and select "Run as Administrator".

8. Now in the command prompt type the following to start the server.

:\> oninit -ivy

9. To see the status of the server, type the following.

:\> onstat -g dis

There are 1 servers found
Server: ol_informix1170
Server Number: 0
Server Type: IDS
Server Status: Up
Server Version: IBM Informix Dynamic Server Version 11.70.FC7DE
Shared Memory: 0x80000000
INFORMIXDIR: C:\PROGRA~1\IBM\Informix\11.70
ONCONFIG : C:\PROGRA~1\IBM\Informix\11.70/etc/onconfig.ol_informix1170
SQLHOSTS : C:\PROGRA~1\IBM\Informix\11.70/etc/sqlhosts
Host: prabath-PC

10. To create a database, right click on "ol_informix1170" from Start Menu and select "Run as Administrator" and type.

:\> dbaccess

You can navigate through the top menu to create a Database. Select "Database" and press enter and then select "Create







Provide a name for the database and press enter.







Select "Log" to enable transactions.







Select "Buffered Log" and press Enter and then Exit.













Select "Create-new-database" and press Enter to complete the database creation.

12.  To run a SQL script against Informix use the following command.

:\> dbaccess DATABASE_NAME  SQL_SCRIPT

e.g. :

:\> dbaccess WSO2CARBON_DB c:\informix.sql

13. To shutdown the Informix Server right click on "ol_informix1170" from Start Menu and select "Run as Administrator" and type.

:\> onmode -ky

14. To run a java client against the Informix database,  you can find the drivers from here. Also as the JDBC connection url, you may use the following.

jdbc:informix-sqli://192.168.1.4:9088/WSO2CARBON_DB:INFORMIXSERVER=ol_informix1170

ol_informix1170 is the Informix instance name. 

Following is the corresponding Driver class.

com.informix.jdbc.IfxDriver  

Notes :

1. In case if you face the following error - this link will be helpful.

Error Only member of IXDBSA group (Informix-Admin, by default) can start IBM Informix Dynamic Server. on Windows.

2. Error : "oninit: Fatal error in shared memory initialization"

You may get this error, when you try to start the Informix server after shutting it down with.

  :\> oninit -ivy

To get rid of this error, avoid using "i" there when start the Informix server after a shutdown.  "i" should only be used when you start for the first time after a machine restart.

3. Error : Invalid default sbspace name (sbspace)

This could happen when you try to insert CLOB/BLOB data types to Informix server. To over come this you need to create an sbspace.

:\> onspaces -c -S sbspace2 -p c:\informix_data\data.dbs -o 100 -s 20000 -Df "LOGGING=ON"

Make sure an empty c:\informix_data\data.dbs file exists before the above command.

Now you need to update the onconfig.ol_informix1170 file which is inside INFORMIX_HOME/etc.

Look for;

SBSPACENAME sbspace

and rename it to,

SBSPACENAME sbspace2

with the name of the sbspace you created.

1 comments:

alfanso thomas said...

Hey thanks for sharing the information with us...really very useful stuff to know...keep writing more!!!

Click on the link to get the Windows Live Mail Technical Support

Thanks