IBM®
Skip to main content
    Country/region [select]      Terms of use
 
 
    
     Home      Products      Services & industry solutions      Support & downloads      My IBM     
developerWorks  >  Blogs  >   developerWorks

author IDS Experts

Technical notes on Informix Dynamic Server by a worldwide team of Development and Technical Support engineers. The postings on this site do not represent the positions, strategies or opinions of IBM.



Tuesday May 13, 2008

Setting Up OpenAdmin Tool (OAT) on Mac OS

Introduction

Setting Up OpenAdmin Tool (OAT) on Mac OS

 

Introduction

 

The Open Admin Tool (OAT) is an open source web-based administration tool for Informix Dynamic Server (IDS). It is a web console where users can manage dbspaces, schedule tasks and monitor MACH 11 clusters etc. through their web browsers.

 

OAT is a web console that is hosted on a single web server. Other machines that have access to the web server’s network can simply open up a web browser, type in the web server machine’s URL, and they can use OAT to manage their database servers.

 

In order to host the Open Admin Tool website, the following prerequisites have to be setup:

 

  1. Informix Client SDK or Informix Connect
  2. A web server, such as Apache 2.0.
  3. PHP 5.2.4 dynamically loaded as an Apache 2.0 module. It also has to have the following extensions enabled
    • Pcre
    • Pdo
    • Pdo_sqlite
    • Pdo_informix
    • Soap
    • Gd   (requires libpng and libjpeg libraries)
    • Openssl  (requires libssl and libcrypto libraries)
    • Sockets
    • Libxml  (requires libxml2 libraries)
    • Session
    • Simplexml

 

The Open Admin Tool can be hosted on any platforms that have all of the above setup.

 

This article will provide the steps on how to setup OAT on a Mac OS X Platform.

 

Setting up Open Admin Tool (OAT) on Mac OS

 

First step is to install Informix Client SDK for Mac OS.

 

The Mac OS will already have an Apache web server installed. We can use the Apache web server that comes with Mac OS. We do not need to install other web servers.

 

The Mac OS will also have an installed PHP, however the PHP that comes with Mac OS does not have all the extensions that OAT requires. We cannot use the PHP that comes with Mac OS. We have to compile PHP binaries from source.

 

Our goal here is to build our own PHP binaries and dynamically load it to the Apache web server that comes with Mac OS.

 

Compiling PHP on Mac OS

 

Before starting to compile PHP, make sure that you have libpng, libjpeg, openssl and libxml2 installed into /usr/local/ or /usr/. Some PHP extensions require these libraries in order to compile.

 

