Practically Agile

Using Agile in less-than-perfect situations since Y2K

Installing Informix on a Mac

Update: I had some problems connecting to Informix via Java. Also, the process below led to an issue with the “informix” user’s group settings. I have created a “part 2″ post to detail what happened and how I managed to fix it. Please read that before using these instructions to perform your own install.

I have recently started a project with a group that uses Informix as the database. To set up my development environment to match production as closely as possible, I have installed IDS for Mac. The instructions that you can find on the web caused me some difficulty. There is a video available from IBM that would be great, but it seems to be outdated slightly. (Viewing it may still give you some benefit, so you can find it here.) To save myself time in the future if other Mac users need to join the project, I have documented what I believe to be the final process here.

Caveats:

  • Do not start this process without a current system backup. System settings are going to be modified.
  • I tried to document this as I went, however I did make some discoveries late and then inserted them where I believe I should have done them. Those have not been retested.
  • It is likely there are better/faster ways to do some of these things.
  • There may well be additional steps needed to add additional databases or if your usage is heavier than mine to date.

If you try this out and find some things that don’t work or ways to make it faster or easier, please let me know in the comments. I will happily incorporate them.

One quick formatting note, when command examples are given, the “$” at the beginning of a line is in place of the command prompt. By default in the Mac Terminal app, this is usually of the form “hostname:current_directory username$”. If you copy and paste the commands, remove the “$” and the space after it.

Installing IDS

  1. Download IDS here
  2. Mount the downloaded IDS disk image (iif.11.50.FC2DE.macosx64.dmg)
  3. Double-click the install package (iif.11.50.FC2DE.macosx64.pkg) and follow the prompts.
  4. Enable root user and log in as root. Note: It might be possible to follow the steps using only sudo, but most on-line instructions say to use the root account method. As such, this is what has been tested. Instructions provided below are for Snow Leopard 10.6.2.
    1. Open System Preferences
    2. Click “Accounts”
    3. Click “Login Options” (just above the lock in the bottom-left)
    4. Click the button next to “Network Account Server:” (near bottom-middle)
    5. Click “Open Directory Utility…”
    6. Click the lock (bottom-left) and enter admin password
    7. In the menu-bar, choose “Edit” then “Enable Root User”
    8. Enter a password for the root user
    9. Quit Directory Utility.
    10. Close System Preferences
    11. Log out
    12. Choose “Other” from the log-in menu and provide the root as the username and the password entered previously.
  5. Kernel options:
    1. Kernel options should be as follows per the IDS README files. (To avoid issues, system settings can be higher, but not lower):
      kern.sysv.shmmax=4398046511104
      kern.sysv.shmmin=1
      kern.sysv.shmmni=512
      kern.sysv.shmseg=512
      kern.sysv.shmall=1073741824
      kern.sysv.semume=10
      kern.sysv.semmsl=87381
      kern.sysv.semmnu=87381
      kern.sysv.semmns=87381
      kern.sysv.semmni=87381
      kern.maxfiles=2147483647
      kern.maxfilesperproc=40000
      kern.maxvnodes=150000
    2. To check them, use the following command:
      $ sysctl kern.sysv.shmmax kern.sysv.shmmin kern.sysv.shmmni kern.sysv.shmseg kern.sysv.shmall kern.sysv.semume kern.sysv.semmsl kern.sysv.semmnu kern.sysv.semmns kern.sysv.semmni kern.maxfiles kern.maxfilesperproc kern.maxvnodes
      
    3. Compare the output to the list above.
    4. To adjust any that need to be changed, use the following command (may not work for kern.sysv.shmmni):
      $ sysctl -w
      

      And copy the key-value from the list above (ex. kern.sysv.shmmax=4398046511104)

    5. Those command-line changes will disappear after a reboot. To make them permanent, edit /etc/sysctl.conf and simply paste the desired key-values. This is an important system file. Make a backup of the file first!
  6. Two options (the first runs a CLI installer, the second may run a GUI installer):
    1. Open a terminal window, navigate to /Applications/IBM/informix and run “ids_install”
    2. Open the finder, navigate to /Applications/IBM/informix and double-click “ids_install”
  7. Follow the installer prompts. Accept defaults as much as is possible except for the demo server installation and terminal emulator. Be sure to select “Yes” for the demo server and do not use the terminal emulator option.
  8. Launch a terminal window.
  9. Execute the following command (assuming a Bash shell):
    $ . /Applications/IBM/informix/demo/server/profile_settings
    
  10. If desired, copy the settings in that profile_settings file to your profile (as well as the profile of root and/or the informix user created by the installation).
  11. Run the following command to load the demo database, which will not be in your path (actual location: /Applications/IBM/informix/bin):
    $ dbaccessdemo
    
  12. Run the following command to connect to the database:
    $ dbaccess
    
  13. The interface is navigable using the arrow keys on the keyboard, go to “Table”
  14. Select the database “storesdemo@demoon”
  15. Select “Info”
  16. Select the “‘root’.stock” table
  17. Select “Columns”
  18. View the information (no more detail will be gone into here on using the tool)
  19. Select “Exit” and repeat until the tool quits.
  20. You can now log out as root and back in as your normal user.
  21. If you want to use the informix user to start/stop your database, continue. Otherwise, you can use the root user. Both will work from a terminal.
  22. Open Terminal and navigate to the /Users directory.
  23. By default, the install creates the informix user’s home directory but leaves it owned by the root user. To change the owner use (enter your password when prompted):
    $ sudo chown informix informix
    
  24. Use “su” command in the Terminal to log in as the informix user (enter the informix user’s password when prompted):
    $ su - informix
    
  25. Use the command below to print the contents of the needed settings to the terminal:
    $ cat /Applications/IBM/informix/demo/server/profile_settings
    
  26. Select the text (using the mouse) and copy it using Command-C.
  27. Edit (or create) a .profile file in the informix user’s home directory:
    $ cd ~
    $ vim .profile
    
  28. Enter VI’s insert mode by pressing “i”, and paste the copied settings using Command-V.
  29. Save and exit VI by pressing Escape, then entering “:wq” (without the quotes).
  30. Log out as informix and setup is complete.

