Installing Sybase IQ as a Service

You can use the Add Service utility to install Sybase IQ as a Windows Service. This enables you to start a Sybase IQ server automatically whenever the machine is booted, or to start and stop previously installed IQ Services using the Services dialog from Control Panel. The Add Service utility is ASIQservice.exe under %ASDIR%/win32.

NoteTo use Sybase IQ as a Windows service when raw device access is required, the user must grant the service Administrator privilege. For instructions, see “Granting Administrator privilege to the Sybase IQ service” on page §.

To run Add Service, use Start > Programs > Sybase > Adaptive Server IQ 12.6 > Sybase IQ Service Manager. You can also run it from Sybase Central by double-clicking Add Service in the Utilities folder.

StepsCreating a new service

  1. Choose Create a New Service.

  2. Type the name you want to assign your new service.

  3. Type any start-up parameters you need. Be sure to include the full path in the database file name. The server cannot start without a valid database path name. For an example of start-up parameters, see %ASDIR%\asiq12\demo\asiqdemo.cfg.

  4. Click Apply and then OK.

    The next time you start the Add Service utility, the newly created service is listed. If there are any previously created IQ services, they are also listed. If you select any one of them, you can choose Modify an Existing Service or Delete an Existing Service. These options are dimmed if there is no existing service.

NoteCopy input files for loading your databases into the directory where the service starts, not where the database files are. On most systems, the services start-up defaults to the WINNT\system32 directory.

Starting multiplex servers

When you start multiplex servers, remember that for full data replication functionality they require the dbremote utility to run on the write server. Sybase provides shell scripts in the write server database directory to start dbremote for each server in the multiplex. There is currently no service mechanism to start these processes automatically; this is up to the user. For example, a DBA can add an entry in the Windows registry so that these processes start as soon as the DBA logs into the system, as described in the next section.

Note that dbremote is required only for version information replication and servers are still viable without it. The write server, however, will not drop old versions of tables in IQ Main because it will not know that query servers have stopped using them.

Setting up dbremote in the Registry Editor

Follow this procedure to start a dbremote process the next time the user (for example, the Administrator) logs in.

StepsStarting a dbremote process automatically

  1. To run the Registry Editor, enter the following at the command prompt:

    regedit
    
  2. Right-click HKEY_Current_User\Software\Microsoft\Windows\CurrentVersion\Run

  3. From the drop-down menu, select New > String Value.

  4. Type a name for your dbremote start-up process. For example: write_server_dbremote

  5. Select the string value. Type Value data in the Edit String dialog box. For example: m:\mpx_test\write_server54\start_dbr_write_server54.bat

Suppressing Windows event log messages

If you run the database server as a Windows service, you can suppress event log entries by setting a registry entry. The registry entry is Software\Sybase\Adaptive Server Anywhere\9.0.

To control event log entries, set the EventLogMask key, which is of type REG_DWORD. The value is a bit mask containing the internal bit values for the different types of event messages:

errors EVENTLOG_ERROR_TYPE 0x0001
warnings EVENTLOG_WARNING_TYPE 0x0002
information EVENTLOG_INFORMATION_TYPE 0x0004

For example, if the EventLogMask is set to zero, no messages appear at all. A better setting would be 1, so that informational and warning messages do not appear, but errors do. The default setting (no entry present) is for all message types to appear.

Granting Administrator privilege to the Sybase IQ service

To use Sybase IQ as a Windows service when raw device access is required, you need to grant the Sybase IQ service Administrator privilege.

StepsGranting Administrator privilege to the Sybase IQ service

  1. Select Control Panel > Administrative Tools > Services.

  2. Select the Sybase IQ service from the service list and click Startup.

  3. On the Service dialog window, select the Automatic option under Startup Type, if not already selected.

  4. Under Log On As, select the This account option button. Enter the user name to an account with Administrator privilege and type the password.

  5. Click OK when you finish assigning the administrator.

  6. Click Close inside the Services dialog to close the dialog window.