Obtain the latest PHP source code from php.net (http://www.php.net/downloads.php). Decompress the source code package and issue the following commands.

 

cd /path/to/php/source/code

 

./configure --prefix=/path/to/where/you/want/to/install/php --with-apxs2=/usr/sbin/apxs --enable-soap --enable-pdo --with-pdo-sqlite --with-gd --with-pcre-regex --enable-session --with-openssl --enable-sockets --enable-libxml --enable-simplexml

 

make

 

 

The “configure” command will generate a makefile specific to your machine’s build environment. The “make” command will use the generated makefile to create PHP binaries.

 

The “configure” and “make” command will not always run smoothly. It is dependent on your machine’s setup. Please see the following section about debugging the “configure” command for more information.

 

If the “configure” and “make” command ran smoothly, you can run the “make install” command. This command will copy the php binaries to /path/to/where/you/want/to/install/php. It will also overwrite the PHP apache handler (the glue between Apache and PHP, called libphp5.so) at /usr/libexec/apache2/. You may want to backup the Mac OS’s default libphp5.so before running “make install”

 

##Be sure that you have backed up /usr/libexec/apache2/libphp5.so##

make install

 

After the “make install” command, the php binaries can be found under /path/to/where/you/want/to/install/php/.

 

Right now we have compiled the PHP binaries that have all the extension modules that OAT requires, EXCEPT the pdo_informix extension. This extension DOES NOT come with PHP source code from php.net. We have to compile it from source code separately from PHP, and enable it as a dynamic PHP extension module. We will go through the process of compiling pdo_informix in the later section “Compiling pdo_informix extension and enabling it in PHP”.

 

Right now we also have compiled the PHP apache handler (the glue between PHP and apache). This will appear as a file called “libphp5.so”, under /usr/libexec/apache2/. This file will be loaded as a dynamic Apache module. This will be described in the later section “Enabling PHP in Apache”

 

The next thing you have to do is to create a php configuration file. Copy the sample php.ini file from /path/to/php/source/code/php.ini-dist to /path/to/where/you/installed/php/lib

 

cd /path/to/php/source/code/

cp ./php.ini-dist /path/to/where/you/want/to/install/php/lib/php.ini

 

Then edit the php.ini file. Make the following changes to the php.ini file.

 

memory_limit = 128M Change this to à memory_limit = 300M

extension_dir = "./"     Change this to à extension_dir = “/path/to/where/you/installed/php/lib/extensions”

 

OAT requires a greater memory limit. Thus we increased the memory limit here.

 

The extension_dir is the directory where dynamic PHP extension modules will reside. Dynamic PHP extensions have to be placed under extension_dir, and enabled in the php.ini configuration file. The pdo_informix extension module will be handled in this fashion.

 

Debugging Information about the “configure” and “make” command

 

The --prefix tag lets you specify where you want to install the php binaries. You have to make sure that you have the write permissions to that directory before configuring PHP.

 

The --with-apxs2 tag lets you specify where to find your apache binaries, so that the apache handler (i.e. the glue between Apache and PHP) can be built. This apache handler will appear as a file called “libphp5.so” after the compilation. It will appear under /usr/libexec/apache2/. This document will talk about how to dynamically load this handler to the Apache web server in the later section “Enable PHP in Apache”. Here we are using the Mac OS default Apache web server, thus this flag should be set to point to /usr/sbin/apxs.

 

The --enable and --with flags specify what extensions you want to enable. Pdo_informix will be enabled separately after we compile the PHP binaries.

 

The “configure” and “make” command will not always run smoothly. One possible reason is that the prerequisite libraries are not present. For example, the php gd extension will not compile if libpng and libjpeg libraries are not found on your machine. The openssl extension will not compile if libssl and libcrypto libraries are not found. The libxml extension will not compile if libxml2 libraries are not found. Make sure that you have libpng, libjpeg, openssl and libxml2 installed into /usr/local/ or /usr/ before running the configure command.

 

Another possible reason is that the library architecture and the compilation flag do not match. If your libpng, libjpeg, libssl, libcrypto and libxml libraries are in 32bit mode, you have to set the compilation flag CFLAGS to –m32. If your libraries are in 64bit mode, you have to set CFLAGS to –m64. For example, if you want to see whether your libxml2 library is 32bit/64bit, run the following commands:

 

cd /usr/lib

 

file libxml2.2.dylib

 

##If your libraries are 64bit, set CFLAGS to be –m64##

setenv CFLAGS –m64

 

##If your libraries are 32bit, set CFLAGS to be –m32##

setenv CFLAGS –m32

 

If you encounter problems, you can look into the config.log file generated by the configure script. You can also open up the configure script (i.e. /path/to/php/source/code/configure) or the makefile (i.e. /path/to/php/source/code/Makefile) with a text editor, search for the error message and debug the problem. Sometimes the configure script cannot find libraries because they are not installed on /usr/ or /usr/local/. In that case, hardcoding your library paths to the configure script’s library search path will solve the problem.

 

You may also add the --disable-all tag to the configure command. This will disable all other extensions that we did not specify in the configure command. Compiling fewer extensions will give us fewer errors. Since OAT doesn’t require those extra extensions, it is okay to add the --disable-all flag.

 

Compiling PDO_INFORMIX extension and enabling it in PHP

 

Download the latest pdo_informix source code from http://pecl.php.net/package/PDO_INFORMIX

 

Before you compile pdo_informix. Make sure that CFLAGS are set accordingly. If your Client SDK/IConnect libraries are 32bit, then set CFLAGS to be –m32. If your Client SDK/IConnect libraries are 64bit, then set CFLAGS to be –m64

 

Decompress the pdo_informix source code and run the following commands

 

cd /path/to/pdo_informix/source/code/

 

/path/to/where/you/installed/php/bin/phpize

 

./configure --with-php-config=/path/to/where/you/installed/php/bin/php-config –with-pdo-informix=/path/to/where/you/installed/ClientSDK/or/IConnect/

 

make

 

This compiles the pdo_informix extension module. It will appear as a file “pdo_informix.so” under /path/to/pdo_informix/source/code/modules/

 

Copy pdo_informix.so to the PHP extension_dir ( We have set this to be /path/to/where/you/installed/php/lib/php/extensions/ in previous sections)

 

cd /path/to/pdo_informix/source/code/modules/

cp ./pdo_informix.so /path/to/where/you/installed/php/lib/php/extensions/

 

Add the following line to the php.ini configuration file (Under /path/to/where/you/installed/php/lib/php.ini)

 

extension=pdo_informix.so

 

This will enable the pdo_informix extension in PHP.

 

Enabling PHP in Apache

 

After PHP has been built successfully, the PHP apache handler (the glue between PHP and apache) will be created. This will appear as a file called “libphp5.so”, under /usr/libexec/apache2/

 

We have to edit the Apache configuration file (httpd.conf) to load the libphp5.so. This can be done by adding the following three lines in /etc/apache2/httpd.conf. These lines might already exist in the httpd.conf but are commented out. In that case you only have to uncomment them.

 

LoadModule php5_module libexec/apache2/libphp5.so

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

 

 

You also have to setup the Apache environment variables. You will have to edit the /usr/sbin/envvars file. Add the following lines in the envvars file.

 

INFORMIXDIR=”/path/to/IConnect/or/CSDK/installation/”

export INFORMIXDIR

 

PATH=”$INFORMIXDIR/bin:$PATH

export PATH

 

DYLD_LIBRARY_PATH=”$INFORMIXDIR/lib: $INFORMIXDIR/lib/cli: $INFORMIXDIR/lib/esql: $INFORMIXDIR/incl: $INFORMIXDIR/incl/cli: $INFORMIXDIR/incl/esql: /usr/lib: $DYLD_LIBRARY_PATH”

export DYLD_LIBRARY_PATH

 

You may now start the Apache web server. Issue the following command with root user access permissions.

 

/usr/sbin/apachectl –f /etc/apache2/httpd.conf –k start

 

 

Unpack OAT source code at /Library/WebServer/Documents/OpenAdminTool. The ownership of all files under this directory has to be changed too. Make sure these files are owned by the user and group that runs apache. (These should match the user and group settings in /etc/apache2/httpd.conf)

 

Visit http://<hostname>.<domainname>//OpenAdminTool/index.php and continue with the OAT web install. OAT should be operational after the OAT web install.

Leo Chan

 




May 13 2008, 12:00:00 AM EDT Permalink



Thursday March 06, 2008

Introduction to GLSLIB

The GLSLIB is a library that is used to internationalize IBM Informix products such as IBM Informix Dynamic Server and IBM Informix Client SDK. Each IBM Informix product is bundled with a specific version of GLSLIB. This GLS library supports English, Western European, Eastern European, Asian and African languages. Additional Locales that are not included in the GLS library can be installed from the International Language Supplement (ILS). ILS provides all available GLS locales and code-set conversion files. It also includes error messages to support several languages. The important point about ILS is that it is a platform independent product. The languages supported by ILS are Czech, German, French, Spanish, Russian, Polish, Slovak, Japanese, Simple Chinese, Traditional Chinese and Korean.

The following tables provide information about the version of GLSLIB - bundled with IBM Informix Dynamic Server and IBM Informix Client SDK. It also provides the information about the version of ILS that is compatible with the specific version of IBM Informix product.

The table can be used to
1) Find the version of GLS library bundled with the specific version of IBM Informix product.
2) Determine the compatible version of ILS that should be used with the specific version of IBM Informix product.

 