Starting IDS

  1. Open a terminal and use the “su -” command to log in as root or the informix user. The “-” is important, as it ensures the user’s profile is loaded. If the informix user was enabled to start/stop the database according to the optional steps during installation, this loads the appropriate settings and “informix$” will now be the command prompt. Otherwise, the settings in /Applications/IBM/informix/demo/server/profile_settings must be loaded manually using this command:
    $ . /Applications/IBM/informix/demo/server/profile_settings
    
  2. Run the commands below. The output should match:
    $ oninit
    $ onstat -
    
    IBM Informix Dynamic Server Version 11.50.FC2DE — On-Line — Up 00:00:09 — 41756 Kbytes
    

Stopping IDS

  1. Open a terminal and use the “su -” command to log in as root or the informix user. (Note: “informix$” is now the command prompt.)
  2. Make sure the settings in /Applications/IBM/informix/demo/server/profile_settings are part of the environment.
  3. Run the commands below. The output should match.
    $ onmode -ky</blockquote>
    $ onstat -</blockquote>
    
    shared memory not initialized for INFORMIXSERVER ‘demo_on’
    

Tags: , , , ,

. 14 Jan 10 | Programming

Reader's Comments

  1. Eric Herber | January 15th, 2010 at 4:09 am

    Nice summary about installing IDS on the MAC. Well done.

    You might also consider this PDF document about installing IDS on the MAC:

    http://www.xmission.com/~dbaresrc/Intro_IDS_on_Mac_v3.pdf

    -Eric

    • Mike | January 15th, 2010 at 9:28 am

      Thank you for the pointer. I am having some difficulty at present getting a JDBC connection to the IDS demo database. I believe some of the information in that PDF may help. That said, I have noticed at least one outdated piece of information (the download location for the Server Admin Tools to get the Workgroup Manager). As I attempt to fix my issues, I will post the updates here.

  2. Informix on a Mac, Part 2 | Practically Agile | January 15th, 2010 at 5:57 pm

    [...] I posted my technique for installing Informix on a Mac. Well, it turns out I wrote just a bit too soon. What I had was indeed working, but only for the [...]

  3. Carlton | January 18th, 2010 at 4:30 pm

    As an FYI, a much more up-to-date installation guide has been available here for some time: http://www.xmission.com/~dbaresrc/Intro_IDS_on_Mac_v3.pdf

    • Mike | January 19th, 2010 at 10:39 am

      Thanks Carlton, this is the same one that Eric mentions above. As I mention in part 2, this is more up-to-date, but still not quite current as far as where to find the latest/most appropriate version of the Mac Server Admin Tools at least.

      A better question is… how do you know where to find these and find out when they are updated? For other folks’ benefit, it seems Carlton is Carlton Dee, the author of a number of books on Informix. Hopefully, he will point us to the place he posts when updates to his install guide happen.

  4. Judy | January 25th, 2010 at 7:02 pm

    A better mac DE installation to point to is here:
    http://www.ibm.com/developerworks/downloads/im/ids/dev.html?S_TACT=105AGX28&S_CMP=DLMAIN

    the one in your link above is to an older version (we need to fix that). The new version has fixes, including those for some of the UID issues you’re finding. thanks!

    • Mike | January 26th, 2010 at 9:32 am

      Glad to hear the issues are being fixed! My previous project used DB2 Express-C on the Mac developer workstations. It did not receive updates that the Windows and other versions did. (Mac is still at version 9.5 while others are at 9.7.)

      For anyone else who happens to read this, what is the recommended way to find the most up-to-date downloads on IBM’s site? Google searches tend to point to apparently out of date resources. Searching the IBM site itself, I tend to end up chasing my tail. I was able to find a relatively simple path to get to the page that Judy mentions without using the direct link:

      • Go to ibm.com and sign in if you are not already
      • Use the top menu to find: Products/Informix
      • Select “Trials and Demos” from the menu on the left
      • Click on “Informix Dynamic Server Enterprise and Developer Editions” in the middle
      • Fill out the form with information that you have had to provide almost every time you access IBM’s site (of course the questions never seem to be quite the same
      • Submit the form and if the redirects work correctly you will be on the page Judy links to.

      That sounds simple enough given the number of products IBM has to support, and you can save a click if on the Informix product page you scroll to the bottom and click the “Trial software: IDS Enterprise and Developer Editions” link in the middle. The problem is really that form step. Let’s say you download what you need, install it and then delete the installer. Someone else wants the download so you go to download it for them. You have to fill the form out again. Better yet, let’s say you see something of potential interest and click on a link before downloading. If you try to navigate back using the same path rather than the back button you have to fill out the form again. Note that this is the case even though you have a logged in account.