Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - Database Administration » Database Administration Utilities

Service utility (dbsvc) for Windows Next Page

Service utility (dbsvc) for Linux

Creates, modifies, and deletes SQL Anywhere services.


dbsvc [ modifier-options ] -d svc

dbsvc [ modifier-options ] -g svc

dbsvc [ modifier-options ] -l

dbsvc [ modifier-options ] -u svc

dbsvc [ modifier-options ] creation-options -w svc details

dbsvc [ modifier-options ] -x svc


full-executable-path [ options ]

Major option Description
-d service-name Removes the named service from the list of services. If you supply -y, the service is deleted without confirmation.
-g service-name Lists the definition of the service.
-l Lists the available SQL Anywhere services.
-u service-name Starts a service named service-name.
-w executable parameters

Creates a new service, or overwrites one if one of the same name exists. If you supply -y, the existing service is overwritten without confirmation.

You must supply parameters appropriate for the service you are creating.


-x service-name Stops a service named service-name.
Creation option Description
-a acct

All services run under a Linux account. If you run under an account you have created, you must name the account with the -a option.

The Login as a Service privilege is required for all accounts other than the daemon account.

-as All services run under a Linux account. When -as is specified, the service runs under the Linux daemon account. No password is required. One of -a or -as must be used.
-t type Specifies the type for this service. You can choose from the following types:

The default setting for all service types is Standalone.

Modifier option Description
-cm Displays the command used to create the service. This option can be used to output the creation command to a file, which can then be used to add the service on another computer or restore a service to its original state if changes have been made to it. You must specify the -g option or -l option with -cm or the command fails. Specifying -g displays the creation command for the specified service, while specifying -l displays the creation command for all services.
-q Suppress messages to the console. If you specify this option when modifying or deleting an existing service, you must also specify -y or the operation will fail.
-y Automatically performs the action without prompting for confirmation. This option can be used with the -w or -d options. If you specify -q when modifying or deleting an existing service, you must also specify -y or the operation will fail.
Linux-specific optionsDescription
-odSpecify the location of the system information file (if required).
-prSet the nice level for the Linux process.
-rlSpecify the runlevels on which to start the service.

Specify service dependencies when creating a service.

All the services in the list must have started before the service being created is allowed to start. Linux services are dependent on base services. For example, if service A relies on service B, and service B relies on service C, SQL Anywhere does not attempt to start service C.

-statusReturn the state the service is running.

A service runs a database server or other application with a set of options. This utility provides a comprehensive way of managing SQL Anywhere services on Linux.

Because services typically run in a different environment, it is recommended that you fully qualify the name of the database file when creating a service. It is recommended that you do not use spaces in data source names.

Like most Linux services, the dbsvc utility creates service files in /etc/init.d. The naming convention for the service is SA_service-name. For example, if you created a service named SA_myserv, you could issue the following command to start the service:

/etc/init.d/SA_myserv start

The following command gets the status of the service:

/etc/init.d/SA_myserv status

The following command returns usage information for the service:


Create a personal server service called myserv, which starts the specified server with the specified parameters. The server runs as the LocalSystem user:

dbsvc -as -w myserv -n myeng -c 8m "/tmp/demo.db"

Create a network server service called mynetworkserv. The server runs under the local account, and starts automatically when the computer is restarted:

dbsvc -as -t network -w mynetworkserv -x tcpip -c 8m "/tmp/demo.db"

List all details about service myserv:

dbsvc -g myserv

Delete the service called myserv, without prompting for confirmation:

dbsvc -y -d myserv

Create a service called mysyncservice:

dbsvc -as -t dbmlsync -o syncinfo.txt -w mysyncservice -c "/tmp/CustDB.db"

Generate the command to create the service_1 service and output it the console:

dbsvc -cm -g service_1

The console contains the following:

'dbsvc -t Standalone -as -y -w "service_1" -n'

Start a service using dbsvc:

dbsvc -u myserv

Use dbsvc to stop a service:

dbsvc -x myserv

Use dbsvc to obtain the status of a service:

dbsvc -status myserv