Automate small footprint, embedded Informix Dynamic Server deployments

End-to-end embeddability for IDS deployments on Linux, UNIX, and Windows using the IDS deployment utility and embeddability toolkit

This tutorial shows you how to automate IBM® Informix® Dynamic Server (IDS) small footprint deployments by using the IDS deployment utility and the IDS embeddability toolkit. An important requirement of an embedded database system is that it be invisible to end users and administrators. IDS is a perfect database system for application environments that require an embedded database because you can install, deploy, and administer the database silently. It is transparent to users that there is a robust and reliable database system catering to the database requirements of the application.

Share:

Sreeni Paidi, Advisory Software Engineer, IBM

Sreeni Paidi photoSreeni Paidi is an Advisory Software Engineer and Enablement Consultant with IBM's Information Management Technology Enablement organization. Sreeni has over 13 years of experience working with DB2, Informix, Oracle, and PostgreSQL database servers as a Database Programmer, DBA, and an Integration Architect. He joined IBM as part of Trigo Technologies acquisition in 2004. Sreeni is part of a worldwide team that provides technical skills and consulting services to help business partners and customers accelerate the integration of IBM database software with their applications.



11 March 2010

Also available in Portuguese

Before you start

Before you start, read about what is covered in this tutorial, prerequisites, and system requirements.

About this tutorial

The purpose of this tutorial is to provide steps, scripts, and utilities you can use to install and silently deploy IDS on Linux®, UNIX®, and Windows®. The tutorial also includes scripts you can use to reduce the size of the IDS install footprint. The tutorial is based on an IBM Redbooks® publication "Embedding Informix Dynamic Server: An Introduction." Refer to the Resources section of the tutorial for a link to this Redbooks publication. The tutorial shows you how to use the IDS deployment utility that comes with IDS 11.50.xC6 to deploy a pre-configured IDS server on multiple target computers.

Following is an overview of the steps you follow to silently deploy IDS:

  • Install IDS — Install IDS on a template computer to prepare a master copy.
  • Strip — Remove unwanted files after installation to achieve the smallest possible footprint.
  • Create a snapshot for deployment — Archive your installed IDS image for future deployments.
  • Silently deploy — Use the IDS deployment utility to deploy a copy of the archived IDS installation image on a target computer.

Prerequisites

This tutorial is written for IBM Informix Dynamic Server (IDS) database administrators, application architects, and developers. To get the most out of the tutorial, you should have a general familiarity with installing IDS and using either a Linux or UNIX command-line shell or a Windows command prompt.

System requirements

To run the examples in this tutorial, you need the following:

  • A computer with one of the following operating systems and access level:
    • Windows with administrator access
    • Linux with root access
    • UNIX with root access
  • IBM Informix Dynamic Server version 11.50.xC6 install image

IDS deployment utility

Introduction

You can use the IDS deployment utility to deploy snapshots of pre-configured IDS instances and the related dbspaces onto target computers. The deployment utility is included with IDS 11.50.xC6 on Linux, UNIX, and Windows platforms.

You must install IDS before creating a snapshot. You can choose to include a fully configured IDS instance in the snapshot or create the instance at the time of deployment.

The advantage of using the deployment utility is that you do not have to install and configure IDS on each target computer. You simply deploy a previously installed and fully configured IDS instance. This gives you the ability to quickly re-create a fully configured IDS instance on one or more target computers.

See the Resources section for a link to the IDS deployment utility topic in the IDS Information Center.

Using the deployment utility

To use the deployment utility, you run the ifxdeploy command either from a command line or as part of an application integration script. When you run the command in silent mode it does not require any user interaction.

Listing 1 shows you the syntax for using ifxdeploy on Linux and UNIX. Listing 2 shows the syntax for using ifxdeploy on Windows.

Listing 1. Using ifxdeploy on Linux and UNIX
Usage:
./ifxdeploy [-config <configfile>] [-extractcmd <command>] [-verbose]  
            [-l <logfile>] [-p <password>] [-silent] [-sqliport port]
            [-drdaport <port>] [-servernum <num>] [-rootpath <rootdbs>]
            [-file <tgz_file>] [-relocate <path>] [-force] [-keepdis] [-y]

        -config       : Specify a deployment utility config file.
        -extractcmd   : Command to extract archive
        -verbose      : Verbose mode.
        -l            : Log file name to write progress messages
        -p            : Informix user password to create user.
        -silent       : Silent mode (writes to log only).
        -sqliport     : Specify SQLI port number (default is 9088).
        -drdaport     : Specify DRDA port number (default is 9089).
        -servernum    : Specify onconfig SERVERNUM (default is 0).
        -rootpath     : Root dbspace location (default is $INFORMIXDIR/rootdbs).
        -relocate     : Chunk path relocation specification.
        -file         : Specify gzipped tar file of an IDS instance.
        -force        : Overwrite existing settings.
        -keepdis      : Keep discovery files in $INFORMIXDIR/etc.
        -y            : Do not prompt for confirmation.

Uninstall:
./ifxdeploy [-u <path> | -uninstall <path>] [-delifx]
            [-verbose ] [-silent] [-y] [-l]

        -uninstall      : Uninstall IDS from the specified path.
        -delifx         : Remove informix user and group.
        -l              : Log file name to write progress messages
        -silent         : Silent mode (writes to log only).
        -verbose        : Verbose mode.
        -y              : Do not prompt for confirmation.

        Version 2.1.0
