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 ]
Reads in options from the specified environment variable or configuration file. See Configuration files.
If you want to protect passwords or other information in the configuration file, you can use the File Hiding utility to obfuscate the contents of the configuration file. See File Hiding utility (dbfhide).
|-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, not including the password.|
|-l||Lists the available SQL Anywhere services.|
|-u service-name||Starts the 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 the full path to the executable that you want to use as a service, as the account under which the service is running may not have the appropriate SQL Anywhere installation directory in its path.
You must supply parameters appropriate for the service you are creating.
|-x service-name||Stops the service named service-name.|
Names the Microsoft Windows account. All services run under a Microsoft Windows account. If you run under an account you have created, you must name the account with the -a option and supply a password with the -p option.
The Login as a Service privilege is required for all accounts other than the LocalSystem account. If an account does not have the Login as a Service privilege enabled, you are prompted to enable it. If the -y option is also specified, dbsvc attempts to grant the Login as a Service privilege without prompting you. If the -q option is specified without the -y option, you are not prompted to grant the Login as a Service privilege and dbsvc fails.
|-as||Runs the service under the Microsoft Windows LocalSystem account. No password is required. One of -a or -as must be used. All services run under a Microsoft Windows account.|
|-i||Displays an icon that you can double-click to display the database server messages window.|
|-p||Specifies the password for the account under which the service runs. Use this option with the -a option.|
|-rg dependency,...||Specifies one or more load ordering groups that must be started before the service being created is allowed to start.|
Specifies that all the services in the list must have started before the service being created is allowed to start.
You can specify the display name or the service name. Service names are verified to see if they already exist. If the specified service name cannot be found, the Service utility (dbsvc) checks to see if there is a service with a matching display name.
It is recommended that you create a dependency on the Transport Data Interface (TDI) for TCP/IP to ensure that the connection starts correctly. For more information about the TDI, see http://msdn.microsoft.com/en-us/library/ms797340.aspx.
|-s startup||Sets startup behavior for SQL Anywhere services. You can set startup behavior to Automatic, Manual, or Disabled. The default is Manual.|
|-sd description||Provides a description of the service. The description appears in the Windows Service Manager.|
Provides a name for the service. This name appears in the Windows Service Manager. If you do not specify the -sn option, the default service name is SQL Anywhere - svc. For example, the following service is named SQL Anywhere - myserv by default.
To have the service name myserv appear in the Windows Service Manager, you need to run the following (entered all on one line):
Specifies the type for this service. You can choose from the following types (the alternate name is listed in parentheses):
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.
If the specified service does not exist, the command to delete the service is generated. For example, if service_1 does not
exist on the computer,
If the service does not use the LocalSystem account, there is no way to retrieve the password, so it is not included in the
command that is generated. If you created the service with
Writes output from the Service utility (dbsvc) to the specified file. The -o option must be specified before the -d, -g, -l, -u, and -x options. When you specify the -o option for both dbsvc and for the executable that you are running as a service (for example, the database server), log files are created for both. For example:
In this case, the output from dbsvc is logged to out1.txt, while the output from the database server is logged to c:\out2.txt.
|-q||Suppresses messages to the database server messages window. If you specify -q, it is also recommended that you specify a file where messages are logged using the -o option. 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.|
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 Windows. You must be a member of the Administrators group on the local computer to use the Service utility (dbsvc).
You can access the Service utility in the following ways:
From Sybase Central, using the Create Service Wizard.
At a command prompt, using the Service utility (dbsvc).
Exit codes are 0 (success) or non-zero (failure).
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 "C:\Program Files\SQL Anywhere 12\Bin32\dbeng12.exe" -n myeng -c 8m "c:\temp\mysample.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 -s auto -t network -w mynetworkserv "C:\Program Files\SQL Anywhere 12\Bin32\dbsrv12.exe" -x tcpip -c 8m "c:\temp\mysample.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 dependent on the Workstation service and the TDI group:
dbsvc -rs lanmanworkstation -rg TDI -w ...
Create a service called mysyncservice:
dbsvc -as -s manual -t dbmlsync -w mysyncservice "C:\Program Files\SQL Anywhere 12\Bin32\dbmlsync.exe" -c "SQL Anywhere 12 CustDB"
Generate the command to create the service_1 service and output it to a file called restoreservice.bat:
dbsvc -cm -g service_1 > restoreservice.bat
The restoreservice.bat file contains the following:
dbsvc -t Standalone -s Manual -as -y -w "service_1" "C:\Program Files\SQL Anywhere 12\Bin32\dbeng12.exe"
Create a MobiLink listener service that is started manually:
dbsvc -as -i -w myListener "C:\Program Files\SQL Anywhere 12\Bin32\dblsn.exe" "@c:\temp\dblsn.opt"
Start the myListener service:
dbsvc -u myListener
Stop the myListener service:
dbsvc -x myListener
Create a Volume Shadow Copy Service (VSS) service that is started automatically when the database server starts:
dbsvc -as -s Automatic -t vss -w SAVSSWriter "C:\Program Files\SQL Anywhere 12\Bin32\dbvss12.exe"
Discuter à propos de cette page dans DocCommentXchange.
|Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1|