<< Click to Display Table of Contents >> Running the database server as a service |
|
The Dispatch database server can be run as a service on Windows computer which supports services (currently NT, 2000 and XP).
Advantages of services
Running the database server as a Windows service enables it to run without having to log on to the computer. This is especially useful when the database server is going to be accessed over a network connection.
Creating a service
A command lime utility, dbsvc, is provided to simplfy the creation of services. You must be a member of the Administrators group on the machine on which the service is to run to use the dbsvc to create a database service.
Syntax
dbsvc [ options ] <svc>
dbsvc [-q] [-y] -d <svc>
dbsvc [-q] -g <svc>
dbsvc [-q] -l
dbsvc [-q] [-y] <creation options> -w <svc> <details>
Exit codes are 0 (success) or non-zero (failure).
Options
Option |
Description |
-a acct |
Account name to use (used with -p) |
-as |
Use local system account |
-d |
Delete a service |
-I |
Allow service to interact with desktop |
-g |
Get details of a service |
-l |
List all Adaptive Server Anywhere services |
-p |
Password for account (used with -a) |
-q |
Do not print banner |
-rg dependency,... |
Specify group dependencies when creating a service |
-rs dependency,... |
Specify service dependencies when creating a service |
-s startup |
Startup option (default manual). You must specify automatic, manual, or disabled |
-t type |
Type of service |
-y |
Delete or overwrite service without confirmation |
-w executable parameters |
Create write service |
Examples
Create a personal server service called Dispatch1Service which starts the specified engine with the specified parameters. The engine runs as the LocalSystem user:
dbsvc -as -i -s auto -w Dispatch1Service "C:\Program Files\Sybase\SQL Anywhere 8\win32\dbeng8.exe" -n Dispatch1 -c 8m "C:\ASA80\dsptch15\dsptch15.db"
Create a network server service called Dispatch1Service. The server runs under the local account, and starts automatically when the machine is booted:
dbsvc -as -i -s auto -t network -w Dispatch1Service "C:\Program Files\Sybase\SQL Anywhere 8\win32\dbsrv8.exe" -n Dispatch1_Server -x tcpip -c 8m "C:\ASA80\dsptch15\dsptch15.db"
List all details about service Dispatch1Service:
dbsvc -g Dispatch1Service
Delete the service called Dispatch1Service, without prompting for confirmation:
dbsvc -y -d Dispatch1Service
Service creation utility options
Option |
Description |
||||||
Account name (-a) |
All services run under a Windows account. If you run under an account you've created, you must name the account with the -a option and supply a password with the -p option. |
||||||
Use local system account (-as) |
All services run under a Windows account. Using the -as option, the service will run under a Windows account. No password is required. |
||||||
Delete a service (-d) |
Removes the server name from the list of services. If you supply -y, any service is deleted without confirmation. |
||||||
|
|
||||||
Allow service to interact with desktop (-i) |
Displays an icon that you can double-click to display the server window. |
||||||
Get details of a service (-g) |
Lists the definition of the service, not including the password. |
||||||
Allow service to interact with desktop (-i) |
Displays an icon that you can double-click to display the server window. |
||||||
List all Adaptive Server Anywhere services (-l) |
Lists the definition of the service, not including the password. |
||||||
Password for account (-p) |
Use this option with the -a option to specify the password for the account the service runs under. |
||||||
Do not print banner (-q) |
Suppress the informational banner. The -q option can be used with any of the -d, -g, -l, or -w options. |
||||||
Set group dependencies (-rg) |
At least one service from each of the groups in the list must be started before the service being created is allowed to start. |
||||||
Startup option (-s) |
Sets startup behavior for Adaptive Server Anywhere services. You can set startup behavior to Automatic, Manual, or Disabled. |
||||||
Type of service (-t type) |
Specifies the executable to run for this service. You can choose from the following types:
The default setting is Standalone. If creating a service, you must specify options for the appropriate executable along with the type. |
||||||
Create service (-w) |
Creates a new service, or overwrites one if one of the same name exists. If you supply -y, any existing service is overwritten without confirmation.
You must supply the full path to the executable that you wish to use as a service, as the account under which the service is running may not have the appropriate SQL Anywhere directory in its path. |
||||||
Delete or overwrite service without confirmation (-y) |
Automatically carries out the action without prompting for confirmation. This option can be used with the -w or -d options. |