Listing 2. Using ifxdeploy on Windows
Usage:
ifxdeploy.exe [-file <zip_file>] [-p <password> | -system] [-l <logfile>]
              [-config <configfile>] | [-silent] [-6432] [-sqliport <port> | namedpipe]
              [-drdaport <port>] [-servernum <num>] [-rootpath <rootdbs_file>]
              [-extractcmd <command>] [-installdrive <DRIVE>] [-verbose]
              [-relocate <path> ] [-force] [-y]

        -config         : Specify a deployment utility config file.
        -force          : Overwrite existing settings.
        -installdrive   : Drive where the IFMXDATA directory will be created.
        -namedpipe      : Set the primary SQLI protocol to use named pipes.
        -rootpath       : Root dbspace location 
                          (default is C:\ifmxdata\svr_name\rootdbs_dat.000)
        -relocate       : Relocate chunk specification
        -silent         : Silent mode (writes to log only).
        -system         : IDS service will logon as SYSTEM user.
        -verbose        : Verbose mode.
        -6432           : Required to Install/Uninstall 32-bit IDS on 64-bitWindows.
        -extractcmd     : Command to extract archive
        -l              : Log file name to write progress messages
        -y              : Do not prompt for confirmation.

         drdaport     : Specify DRDA port number (default is 9089).
         password     : Informix user password for creating IDS service.
         servernum    : Specify onconfig SERVERNUM (default is 0).
         sqliport     : Specify SQLI port number for the IDS instance (default is 9088).
         extractcmd   : Use provided command to extract archive instead of '7z'.
         zip file     : Specify zipped snapshot file.

Uninstall:
ifxdeploy.exe [-u <path> | -uninstall <path>] [-delifx]
              [-verbose ] [-silent] [-y] [-l]

        -uninstall      : Uninstall IDS from the specified path.
        -delifx         : Remove informix user and Informix-Admin group.
        -l              : Log file name to write progress messages
        -silent         : Silent mode (writes to log only).
        -verbose        : Verbose mode.
        -y              : Do not prompt for confirmation.

        Version 2.1.0

Deployment utility configuration file

You can pass parameters to the deployment utility using command line options, or by using a configuration file that you pass as a parameter with the -config command line option. You can also use both command line options and a configuration file.

Listing 3 shows an example of using ifxdeploy with command line options and a configuration file on Linux. Listing 4 shows an example of using ifxdeploy with command line options and a configuration file on Windows.

Listing 3. Invoking the deployment utility with command line options and config file on Linux
ifxdeploy -y -verbose -config ifxdeploy.conf -file /opt/IBM/informix/ifxdir.tgz
Listing 4. Invoking deployment utility with some command line options and config file on Windows
ifxdeploy.exe -y -verbose -config ifxdeploy.conf -file C:\ids1150temp\11.50.zip

Following are some important notes regarding the deployment utility configuration file:

  • A sample deployment utility configuration file named ifxdeploy.conf is included on the IDS server at $INFORMIXDIR/etc on Linux and UNIX and at %INFORMIXDIR%\etc on Windows.
  • You can also specify IDS instance-specific information, for the instance that is getting deployed, in the configuration file. For example:
    • INFORMIXSERVER sets the primary server name.
    • SERVERNUM sets the primary server port number.
    • INFORMIXSQLHOSTS sets the value for the INFORMIXSQLHOSTS environment variable.
    • ONCONFIG sets the ONCONFIG file. If not specified, and the ONCONFIG environment variable is not set, a new ONCONFIG file is created based on the onconfig.std file template.
  • Use BEGIN ALIAS and END ALIAS statements to define additional server names and listeners. Each alias results in a new SQLHOSTS entry and a new value for the DBSERVERALIASES configuration parameter in the ONCONFIG file.
  • Use the BEGIN ONCONFIG and END ONCONFIG statements to add to or override configuration parameters values specified in the ONCONFIG file.

Listing 5 shows an example of a deployment utility configuration file for a Windows environment.

Listing 5. Sample deployment utility configuration file entries for Windows
INFORMIXSERVER  demo_on
PROTOCOL1 onsoctcp
PORT1 9088
SERVERNUM 1

BEGIN ALIAS 
SERVERNAME alias1
PROTOCOL drsoctcp
PORT 9091
END ALIAS

INFORMIXDIR "C:\Program Files\IBM\IBM Informix Dynamic Server\11.50"

RELOCATE C:\IFMXDATA\demo_on=C:\IFMXDATANEW\demo_on

ROOTPATH C:\IFMXDATANEW\demo_on\rootdbs_dat.000

BEGIN ONCONFIG
BUFFERPOOL default,buffers=1000,lrus=8,lru_min_dirty=50.000000,lru_max_dirty=60.500000
MAX_PDQPRIORITY	80
END ONCONFIG

Dynamic chunk relocation

The deployment utility provides the option to relocate the data spaces to a new location of your choice. This option is particularly useful when the drives or the directory structures of the source template computer and the target computer are different. An example of this would be if the data spaces are on /data1 on the template computer and you want to relocate them to /data2 on the target computer.

You can set the new location of the data spaces either as an argument on the -relocate command line parameter with the ifxdeploy command, or by setting it with the RELOCATE configuration parameter in the ifxdeploy.conf file.

You can specify a single new parent directory or map multiple separate chunk paths to different locations. Listing 6 shows an example of the -relocate command line parameter being used to relocate all chunk paths to a single directory.

Listing 6. Command line argument to relocate all chunk paths to one directory
-relocate /data2/demo_on

When relocating the chunks, you must specify the root dbspace chunk location either as an argument on the -rootpath command line parameter with the ifxdeploy command, or by setting it with the ROOTPATH configuration parameter in the ifxdeploy.conf file.

If you relocate dbspaces, you must also relocate the root dbspace. Listing 7 shows an example of the -rootpath command line parameter being used to point to the new location of the root dbspace chunk.

Listing 7. Command line argument to specify a new rootpath
-rootpath /home/informix/data/online_root

Automating IDS small footprint deployments on Linux and UNIX

