Creates, modifies, and deletes SQL Anywhere services.
dbsvc [ modifier-options ] -d svc
dbsvc [ modifier-options ] -g svc
dbsvc [ modifier-options ] -l
dbsvc [ modifier-options ] -status svc
dbsvc [ modifier-options ] -u svc
dbsvc [ modifier-options ] creation-options -w svc [ options ]
dbsvc [ modifier-options ] -x svc
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 cannot delete a service while it is running. You must supply parameters appropriate for the service you are creating. See:
|
-x service-name | Stops a service named service-name. |
Creation option | Description |
---|---|
-a acct | Names the account. 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. |
-as | Runs the service under the Linux daemon account. All services run under a Linux account. No password is required. One of -a or -as must be used. |
-od | Specifies the location of the system information file (if required). |
-pr | Sets the nice level for the Linux process. |
-rl | Specifies the runlevels on which to start the service. |
-rs service-name |
Adds the service to the list of services in the Required-Start header of the init script generated by dbsvc. This header helps the operating system determine the order in which it starts services. Specified service names are verified to see if they already exist. The naming convention for the service is SA_service-name. |
-s | Sets the startup behavior for SQL Anywhere services. You can set startup behavior to Automatic or Manual. The default is Manual. |
-status | Returns the state the service is running. |
-t type |
Specifies the type for this service. You can choose from the following types (the alternate name is listed in parentheses):
|
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 | Suppresses messages to the database server messages window. If you specify this option when modifying or deleting an existing service, you must also specify -y or the operation fails. |
-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. |
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 also recommended that you do not use spaces in data source names.
You must have permissions on the /etc/init.d directory to create, edit, or delete services.
When a SQL Anywhere service is running on Linux, a PID file is created in the /var/run directory. This file contains the PID of the dbsvc process. The file is named SA_service-name.pid. This file can be used by other Linux tools to find the process and monitor the service.
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 myserv, you could issue the following command to start the service:
/etc/init.d/SA_myserv start |
The following command returns the status of the service:
/etc/init.d/SA_myserv status |
The following command returns usage information for the service:
/etc/init.d/SA_myserv |
If your dbsvc command contains characters that are special to the shell (such as semicolons or parentheses), it is recommended that you use a configuration file for the parameters to your service. See Configuration files.
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 -w mysyncservice -c "/tmp/CustDB.db" -o syncinfo.txt |
Generate the command to create the service_1 service and output it to 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 |
Stop a service using dbsvc:
dbsvc -x myserv |
Obtain the status of a service using dbsvc:
dbsvc -status myserv |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |