January 27, 2015

Effectively deploy Informix snapshot using Instance Deployment Utility 'ifxdeploy'

IBM Informix facilitates deployment of Informix instances on 'n' number of target servers, by means of capturing Snapshot of Informix Instance, up and running on the source server.

Snapshot provides you a means of taking a backup of a Informix Instance in an 'As - Is' state and then deploy the same on multiple target servers. The advantages of deploying snapshot are:
  1. You don't have to go through the process of Installation & Configuration on every target server ( Though, one can Install & Configure IBM Informix with minimal fuss, within few minutes)
  2. Capturing the snapshot 'As - Is', facilitates capturing the schema and data of database(s) withing the Informix instance, at that moment.
  3. Deployment of such a snapshot on target servers, brings up the instances to the same state as available on source server, significantly saving time and resources and brings the users to the speed, hardly missing a beat, as though, they are working on the source server.

IBM Informix provides following two utilities to effectively perform snapshot deployment:
  • ifxdeployassist  : The Deployment Assistant (DA) is used to create a snapshot of an up & running Informix database server instance, with the Instance being in On-Line mode. This utility is used on the Source server.
  • ifxdeploy           : The Deployment Utility (DU) makes use of the snapshot as created by the DA on the source server and deploys it on the target server. It optionally refers to the 'ifxdeploy.conf' configuration file to configure the parameters on target Informix instance.

 The following section of the blog briefs you on the step by step procedure to effectively create a snapshot using the DA and then deploy it on the target server making use of the DU.

Creating Informix Instance Snapshot using Deployment Assistant:

    1. Choose a Informix Instance to be your choice of source server. Ensure the Informix instance is up and running ( verify the output of “onstat –“ command ). Configure the instance and fine tune the settings for performance, as needed.
    2. If the target environment is familiar, then Identify the names of the users who shall be accessing the server and then GRANT necessary privileges, against the DEMODB, SYSADMIN and SYSUSERS databases, else, if you are not familiar with target environment, then plan to grant privileges to the ‘public’, which relates to any user accessing the machine:

    3. Once the privileges have been granted, we are good to take a snap shot
    4. Decide on the archive file format, to have the snap shot on, i.e ZIP, TAR, GZIP, etc
    5. Execute the command

      Windows         : ifxdeployassist.exe –a zip –d

      Linux / Unix    : ifxdeployassist –a tar –d

      Here, flag ‘a’ defines the target archive file format and flag ‘d’ represents that data also needs to be picked up as part of the snap shot
    6. The deployment assistant pop-up window shall appear on the screen. Follow the instructions on the window to complete the activity of taking a Informix Instance Snapshot
    7. Click on Finish to complete the snapshot activity and exit the pop up window
    8. Verify that the snap shot creation activity has created two files, one with the Instance details and the other one with the dbspaces details ( *_db extension )
    9. Copy the ‘ifxdeploy.exe’ file ( On Windows) or ‘ifxdeploy’ file ( On Linux / Unix ) found under %INFORMIXDIR%/bin, ‘ifxdeploy.conf’ file found under %INFORMIXDIR%/etc, along with the snapshot files obtained in Step 8, to a directory location on the Target server

      Deploy Informix Instance Snapshot using Deployment Utility (DU)
    10. On the Target server, confirm that you have received the ‘ifxdeploy’, ‘ifxdeploy.conf’ file and the snap shot files, intact, without any corruptions
    11. Ensure, the user on the server has Read / access privileges to the files identified in Step 10
    12. Extract the contents of one of the two snap shot files, the one that has the DBSpaces and is identified with the file format “*_db”
    13. Now edit the ‘ifxdeploy.conf’ file, to update the Target Parameter values, to suit to the target deployment:

      User needs to update the ‘ifxdeploy.conf’ file, to update various parameters like:
      INFORMIXSERVER : Name of the Informix instance ( Same name as that of the Instance on source server, else, provide a custom name)
      PROTOCOL1 : Type of Communication protocol to be used. Retain same as source server
      SQLIPORT : Port Number. Retain same as source server or provide unique port number on the target server
      DRDAPORT : If DRDA is available and needed
      SERVERNUM : Unique server number. Retain same as source server or provide a unique number
      INFORMIXSQLHOSTS : Name of the Informix SQLHOSTS file. Retain same as source server
      INFORMIXDIR : Directory Location on file system where Informix Snap shot utility shall deploy Informix on the target machine / server. This directory shouldn’t be created in advance, the utility shall take care of it.
      ONCONFIG : Name of the Informix ONCONFIG file. Retain same as source server
      START : Denotes the number of seconds after which, the utility starts the target Informix instance
      SNAPSHOT : Absolute path to the Snap shot file, as taken on the source server. This is the file that holds all the binaries and executable that makes up the Informix Instance on the target machine.
      RELOCATE : Location of dbspace chunks on the target server. Either provide the location of the directory where you have extracted the “ *_db” zip/tar file or move them to a directory location and provide that path here
      INFORMIXPASSWORD : Password for user ‘informix’
      SYSTEM : Set the value to ‘1’ to use Local System User account, else set it to ‘0’ for Informix
      LOGFILE : Location of log file to capture the output of the snapshot deployment
      ROOTPATH : Absolute Path of the ROOTDBS file, after it has been extracted on the target server
      WIN6432 : Set to ‘1’, if the source and target servers are being ported from 32 bit to 64 bit
    14. Refer the Attachment "ifxdeploy.conf" for further details and illustration on how to update the config file
    15. Open a Command Prompt on the target server and set the environment for the following two parameters:
      INFORMIXDIR        : Location where Informix Snap shot utility shall deploy Informix on the target machine / server. This directory shouldn’t be created in advance, the utility shall take care of it.
      INFORMIXSERVER    : Name of the Informix instance ( Same name as that of the Instance on source server, else, provide a custom name)
    16. Once the environment is set, execute the following command to initiate the Informix Deployment Utility to deploy the snapshot on the target machine

      ifxdeploy.exe -f "F:\embed_demo\ol_informix1210_20141229_1210.zip" -config ifxdeploy.conf –verbose

      " –f "                   : Refers to the physical location of the snapshot file
      " –config "     : Refers to the CONFIGURATION file that shall be referred by the snapshot deployment utility during deployment
    17. Refer the attachment "deploy.bat", that illustrates how to quickly prepare a BATCH file ( for Windows ) or attachment "deploy" file that illustrates how to quickly prepare a Shell script ( For Linux / Unix ), to perform the deployment and ensure that the setup is at relevant location to startup the Informix engine )
    18. The utility takes few minutes to complete the deployment and exits the execution after completion
    19. Verify the successful completion of snapshot deployment by monitoring the status of the Informix instance on the target machine using the command "onstat –"
Please Click Here to download the attachments referred in this blog work.

Additional References:
IBM Informix Embeddability Deployment Tutorial

No comments: