Making IDS start automatically when the machine is started can be a little more challenging as you need to edit the /etc/rc.d files to set the environment and launch oninit.
On Windows IDS is designed to run as a Windows service and there are more ways to start it. At least making IDS start automatically is easier, just locate the IDS service in Control Panel->Administrative Tools->Services and modify the Properties to set Startup Type to Automatic. Another good thing is that for most startup methods, there is no need to set the environment.
Here's a look at the methods of manually starting IDS on Windows and their relative merits:
- Control Panel->Administrative Tools->Services
The GUI method - fine for starting manually with GUI access to the machine.
net start %INFORMIXSERVER%
The standard command line method for starting a Windows service. Disadvantage: doesn't let you pass command line arguments to oninit.
Does what net start does but allows oninit command line arguments. For example to bring an IDS instance to quiscent mode:
starts %INFORMIXSERVER% -s
Run oninit from the command line.
The oninit.exe process can be launched in foreground by setting the IDS environment and running oninit directly. Unlike on UNIX where it will fork and return you to the command prompt, it will run in foreground and not return the DOS prompt to the command line. Generally this is not recommended but can be useful when:
1. Troubleshooting a problem with the IDS service - sometimes if the IDS service won't start, launching oninit in foreground can help eliminate possible causes - for example if the IDS Service informix user password is set incorrectly.
2. Launching IDS in a relative directory to run HDR between two instances on the same machine (see an earlier post).
Update June 9 '06:Run oninit.exe from a command shell in background.
I hadn't thought about this method until I saw a comp.databases.informixthread that mentioned it. If you start a command shell as informix (or use runas) and run start /b oninitthe oninit.exe process will be launched in a background command window. This is a way to see verbose output from oninit, but still keep the process running in background. Because it's not running as a Windows service, oninit will not get its environment from the HKEY_LOCAL_MACHINE/Software/Informix/Online/%INFORMIXSERVER%/Environment registry key but from the user's environment. This is not necessarily a disadvantage as long as it is understood - in fact sometimes it can be an advantage. The only inconvenience is the need to be the informix user when you run it. You could work around this by wrapping it in a runas script like this:
runas /env /user:informix "start /b oninit"
I typically use the starts method. For example the following batch file shuts down and re-starts IDS (assumes you have a gnu, Cygwin or equivalent tool like sleep installed), and takes command line arguments:
onmode -yksleep 4starts %INFORMIXSERVER% %*