This part of the tutorial shows you how to automate IDS small footprint deployments on a Linux or UNIX operating system.

Perform IDS installation on Linux or UNIX

This section describes how to perform a custom installation of IDS on a Linux or UNIX template computer to prepare the master copy for later deployment. A custom IDS installation lets you choose which features are installed. However, some features are mutually dependent and must be installed with one another. The installer manages these dependencies.

Note: You can skip this section on IDS installation if you already have an IDS instance that you wish to use as a template for deployment.

Install IDS

Informix client applications installation

Informix client application requirements are unique to each environment. Therefore, this tutorial does not cover installation of Informix client applications (namely Client Software Development Kit, Informix Connect, and Informix JDBC driver). For information about installing these applications, refer to section 6.4 of the IBM Redbooks publication "Embedding Informix Dynamic Server: An Introduction," which is linked to in the Resources section.

Before following the installation instructions, make sure your system meets the following prerequisite requirements:

  • Copy the IDS installation media to a template computer that is running Linux or UNIX. As an alternative, you can use an IDS installation CD to install IDS.
  • Create a user named informix on the operating system with a password of your choice.
  • Log in to the template computer as root.

When the above prerequisite requirements are met, follow these steps to perform a custom installation of IDS on a template computer:

  1. Launch the IDS installer program by running the installserver command, which is in the SERVER folder of the IDS install media.
  2. When prompted, enter y to run the installer in GUI mode.
  3. Click Next on the Welcome screen.
  4. Read and accept the license terms and conditions, and then click Next.
  5. Select the default installation path (/opt/IBM/Informix), and click Next.
  6. Select the option for custom installation setup, and click Next.
  7. Select the features that you want to install and deselect the features that you don't want to install. The space required (for software only) ranges from 79MB to 270MB based on whether you want to install just the base server or add more features. For example, Figure 1 shows a screenshot of a feature selection screen where just the base server and the Enterprise Replication feature are selected.
    Figure 1. Specific features selected for custom installation on Linux and UNIX platforms
    Screenshot of the feature selection screen from the IDS installation process with Base Server and Enterprise Replication selected.

    Select the features that you need to run your application and administer IDS. Here is the complete list of available components and their footprints (space requirements):

    • Base Server (78.4MB)
    • Database Server Extensions (115.3MB)
      • J/Foundation
      • Built-in DataBlade Modules
      • Conversion and Reversion Support
      • XML Publishing
    • Global Language Support (4.2MB)
    • Back up and Restore (31.2MB)
      • onbar
      • archecker utility
    • Demos (214 KB)
    • Data Loading Utilities (9.1MB)
      • onunload and onload utilities
      • dbload utility
      • High-performance loader (HPL)
    • Enterprise Replication (2.4MB)
    • Administrative Utilities (18.3MB)
      • Miscellaneous Monitoring Utilities
      • Performance Monitoring Utilities
      • Auditing Utilities
      • Database Import and Export Utilities
  8. Select No for role separation, and click Next.
  9. Select Yes for Demonstration Server Instance Creation, and click Next.
  10. Select the Use the default configuration file option, and click Next.
  11. Leave the default values for the server details (server name, server number, ROOTPATH, ROOTSIZE, etc.), and click Next.
  12. Review the summary of what you are going to install, and click Next to begin the installation process.
  13. After the installation completes, click Next.
  14. When prompted for a terminal emulator to be launched for the demo database instance, select None, and click Next.
  15. Click Finish to exit the installer program.

Check if IDS was installed properly

Run the commands shown in Listing 8 to verify that the IDS instance exists.

Listing 8. Commands to verify that the IDS instance exists
su - informix
. /opt/IBM/informix/demo/server/profile_settings
onstat -
cat /opt/IBM/informix/demo/server/online.log | grep sys

The onstat command shows that IDS is online, and the cat command shows that the system databases have been created.

Minimize the IDS installation footprint

This section describes how to minimize the IDS installation footprint by using the strip_ids.sh script to remove unnecessary files from the installed product.

Before following the instructions for minimizing the IDS installation footprint, make sure your system meets the following prerequisite requirements:

  • Install IDS as described in the previous section.
  • Download and open the IDS-Embeddability-Toolkit.zip file from the Download section of this tutorial and extract the strip_ids.sh script file to the /opt/IBM/Informix directory on the template computer.
  • Log in to the template computer as root.
  • If you are using a locale other than the default English locale, modify the strip_ids.sh script to prevent the removal of files that your IDS instance requires:
    • To determine which files you can delete based on your Global Language Support (GLS) requirements, refer to the IBM Informix GLS User's Guide (see the Resources section for a link).
    • On UNIX platforms, the default English locale is en_us.8859-1 (ISO 8859-1).
    • Modify the strip_ids.sh file according to the instructions in section 6.6 of the IBM Redbooks publication "Embedding Informix Dynamic Server: An Introduction," which is linked to in the Resources section.

When the above prerequisite requirements are met, use the commands shown in Listing 9 to run the strip_ids.sh script and reduce the IDS installation footprint by 30MB.

Listing 9. Commands to reduce the IDS installation footprint
cd /opt/IBM/informix
export INFORMIXDIR=/opt/IBM/informix
chmod +x strip_ids.sh
./strip_ids.sh

Tip: The script records the date and time in the $INFORMIXDIR/tmp/ids_strip_signature.log signature file. That file tracks whether the script is run on a particular Informix installation. Look in the strip_ids.sh file, which is copied to the $INFORMIXDIR/etc directory, for information about how it writes messages to the log.

Create a snapshot for deployment

This section describes how to create a snapshot of the IDS install binary files and the dbspaces on the template computer. You can then redeploy the snapshot on multiple servers without having to install IDS every time.

