Contents IndexAdding and removing SQL Anywhere services Starting and stopping services

User's Guide
   Part III. Using SQL Anywhere
     Chapter 29. Running Programs as Services
      Configuring SQL Anywhere services

A SQL Anywhere service runs a SQL Anywhere database server or other application with a set of command-line switches. For a full description of the command-line switches for each of the SQL Anywhere applications, see the chapter "SQL Anywhere Components" and the SQL Anywhere Network Guide .

In addition to the command-line switches, SQL Anywhere services accept other parameters that specify the account under which the service will run and the conditions under which it will start.

To change the parameters for a SQL Anywhere service:

  1. In Sybase Central, open the Services folder.
  2. Right-click the icon of the service whose parameters you wish to change in the right panel of Sybase Central, and select Properties from the popup menu.
  3. Alter the parameters as needed in the tabs of the Property sheet.
  4. When you have altered the parameters as you wish, click OK to accept and save the changes.

Changes to a service configuration do not take effect immediately. They take effect next time the service is started. The Startup option is applied next time Windows NT is started.

Top of page


Setting the startup option

The following options govern startup behavior for a SQL Anywhere service:

Top of page


Entering command-line switches

The Configuration tab of the service property sheet provides a text box for entering command-line switches for a service. You should enter command-line switches that govern the behavior of the service in this box. You should not enter the name of the program executable in this box.

Examples

The figure illustrates a sample Property sheet.

  The command-line switches for a service are the same as those for the executable. For a full description of the command-line switches for each program, see the chapter "SQL Anywhere Components".

Top of page


Setting the account options

You can choose under which account the SQL Anywhere service will run. Most services run under the special LocalSystem account, and this is the default option for SQL Anywhere services. You can set the service to log on under another account by clicking Account and entering the account information.

If you choose to run the SQL Anywhere service under an account other than LocalSystem, that account must have the "log on as a service" privilege. This can be granted from the NT User Manager application, under Advanced Privileges.

When an icon appears on the taskbar

Whether or not an icon for the service appears on the taskbar or desktop depends on the account that is selected, and whether Allow Service to Interact with Desktop is checked, as follows:

Top of page


Changing the executable file

To change the program executable file associated with a service, click the Configuration tab on the service property sheet and enter the new path and file name in the Path of Executable box.

If you move an executable file to a new directory, you must modify this entry.

Top of page


Adding new databases to a server or engine service

Each SQL Anywhere network server or standalone engine can run more than one database. If you wish to run more than one SQL Anywhere database at a time, we recommend that you do so by attaching new databases to your existing SQL Anywhere service, rather than by creating new services.

To add a new database to a SQL Anywhere service:

  1. Ensure that your SQL Anywhere server is selected in the list of database servers.
  2. Double click to change the parameters for the service.
  3. Add the filename of the new database to the end of the list of parameters.
  4. Click OK to save the changes.

The new database will not be added to the service immediately. It is loaded next time the service is started.

Databases can be started on running servers by client applications, such as ISQL..

  For a description of how to start a database on a server from ISQL, see "START DATABASE statement". For a description of how to implement this function in an Embedded SQL application, see the db_start_database function in the chapter "The Embedded SQL Interface". Starting a database from an application does not attach it to the service. If the service is stopped and restarted, the additional database will not be started automatically.

Top of page


Contents IndexAdding and removing SQL Anywhere services Starting and stopping services