IDS Version
GLSLib Version
Compatible ILS Version
3.13
4.00
4.50
xC3
xC5
xC1
xC2
xC4
xC5
xC6
xC7
xC8
xC9
xC10
xC1
xC2
xC3
7.31.xD6
X
2.40.MCx
7.31.xD6W2
X
7.31.xD7
X
7.31.xD8
X
7.31.xD9
X
7.31.xD10
X
9.40.xC1
X
3.40.MCx
9.40.xC5
X
9.40.xC6
X
9.40.xC7
X
9.40.xC7W1
X
9.40.xC7W2
X
9.40.xC7W3
X
9.40.xC7W4
X
9.40.xC7W5
X
9.40.xC7W6
X
9.40.xC7W7
X
9.40.xC9
X
10.00.xC1
X
3.40.MCx
10.00.xC3W2
X
10.00.xC3W3
X
10.00.xC3W4
X
10.00.xC3W5
X
10.00.xC4
X
10.00.xC4W1
X
10.00.xC4W2
X
10.00.xC4W3
X
10.00.xC5W1
X
10.00.xC5W2
X
10.00.xC5W3
X
10.00.xC5W4
X
10.00.xC5W5
X
10.00.xC6
X
10.00.xC6W1
X
10.00.xC6W2
X
10.00.xC6W3
X
10.00.xC6W4
X
10.00.xC6W5
X
10.00.xC7
X
10.00.xC7W1
X
10.00.xC7W2
X
10.00.xC8
X
11.10.xC1
X
3.50.MC1
11.10.xC2
X
11.10.FC2W1
X