Before following the instructions for creating a snapshot, make sure your system meets the following prerequisite requirements:

  • Install IDS and minimize the IDS installation footprint as described in the previous sections.
  • Log in to the template computer as root.

Tip: You can use a number of Linux or UNIX utilities to create a snapshot. The tutorial uses tar. If you compress the snapshot into a tar file, you can automatically extract it with the deployment utility.

When the above prerequisite requirements are met, follow these steps to create a snapshot of the IDS install binary files and the dbspaces on the template computer:

  1. Block the database server to prepare it for archiving, and use the commands in Listing 10 to cleanly shut down your IDS instance.

    Note: The configuration settings for the demo_on database server instance are in the $INFORMIXDIR/demo/server/profile_settings file. If you want to create a snapshot of a different instance, before you run the commands in Listing 10, update the profile_settings file appropriately.

    Listing 10. Commands to cleanly shutdown the IDS instance
    su - informix
    . /opt/IBM/informix/demo/server/profile_settings
    onmode -kuy
  2. As user root, run the commands in Listing 11 to create a snapshot of the root dbspace chunk, which is in the /opt/IBM/informix/demo/server directory. You will use this snapshot to relocate the dbspace during deployment.

    Note: In this exercise you are creating a snapshot of only the root dbspace chunk because you have only created the root dbspace at the time of installation.

    Listing 11. Commands to create a snapshot of root dbspace
    cd /opt/IBM/informix/demo/server
    tar cvzf /home/informix/ids_dbspaces.tgz online_root

    Tip: Typically you don't need to take a snapshot of the dbspaces if they are in the INFORMIXDIR path. You need to take a snapshot of the dbspaces only if the dbspaces are located outside of the INFORMIXDIR path, or if you want to relocate the dbspaces during deployment.

  3. As user root, run the commands in Listing 12 to create a snapshot of the IDS installation directory. The commands archive the files from the IDS installation directory and store them in the /home/informix/ifxdir.tgz file.
    Listing 12. Commands to create a snapshot of the IDS install directory
    cd /opt/IBM/informix
    tar cvzf /home/informix/ifxdir.tgz *
  4. Save a copy of the snapshots on external media (such as a flash drive or a CD) for deployment.

After you have completed these steps to take a snapshot for deployment, you can then start IDS on the template computer.

Silently deploy the snapshot

This section describes how to use the deployment utility to deploy IDS using the snapshot of the archive you created in the previous section.

Before following the instructions for silently deploying the snapshot, make sure your system meets the following prerequisite requirements:

  • Install IDS, minimize the IDS installation footprint, and create a snapshot as described in the previous sections.
  • Log in to the template computer as root.
  • Create a user named informix with group informix on the operating system of the target computer where you are going to deploy IDS. Also, set the password of the informix user. For example, you can run the following commands as root to create the group and user informix and to set the user password to inform1x. You can change the password later:
        groupadd –g 500 informix
        useradd -g 500 -md /home/informix –p inform1x -u 501 informix
  • Create a folder named /home/informix/ids1150temp on the target computer, and copy the snapshot files (ids_dbspaces.tgz and ifxdir.tgz) into it.
  • Open the IDS-Embeddability-Toolkit.zip download file and extract the following files to the /home/informix/ids1150temp folder on the target computer.
    • ifxdeploy — deployment utility
    • ifxdeploy.conf — deployment utility configuration file
    • ifx_silent_deploy.sh — a shell script to complete silent deployment
  • The password for the informix user is set to inform1x in the ifxdeploy.conf file. Change it to a value of your choice and use it to connect to IDS in the future.
  • If you specified an instance name other than demo_on when you installed IDS, replace all the occurrences of demo_on with your instance name in the ifx_silent_deploy.cmd script.

When the above prerequisite requirements are met, you are ready to silently deploy the snapshot.

There are two different procedures to follow depending on whether or not you want to relocate dbspaces. Both procedures use the ifx_silent_deploy.sh script, which as part of the prerequisite requirements you extracted from the IDS-Embeddability-Toolkit.zip download file onto the target computer. At a high level, the ifx_silent_deploy.sh script does the following:

  • Deploys dbspaces if they are located outside the INFORMIXDIR path or you want to relocate dbspaces.
  • Optionally, relocates the dbspaces to a new location by using the deployment utility.
  • Deploys the IDS binary files by using the deployment utility.
  • Starts the instance.

See the A look at the ifx_silent_deploy.sh file section for more details on how the ifx_silent_deploy.sh script works.

If you want to silently deploy and relocate root dbspace from /opt/IBM/informix/demo/server to /home/informix/data, follow these steps:

  1. Run the following command to give execute permission to the root user:
    chmod +x ifx_silent_deploy.sh
  2. From the directory where you copied the ifx_silent_deploy.sh script, run the following command:
    ifx_silent_deploy.sh relocate

    Tip: Ignore all the warnings related to commands such as chown, chmod, and chgrp. These warnings are displayed because the deployment utility is looking for certain files that you removed when you stripped the IDS installation size. You can also ignore the warnings related to the dbaccessdemo command and the Internet foundation.

  3. Run the commands in Listing 13 to verify that the root dbspace was successfully relocated to the /home/informix/data folder.
    Listing 13. Commands to verify the new location of root dbspace
    su – informix
    . /opt/IBM/informix/demo/server/profile_settings
    onstat –
    onstat –d

If you want to silently deploy IDS without relocating the root dbspace, follow these steps:

  1. From the directory where you copied the ifx_silent_deploy.sh script, run the following command:
    ifx_silent_deploy.sh norelocate
  2. Run the commands in Listing 14 to verify that the root dbspace was not relocated.
    Listing 14. Commands to verify root dbspace location
    su – informix
    . /opt/IBM/informix/demo/server/profile_settings
    onstat –
    onstat –d

A look at the ifx_silent_deploy.sh file

