Creating multiresident database servers (UNIX, Linux, Mac OS X)

You can set up multiple independent database server environments on the same computer.

Before you set up multiple residency, you must install one database server.
Important: You are not required to install more than one copy of the database server binary files. All instances of the same version of the database server on one computer can share binary files.

To create multiple residency of a database server:

  1. Prepare a new configuration file and set the ONCONFIG environment variable to the new file name.
  2. Set up connectivity for the new database server instance.
  3. Initialize disk space for the new database server instance.
  4. Prepare the backup environment for multiple residency.
  5. Modify the operating system start to start the new database server instances automatically.
  6. Check the INFORMIXSERVER environment variables for users.

Prepare a new configuration file

Each instance of the database server must have its own onconfig configuration file.

To set up an instance-specific onconfig file:
  1. Make a copy of an onconfig file that has the basic characteristics that you want for your new database server.
  2. Give the new file a name that you can easily associate with its function. For example, you might select the file name onconfig.acct to indicate the configuration file for a production system that contains accounting information.
  3. Set the ONCONFIG environment variable to the file name of the new onconfig file. Specify only the file name, not the complete path.
  4. In the new configuration file, set the following configuration parameters:
    SERVERNUM
    Specifies an integer 0 - 255 that is associated with a database server configuration. Each instance of a database server on the same host computer must have a unique SERVERNUM value.
    DBSERVERNAME
    Specifies the database server name of a database server. You can provide a useful name for the database server, such as ifx12test or hostnameifx12test.
    MSGPATH
    Specifies a unique path and name of the message file for a database server. If multiple database servers use the same MSGPATH parameter, you cannot identify the messages from separate database server instances. For example, if you name the database server ifx12test, you might specify /usr/informix/ifx12test.log as the message log for this instance of the database server.
    ROOTPATH and ROOTOFFSET
    Used together, specify the location of the root dbspace for a database server. The root dbspace location must be unique for every database server configuration.

If you put several root dbspaces in the same partition, you can use the same value for the ROOTPATH configuration parameter. However, in that case, you must set the ROOTOFFSET configuration parameter so that the combined values of the ROOTSIZE and ROOTOFFSET configuration parameters define a unique portion of the partition.

You are not required to change the value of the ROOTNAME configuration parameter. Even if both database servers have the name rootdbs for their root dbspace, the dbspaces are unique because each ROOTPATH configuration parameter specify a unique location.

You can also set the MIRRORPATH and MIRROROFFSET parameters. If the root dbspace is mirrored, the location of the root dbspace mirror must be unique for each database server.

Set up TCP/IP connectivity

If you use the TCP/IP communication protocol, you might be required to add an entry to the services file for the new database server instance.

The sqlhosts file must have an entry for each database server. If Informix® products on other computers access this instance of the database server, the administrators on those computers must update their sqlhosts files.

If you plan to use Internet Protocol network connections with an instance of a database server, the system network administrator must update the hosts and services files.

Initialize disk space

Before you initialize disk space, check the setting of the ONCONFIG environment variable. If it is not set correctly, you might overwrite data from another database server. Initializing disk space deletes all existing user data and tracking information in the root dbspace. When you initialize disk space for a database server, the database server initializes the disk space that is specified in the current configuration file.
Important: As you create new blobspaces or dbspaces for a database server, assign each chunk to a unique location on the device. The database server prevents you from assigning more than one chunk to the same location within a single database server environment, but you must ensure that chunks that belong to different database servers do not overwrite each other.

To initialize disk space:

  • UNIX, Linux, Mac OS X: Run the oninit -i command.
  • Windows: In the database server properties dialog box from the Services application, add -i in the Start Parameters field and click Start.

Prepare the backup environment for multiple residency

Depending on your backup method, you must prepare the backup environment for multiple residency:

  • If you use the ON-Bar utility, you can back up data from various database server instances to a single storage device if the storage manager allows it. The storage manager tracks what data is backed up. However, keep storage-space and logical-log backups on separate storage devices. A best practice is to keep storage-space and logical-log backups on separate storage devices.
  • If you use the ontape utility, you must maintain separate storage space and logical log backups for each database server instance. If you can dedicate a tape drive to each database server, use the continuous logging option to back up your logical log files. Otherwise, you must plan your storage space and logical log backup schedules carefully so that use of a device for one database server instance does not cause the other database server instance to wait. You must reset the ONCONFIG environment variable every time that you switch backup operations from one database server instance to the other.

Modify operating system start for multiple server instances

You can ask your system administrator to modify the system start script so that each of your database server instances starts whenever the computer is rebooted; for example, after a power failure.

To start a second instance of a database server, change the ONCONFIG and INFORMIXSERVER environment variables to point to the configuration file for the second database server and then run the oninit command. Do not change the values of the INFORMIXDIR or PATH environment variables.

Similarly, you can ask the system administrator to modify the shutdown script so that all instances of a database server shutdown normally.

Reset the INFORMIXSERVER environment variable

If you want the new instance of a database to be the default database server, you must reset the INFORMIXSERVER environment variable.