CSDK Version
GLSLib Version
Compatible ILS Version
3.13
4.00
4.50
xC3
xC5
xC1
xC2
xC4
xC5
xC6
xC7
xC8
xC9
xC10
xC1
xC2
xC3
2.90.xC1
X
3.40.MCx
2.90.xC3
X
2.90.xC4
X
3.00.xC2
X
3.50.MC1
3.00.xC3
X
3.50.xC1
X


Parag A Sheth

Categories : [   gls  ]

Mar 06 2008, 06:11:15 PM EST Permalink



Friday January 18, 2008

Report from MacWorld

MacWorld was an amazing event this past week in San Francisco at the Moscone Center. Although this is generally a consumer oriented event there were many companies with an enterprise focus showing their solutions. IBM was in the smallest size pedestal in the Enterprise Solutions Area -- People would constantly walk by and say - "IBM ---- the biggest company with the smallest pedestal" - We smiled and told them we make the biggest impact!!!!

As you know we just announced our beta for the Mac OS X this week and were at the show to start to get the word out and meet customers and business partners who are interested in an "Industrial Strength" data base for their application. There was a ton of traffic in the ped - -People were at first surprised and then pleased to see us there as they have been looking for a dependable data base that is secure and scalable to build their applications on. Many developers who have a long history using Informix were thrilled to see the announcement and anxious to try the beta.

  • MAC users are very happy to see an enterprise class database on the LATEST MAC OS.
  • Looking for something better than what is currently available on MAC which just hasn't been reliable and has not scaled to meet their needs.
  • Some really like the idea of OAT that is open source and allow users to customize, especially the free part.
  • One mid sized system integrator commented " We are glad to see IBM supporting the MAC platform as we are building applications to take into Government and Financial Markets - We need a data base that our customers can depend on. IDS is exactly what we are looking for."


Terri Gerber

Categories : [   MacOS  ]

Jan 18 2008, 02:08:16 PM EST Permalink



Wednesday January 16, 2008

IDS "Cheetah 2" Beta on Mac OS X (Leopard)

Very aptly termed as... "The Big Cats Unite!".

This was officially announced today at MacWorld'08 - IDS "Cheetah 2" first beta version on MacOS 10.5 (Leopard) is now available for download here.

Here's the press announcement.

Mirav Kapadia

Categories : [   MAC  ]

Jan 16 2008, 04:37:57 PM EST Permalink



Tuesday December 18, 2007

Enhanced variable length row compression

In IDS, when a new row containing a column that can vary in length is to be inserted on a page, the row will be inserted only if the page contains sufficient space to allow the new row to grow to its maximum length. This can result in low disk space usage. In IDS 11, you can change this default behavior by setting the configuration parameter MAX_FILL_DATA_PAGES to 1. When MAX_FILL_DATA_PAGES is enabled, the server will add a new row to a page if after adding the row, at least 10 percent of the page is free for the future expansion of the rows. The database server needs to be restarted after changing this configuration parameter.

To take advantage of this setting:
  • Existing tables with variable-length rows must be reloaded
    OR
  • Existing pages must be modified, followed by further inserts

Advantages of enabling MAX_FILL_DATA_PAGES are:
  • More data can be stored in less disk space
  • Enables the server to use the buffer pool more efficiently
  • Reduces fetch times as more rows can be accessed by reading less number of pages

The possible disadvantages of enabling MAX_FILL_DATA_PAGES are:
  • Allowing more variable-length rows per page might store rows in a different physical order
  • As the page fills, updates made to the variable-length columns in a row could cause the row to expand so it no longer completely fits on the page. This causes the server to split the row onto two pages, increasing the access time for the row

Example: Suppose you have a table with a column of type lvarchar(6000). If the dbspace in which the table resides is of 4K or 8k pagesize, you might see a lot of unused space in the pages. If you do not have to make updates which would cause most of the rows to expand to their full length, you might want to enable MAX_FILL_DATA_PAGES to better use the space in each page.

Suma Vinod

Categories : [   MAX_FILL_DATA_PAGES  |  varchar  ]

Dec 18 2007, 07:46:52 PM EST Permalink