This section takes a detailed look at the processing done by the ifx_silent_deploy.sh script. Knowing how the script works should help you to better understand how you can use it as a basis for deploying your own IDS instances.

  • The first few lines of the script shown in Listing 15 give usage details and initialize the variables.
    Listing 15. ifx_silent_deploy.sh — usage and variable initialization
    #!/bin/sh
    
    #Usage
    if [[ $# -ne 1 ]] ; then
            echo "Usage: ifx_silent_deploy.sh relocate_option"
            echo "relocate_option - 'relocate' to relocate dbspaces"
            echo "relocate_option - 'norelocate' not to relocate dbspaces"
            echo "example1: ifx_silent_deploy.sh relocate"
            echo "example2: ifx_silent_deploy.sh norelocate"
            exit 1
    fi
    ONINIT_CMD="oninit -vy"
    RELOCATE_OPTION=$1
  • The next portion of the script shown in Listing 16 sets the environment variables for the IDS instance that is being deployed. The environment variable values are hard-coded in the script. However, you could customize the script so that it would instead accept the environment variable values as command line options.
    Listing 16. ifx_silent_deploy.sh — setting the environment variables
    echo "***********************************************************"
    echo "Setting the environment variables for IDS"
    echo "***********************************************************"
    #if $INFORMIXDIR is set to /opt/IBM/informix then use it. 
    #Otherwise, create a new directory and set to $INFORMIXDIR.
    
    if [ ! -d "/opt/IBM/informix" ] ; then
    	mkdir -p /opt/IBM/informix
    	chmod 755 /opt/IBM/informix
    	chown -R informix:informix /opt/IBM/informix
    fi
    
    INFORMIXDIR=/opt/IBM/informix
    INFORMIXSERVER=demo_on
    ONCONFIG=onconfig.demo_on
    INFORMIXSQLHOSTS="$INFORMIXDIR/etc/sqlhosts.$INFORMIXSERVER"
    PATH=${INFORMIXDIR}/bin:${PATH}
    
    export INFORMIXDIR INFORMIXSERVER ONCONFIG INFORMIXSQLHOSTS PATH
  • The portion of the script shown in Listing 17 checks the RELOCATE_OPTION variable, and based on its value calls the appropriate version of the ifxdeploy command. Note that in the actual script, the -rootpath and -relocate options are on the same line as the first ifxdeploy command. They are shown on separate lines in the listing only because of limitations to the line lengths that are allowed by this tutorial's formatting.

    Following is a description of the processing that takes place in this part of the script:

    • If you choose to relocate dbspaces:
      • Create the new path for the dbspaces, and set appropriate privileges.
      • Change the owner of the new path to informix.
      • Copy IDS install binaries' snapshot to the new INFORMIXDIR.
      • Copy and untar the dbspaces to the new path using tar command.
      • Deploy everything and relocate dbspaces using the ifxdeploy command.
    • If you choose not to relocate dbspaces:
      • Copy the IDS install binaries snapshot to the new INFORMIXDIR.
      • Deploy the IDS install binaries and the root dbspace using the ifxdeploy command.
    • If you enter any value other than relocate or norelocate for the RELOCATE_OPTION:
      • Exit the program with a warning message.
    Listing 17. ifx_silent_deploy.sh — deploying the IDS instance
    if [ $RELOCATE_OPTION = "relocate" ]; then
    	echo "***********************************************************"
    	echo "Relocating chunks and deploying IDS"
    	echo "***********************************************************"
    	mkdir -p /home/informix/data
    	chmod 755 /home/informix/data
    	chown -R informix:informix /home/informix/data
    	cp ifxdir.tgz /opt/IBM/informix
    	tar -xvzf ids_dbspaces.tgz -C /home/informix/data/
    	./ifxdeploy -y -verbose -config ifxdeploy.conf -f /opt/IBM/informix/ifxdir.tgz 
    	       -rootpath /home/informix/data/online_root 
    	       -relocate /opt/IBM/informix/demo/server=/home/informix/data
    elif [ $RELOCATE_OPTION = "norelocate" ]; then
    	echo "***********************************************************"
    	echo "Deploying IDS with no relocation of chunks"
    	echo "***********************************************************"
    	cp ifxdir.tgz /opt/IBM/informix
    	./ifxdeploy -y -verbose -config ifxdeploy.conf -f /opt/IBM/informix/ifxdir.tgz
    else
    	echo "***********************************************************"
    	echo "Invalid relocate option; exiting the program"
    	echo ***********************************************************
    	exit 1
    fi
  • The last portion of the script shown in Listing 18 starts the IDS instance.
    Listing 18. ifx_silent_deploy.sh — starting the IDS instance
    echo "***********************************************************"
    echo "Silent deployment of IDS instance is done!!!"
    echo "Bringing up the IDS instance"
    echo "***********************************************************"
    eval $ONINIT_CMD
    
    echo "***********************************************************"
    echo "IDS instance is up"
    echo "***********************************************************"

Automating IDS reduced footprint deployments on Windows

This part of the tutorial shows you how to automate IDS small footprint deployments on a Windows operating system.

Perform IDS installation on Windows

This section describes how to perform a custom installation of IDS on a Windows template computer to prepare the master copy for later deployment. A custom IDS installation lets you choose which features are installed. However, some features are mutually dependent and must be installed with one another. The installer manages these dependencies.

Note: You can skip this section on IDS installation if you already have an IDS instance that you wish to use as a template for deployment.

Informix client applications installation

Informix client application requirements are unique to each environment. Therefore, this tutorial does not cover installation of Informix client applications (namely Client Software Development Kit, Informix Connect, and Informix JDBC driver). For information about installing these applications, refer to section 6.4 of the IBM Redbooks publication "Embedding Informix Dynamic Server: An Introduction," which is linked to in the Resources section.

Before following the installation instructions, make sure your system meets the following prerequisite requirements:

  • Copy the IDS installation media to a template computer that is running Windows. As an alternative, you can use an IDS installation CD to install IDS.
  • Log in to the template computer as a user with administrator privileges.

When the above prerequisite requirements are met, follow these steps to perform a custom installation of IDS on a template computer:

  1. Launch the IDS installer program by double-clicking the setup.exe file in the IIF folder of the installation media.
  2. Click Next on the Welcome screen.
  3. Read and accept the license terms and conditions, and then click Next.
  4. Select the option for custom installation setup, and click Next.
  5. Select the default installation path (C:\Program Files\IBM\IBM Informix Dynamic Server\11.50), and click Next.
  6. Select the features that you want to install and deselect the features that you don't want to install. The space required (for software only) ranges from 101MB to 270MB based on whether you want to install just the base server or add more features. For example, Figure 2 shows a screenshot of a feature selection screen where just the base server and the Enterprise Replication feature are selected.
    Figure 2. Specific features selected for custom installation on Windows
    Specific features selected for custom installation on Windows

    Select the features that you need to run your application and administer IDS. Here is the complete list of available components and their footprints (space requirements):

    • Base Server (109MB)
    • Database Server Extensions (127MB)
      • J/Foundation
      • Built-in DataBlade Modules
      • Conversion and Reversion Support
      • XML Publishing
    • Global Language Support (5MB)
    • Back up and Restore (8MB)
      • onbar
      • Informix Interface for Tivoli Storage Manager
      • Informix Storage Manager
      • archecker utility
    • Demos (1MB)
    • Data Loading Utilities (6MB)
      • onunload and onload utilities
      • dbload utility
      • High-performance loader (HPL)
    • Enterprise Replication (3MB)
    • Administrative Utilities (10MB)
      • Miscellaneous Monitoring Utilities
      • Performance Monitoring Utilities
      • Auditing Utilities
      • Database Import and Export Utilities
  7. Enter a password for the user name informix, and click Next. The installer creates the informix user with the password you provide.
  8. Leave the default values for the server details (server name, server number, service name, port numbers, etc.), and click Next.
  9. Specify the location and size of the data dbspace and sbspace. You can specify a size of 100MB for dbspaces.
  10. Review the summary of what you are going to install, and click Next to begin the installation process.
  11. Click Finish to exit the installer program.

Minimize the IDS installation footprint

This section describes how to minimize the IDS installation footprint by using the strip_ids.bat script to remove unnecessary files from the installed product. Optionally, you can also choose to drop the storage spaces that were created at the time of installation.

Before following the instructions for minimizing the IDS installation footprint, make sure your system meets the following prerequisite requirements:

  • Install IDS as described in the previous section.
  • Download and open the IDS-Embeddability-Toolkit.zip file from the Download section of this tutorial and extract the strip_ids.bat script file to a directory on the template computer.
  • Log in to the template computer as a user with administrator privileges.
  • If you are using a locale other than the default English locale, modify the strip_ids.bat script to prevent the removal of files that your IDS instance requires:
    • Refer to the IBM Informix GLS User's Guide to learn which files can be deleted based on your GLS requirements.
    • In Windows environments, the default English locale is en_us.1252 (Microsoft 1252).
    • Modify the strip_ids.bat file according to the instructions in section 6.6 of the IBM Redbooks publication.

When the above prerequisite requirements are met, follow these steps to reduce the IDS installation footprint:

  1. From a Windows command prompt, change the current directory to the directory on the template computer where you put the strip_ids.bat script file.

    Note: In the strip_ids.bat file, the INFORMIXDIR environment variable is set to the default value of C:\Program Files\IBM\IBM Informix Dynamic Server\11.50. If you installed IDS to a different directory, change the INFORMIXDIR value in strip_ids.bat accordingly.

  2. Run the strip_ids.bat script by entering the following command from the Windows command prompt:
    strip_ids

    The strip_ids.bat script reduces the IDS footprint by 29.4MB.

    Tip: The script records the date and time in the INFORMIXDIR\tmp\ids_strip_signature.log signature file. That file tracks whether the script is run on a particular Informix installation. Look in the strip_ids.bat file, which is copied to the INFORMIXDIR\etc directory, for information about how it writes messages to the log.

  3. Optionally, you can use the steps below to drop the dbspaces (other than rootdbs) and sbspaces that were created during installation. The steps assume that you installed IDS as described in the previous section.

    Note: Do not drop the dbspaces if you are planning to use them in the future. Also, do not drop the dbspaces and sbspaces if you want to use the relocate option of the deployment utility.

    1. Open an IDS command window.
    2. Set the environment by selecting Start > All Programs > IBM Informix Dynamic Server 11.50 > ServerName.
    3. Run the following command to display the existing dbspaces information:
      onstat –d
    4. Make a note of the names of the dbspaces other than rootdbs and use the following command to drop the unwanted dbspaces:
      onspaces –d dbspacename
    5. Run the following command again to verify that the unwanted dbspaces have been removed:
      onstat –d
    6. Delete the chunks that were created for the dbspaces that you just dropped.

Create a snapshot for deployment

This section describes how to create a snapshot of the IDS install binary files and the dbspaces on the template computer. You can then redeploy the snapshot on multiple servers without having to install IDS every time.

Before following the instructions for creating a snapshot, make sure your system meets the following prerequisite requirements:

  • Install IDS and minimize the IDS installation footprint as described in the previous sections.
  • Log in to the template computer as a user with administrator privileges.
  • Download 7-zip from http://www.7-zip.org/ and install it on the template computer at the default location (C:\Program Files\7-Zip).

Tip: You can use a number of Windows utilities to create a snapshot. The tutorial uses 7-Zip, an open source file archiving utility for Windows. If you compress the snapshot into a .zip file, it can be automatically extracted by the deployment utility at the time of deployment.

When the above prerequisite requirements are met, follow these steps to create a snapshot of the IDS install binary files and the dbspaces on the template computer:

  1. Block the database server to prepare it for archiving.
  2. Open an IDS command window.
  3. Set the environment by selecting Start > All Programs > IBM Informix Dynamic Server 11.50 > ServerName.
  4. Run the following command to shut down the instance:
    onmode –kuy
  5. Run the following command exit the command window:
    exit
  6. Create a .zip file of the IFMXDATA folder on the C:\drive of the template computer.

    Note: These instructions assume you wan to archive the complete IFMXDATA folder, which contains only the default instance that you created at the time of installation. If you have multiple instances and if you want to take a snapshot of only a specific instance, follow the same procedure but archive only the instance of your choice.

    Figure 3 shows an example of how you can create the zip file by going to Windows Explorer, right clicking on the IFMXDATA, and selecting 7-Zip > Add to IFMXDATA.zip from the context menu.

    Figure 3. Creating the IFMXDATA.zip file with Windows Explorer and 7-Zip
    Screenshot of Windows Explorer, IFMXDATA folder is right clicked and 7-Zip > Add to IFMXDATA.zip is selected.
  7. Create a snapshot of the IDS installation directory by placing all the files and folders under the C:\Program Files\IBM\IBM Informix Dynamic Server\11.50 directory into a zip file named 11.50.zip

    Figure 4 shows an example of how you can create the zip file by going to Windows Explorer, navigating to the C:\Program Files\IBM\IBM Informix Dynamic Server\11.50 directory, using Ctrl+A to select all the files and folders, right clicking, and selecting 7-Zip > Add to Archive. In this example, you would then choose Zip as the archive format, and click OK to create the archive with the name 11.50.zip.

    Figure 4. Creating a snapshot of the IDS install directory
    From Explorer, IDS install directory is open with all files and folders selected. Right click, go to 7-Zip > Add to Archive.
  8. Save the two snapshot archive files (IFMXDATA.zip and 11.50.zip) on external media (such as a flash drive or a CD) for deployment.

After you have completed these steps to take a snapshot for deployment, you can then start IDS on the template computer.

Silently deploy the snapshot

This section describes how to use the deployment utility to deploy IDS using the snapshot of the archive you created in the previous section.

Before following the instructions for silently deploying the snapshot, make sure your system meets the following prerequisite requirements:

  • Install IDS, minimize the IDS installation footprint, and create a snapshot as described in the previous sections.
  • Log in to the target computer as a user with administrator privileges.
  • Download 7-zip from http://www.7-zip.org/ and install it on the template computer at the default location C:\Program Files\7-Zip.
  • Create a folder named ids1150temp on the C:\ drive of the target computer, and copy the snapshot archive files (IFMXDATA.zip and 11.50.zip) into it.
  • Open the IDS-Embeddability-Toolkit.zip download file and extract the following files to the c:\ids1150temp folder on the target computer.
    • ifxdeploy.exe — deployment utility.
    • ifxdeploy.conf — deployment utility configuration file.
    • ifx_silent_deploy.cmd — a batch command file to complete silent deployment.
  • The password for the informix user is set to inform1x in the ifxdeploy.conf file. Change it to a value of your choice and use it to connect to IDS in the future.
  • If you specified an instance name other than demo_on, when you installed IDS, replace all the occurrences of demo_on with your instance name in the ifx_silent_deploy.cmd script.

When the above prerequisite requirements are met, you are ready to silently deploy the snapshot.

There are two different procedures to follow depending on whether or not you want to relocate dbspaces. Both procedures use the ifx_silent_deploy.cmd command file, which as part of the prerequisite requirements you extracted from the IDS-Embeddability-Toolkit.zip download file onto the target computer. At a high level, ifx_silent_deploy.cmd does the following:

  • Deploys the dbspaces from the IFMXDATA.zip file.
  • Optionally, relocates the dbspaces to a new location by using the deployment utility.
  • Deploys the IDS binary files by using the deployment utility.

See the A look at the ifx_silent_deploy.cmd file section for more details on how the ifx_silent_deploy.cmd file works.

If you want to silently deploy and relocate dbspaces, including the root dbspace, to C:\IFMXDATANEW\demo_on, follow these steps:

  1. Open a Windows command prompt and change the current directory to C:\ids1150temp
  2. Run the following command:
    ifx_silent_deploy relocate

    The command silently relocates dbspaces and deploys a snapshot of IDS. You can look in the C:\ids1150temp\ifxdeploy.log file to review the messages that are logged by the deployment utility.

If you want to silently deploy IDS without relocating the dbspaces, follow these steps:

  1. Open a Windows command prompt and change the current directory to C:\ids1150temp
  2. Run the following command:
    ifx_silent_deploy norelocate

    The command silently deploys a snapshot of IDS. You can look in the C:\ids1150temp\ifxdeploy.log file to review the messages that are logged by the deployment utility.

Start the IDS instance

You can start the silently-deployed instance of the IDS snapshot from either the Windows start menu or a Windows command prompt.

To start from the Windows start menu:

  1. Select Start > Control Panel > Administrative Utilities > Services.
  2. Start the service named Informix IDS - ServerName. In this example, ServerName would be demo_on.

To start from a Windows command prompt:

  1. Open a Windows command prompt.
  2. Enter the command: Run the following command:
     net start "Informix IDS - ServerName"

    In this example, ServerName would be demo_on.

    You can also start the instance by including the above command in a batch or command script file.

A look at the ifx_silent_deploy.cmd file

This section takes a detailed look at the processing done by the ifx_silent_deploy.cmd command file. Knowing how the file works should help you to better understand how you can use it as a basis for deploying your own IDS instances.

  • The first few lines of the file shown in Listing 19 simply provide usage details.
    Listing 19. ifx_silent_deploy.cmd — usage details
    @ECHO OFF
    
    REM Usage: ifx_silent_deploy.cmd relocate_option
    REM relocate_option - relocate to relocate dbspaces
    REM relocate_option - norelocate not to relocate dbspaces
    REM example1: ifx_silent_deploy.cmd relocate
    REM example2: ifx_silent_deploy.cmd norelocate
  • The next portion of the file shown in Listing 20 changes the directory to the folder that contains the script, sets the path for the 7-Zip executable file, and sets the environment variables for the IDS instance that is being deployed. The environment variable values are hard-coded in the script. However, you could customize the script so that it would instead accept the environment variable values as command line options.
    Listing 20. ifx_silent_deploy.cmd — setting paths and environment variables
    ECHO ***********************************************************
    ECHO Changing the directory to c:\ids1150temp
    ECHO ***********************************************************
    
    cd c:\ids1150temp
    
    ECHO ***********************************************************
    ECHO Setting the PATH for 7-zip utility
    ECHO ***********************************************************
    
    SET PATH=C:\Program Files\7-Zip\;%PATH%
    
    ECHO ***********************************************************
    ECHO Setting the environment variables for IDS
    ECHO ***********************************************************
    
    set INFORMIXDIR=C:\Program Files\IBM\IBM Informix Dynamic Server\11.50
    set INFORMIXSERVER=demo_on
    set ONCONFIG=ONCONFIG.demo_on
    set PATH=%INFORMIXDIR%\bin;%PATH%
  • The portion of the file shown in Listing 21 extracts the dataspaces to C:\IFMXDATA.
    Listing 21. ifx_silent_deploy.cmd — extract the dbspaces from the snapshot
    ECHO ***********************************************************
    ECHO Extracting data spaces from IFMXDATA.zip file
    ECHO ***********************************************************
    
    7z x -oc:\ IFMXDATA.zip
  • The portion of the script shown in Listing 22 checks the value of the command line argument that is entered with the ifx_silent_deploy command, and based on its value calls the appropriate version of the ifxdeploy command. Note that in the actual command file, the -rootpath and -relocate options are on the same line as the first ifxdeploy command. They are shown on separate lines in the listing only because of limitations to the line lengths that are allowed by this tutorial's formatting.

    Following is a description of the processing that takes place in this part of the command file:

    • If you choose to relocate dbspaces:
      • Create the new path for the dbspaces.
      • Move the dbspaces' chunks from the current path to the new path.
      • Deploy the IDS install binaries and relocate dbspaces using the ifxdeploy command.
    • If you choose not to relocate dbspaces:
      • Deploy the IDS install binaries and the dbspaces using the ifxdeploy command.
    Listing 22. ifx_silent_deploy.cmd — deploying the IDS instance
    IF %1 == relocate (
    ECHO ***********************************************************
    ECHO Relocating chunks and deploying IDS
    ECHO ***********************************************************
    mkdir C:\IFMXDATANEW\demo_on
    move C:\IFMXDATA\demo_on\rootdbs_dat.000 C:\IFMXDATANEW\demo_on\rootdbs_dat.000
    move C:\IFMXDATA\demo_on\demo_on_dat.000 C:\IFMXDATANEW\demo_on\demo_on_dat.000
    move C:\IFMXDATA\demo_on\sbspace_dat.000 C:\IFMXDATANEW\demo_on\sbspace_dat.000
    .\ifxdeploy.exe -y -verbose -config ifxdeploy.conf -f 11.50.zip 
    -rootpath C:\IFMXDATANEW\demo_on\rootdbs_dat.000 
    -relocate C:\IFMXDATA\demo_on=C:\IFMXDATANEW\demo_on
    GOTO end
    ) ELSE (
    ECHO ***********************************************************
    ECHO Deploying IDS with no relocation of chunks
    ECHO ***********************************************************
    .\ifxdeploy.exe -y -verbose -config ifxdeploy.conf -f 11.50.zip
    GOTO end
    )
    
    :end
    ECHO ***********************************************************
    ECHO Silent deployment of IDS instance is done!!!
    ECHO Start your IDS instance from Windows services
    ECHO ***********************************************************

Conclusion

After following the instructions in this tutorial you should now be able to automate IDS small footprint deployments using a combination of the IDS deployment utility and the embeddability toolkit contained in the Download section of the tutorial. You should have learned how to reduce the footprint of Informix Dynamic Server. This enables you to silently deploy and embed IDS on Linux, UNIX, and Windows. You can easily customize the configuration file and the scripts in the embeddability toolkit according to meet your own requirements.

Acknowledgements

This tutorial is the result of many people's efforts, and the author would like to thank the following individuals for their contributions.

In alphabetical order:

  • Alan Caldera, Install/Datablades Architect - Informix Development
  • Frank Welsch, Informix Information Developer
  • Gerry Cousins, Software Developer - Informix Development
  • Guy Bowerman, Informix Architect - Embeddability, Virtualization, and Cloud Computing
  • Jasna Krmpotic, Technical Editor - IBM Information Management User Technology
  • Ted Wasserman, Manager, WW Information Management Partner Technologies - Informix
  • Tosin Ajayi, Software Developer - Informix Development

Download

DescriptionNameSize
IDS embeddability toolkitIDS-Embeddability-Toolkit.zip106KB

Resources

Learn

Get products and technologies

Discuss

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into Information management on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Information Management
ArticleID=473646
ArticleTitle=Automate small footprint, embedded Informix Dynamic Server deployments
publish-date=03112010