Skip to main content

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

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

All information submitted is secure.

  • Close [x]

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.

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

All information submitted is secure.

  • Close [x]

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

Sreeni Paidi (spaidi@us.ibm.com), Advisory Software Engineer, IBM
Sreeni Paidi photo
Sreeni Paidi is an Advisory Software Engineer and Enablement Consultant with IBM's Information Management Technical Enablement organization. Sreeni has over 13 years of experience working with DB2, Informix, Oracle, and PostgreSQL database servers as a Database Programmer, DBA and 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.

Summary:  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.

Date:  11 Mar 2010
Level:  Intermediate PDF:  A4 and Letter (247 KB | 34 pages)Get Adobe® Reader®

Activity:  22087 views
Comments:  

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 "***********************************************************"
    

3 of 8 | Previous | Next

Comments



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