Creating multiresident database servers (UNIX, Linux)
You can set up multiple independent database server environments on the same computer.
To create multiple residency of a database server:
- Prepare a new configuration file and set the ONCONFIG environment variable to the new file name.
- Set up connectivity for the new database server instance.
- Initialize disk space for the new database server instance.
- Prepare the backup environment for multiple residency.
- Modify the operating system start to start the new database server instances automatically.
- 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.
- Make a copy of an onconfig file that has the basic characteristics that you want for your new database server.
- 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.
- Set the ONCONFIG environment variable to the file name of the new onconfig file. Specify only the file name, not the complete path.
- 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 HCL® OneDB® 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
To initialize disk space:
- UNIX™, Linux™: 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.