Thursday November 08, 2007

XML support in IDS 11 - Part 2

Here we will look at each of the XML functions given in Part 1 with examples.

genxml()/genxmlclob()
You can use these functions to create an XML row element for each row of a SQL query result. Each column in the row is an attribute of the row element. genxml() is used for returned row values that are LVARCHAR(32739) or less. For larger values, you should use genxmlclob(), which returns a CLOB.
These functions process the rows without any specific order. If the order of the rows is important, you can use the derived table queries to get the result set in the correct order, and then apply the functions on the result set.

Example:
    
    select 
     genxml(row (customer_num, fname), "row") from customer;
    
    Output from the above sql:
    
    <row customer_num="101" fname="Ludwig    "/>
    <row customer_num="102" fname="Carole    "/>
    <row customer_num="103" fname="Philip    "/>
    <row customer_num="104" fname="Anthony   "/>
    
    To order the results on fname, use the following sql:
    
    select 
     genxml(row(num,name),"row")
     from (select customer_num, fname from customer order by fname) as vt(num, name);
    
    To select all columns in the table, use the following sql:
    
    select genxml(customer, "row") from  customer;
    
genxmlelem()/genxmlelemclob()
These functions return each column value as separate elements, in contrast to genxml(), which returns column values as attributes of the row element.

Example:
    
    select genxmlelem(row(customer_num,fname), "cust") from customer;
    
    Output from the above sql:
    
    <cust>
    <row>
    <customer_num>101</customer_num>
    <fname>Ludwig        </fname>
    </row>
    <row>
    <customer_num>102</customer_num>
    <fname>Carole        </fname>
    </row>
    <row>
    <customer_num>103</customer_num>
    <fname>Philip        </fname>
    </row>
    <row>
    <customer_num>104</customer_num>
    <fname>Anthony       </fname>
    </row>
    </cust>
    
    You can select all columns in a table by passing the table name as the first argument as shown below:
    
    
    select genxmlelemclob(customer, "cust") from customer;
    
genxmlschema() & genxmlschemaclob()
They are like genxml() but generate full XML schema including XML header and data. An XML header specifies document properties such as the document encoding, the document type definition(DTD), and XML stylesheet(XSL). The following example shows a select using genxmlschema and its output:

Example:
    
    select genxmlschema(customer, "cust") from customer;
    
    Output from the above sql:
    
    <?xml version="1.0" encoding="en_US.819" ?>
     xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
     targetNamespace="http://www.ibm.com"
     xmlns="http://www.ibm.com"
     ElementFormDefault="qualified">
     <xs:element name="cust">
       <xs:complexType>
         <xs:sequence>
           <xs:element name="customer_num"  type="xs:serial"/>
           <xs:element name="fname"  type="xs:char(15)"/>
           <xs:element name="lname"  type="xs:char(15)"/>
           <xs:element name="company"  type="xs:char(20)"/>
           ...
    
genxmlquery() & genxmlqueryclob()
They are versatile functions that take a SQL query as argument and return the result set in XML.

Example:
    
    execute function genxmlquery('cust','SELECT customer_num FROM customer');
    
    Output from the above sql:
    
    <cust>
    <row>
    <customer_num>101</customer_num>
    </row>
    <row>
    <customer_num>102</customer_num>
    </row>
    <row>
    <customer_num>103</customer_num>
    </row>
    <row>
    <customer_num>104</customer_num>
    </row>
    </cust>
    
genxmlqueryhdr() & genxmlqueryhdrclob()
These functions return the same data as genxmlquery() but with an XML header.

Example:
    
    execute function genxmlqueryhdr('cust','SELECT customer_num FROM customer');
    
    Output from the above sql:
    
    <?xml version="1.0" encoding="en_US.819" ?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <cust>
    <row>
    <customer_num>101</customer_num>
    </row>
    <row>
    <customer_num>102</customer_num>
    </row>
    <row>
    <customer_num>103</customer_num>
    </row>
    <row>
    <customer_num>104</customer_num>
    </row>
    
extract() and extractxmlclob()
These functions evaluate an XPATH expression on a XML column, document, or string. These functions are identical except that extractxmlclob() returns a CLOB instead of LVARCHAR. They are used to return an XML fragment of the evaluated XML column, document, or string. They are compatible with the Oracle extract()function.

Example:
    
    execute function extract('<name><first>fred</first></name>','/name/first');
    
    Output from the above sql:
    
    (expression)  <first>fred</first>