Stops a database or database server.
dbstop [ options ] [ server-name ]
Option | Description |
---|---|
@data |
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). |
-c "keyword=value; ..." |
Specifies a connection string. When stopping a network server, the connection string must include a user ID that has permissions to stop the server. By default, DBA authority is required on the network server, and all users can shut down a personal server, but the -gk server option can be used to change this. If you supply connection parameters, do not supply a server name as well. See Connection parameters, Unconditional (UNC) connection parameter, and -gk dbeng12/dbsrv12 server option. |
-d | Does not stop the database server. Instead, only stop the database specified in the connection string. The -gd server option controls the permissions required to stop a database file. See -gd dbeng12/dbsrv12 server option. |
-o filename | Writes output messages to the named file. |
-q | Runs in quiet mode—messages are not displayed. |
-x | Does not stop the server if there are still active connections to the server. Including this option prevents dbstop from prompting for confirmation if there are active connections. |
-y | Stops the server even if there are still active connections to the server. This is equivalent to including Unconditional=YES in the connection parameters. |
server-name |
Specifies the name of a database server running on the current computer. The database server must be started so that no permissions are required to shut it down. The personal database server starts in this mode by default. For the network database server, you must supply the -gk all option. See -gk dbeng12/dbsrv12 server option. If you supply a server name, do not supply connection parameters as well. |
The Stop Server utility stops a database server. You can use the -d option to stop a specified database.
The Stop Server utility can only be run at a command prompt. In windowed environments, you can stop a database server by clicking Shut Down on the database server messages window.
Options let you control whether a server is stopped, even if there are active connections, and whether to stop a server or only a database.
The behavior of dbstop can be controlled if there are active connections on a server. If there are active connections, dbstop provides a prompt asking if you want to shut down the server. The -x and -y options can be used to change this behavior.
If dbstop is able to stop the database server, dbstop does not complete until all databases have stopped running, and the database server has been stopped enough so that another server could be started with the same name and databases. When dbstop successfully completes, the database server process may still be running, and some of its resources, such as the output file specified by the -o server option, may still be in use.
Exit codes are 0 (success) or non-zero (failure).
If you want to use the SQLCONNECT environment variable with dbstop, you should specify the -c option. Otherwise, you can get unexpected results.
You are running the server named myserver without a database. To stop the server, specify the utility database as a DatabaseName (DBN) connection parameter:
dbstop -c "UID=DBA;PWD=sql;Server=myserver;DBN=utility_db" |
You are running the server named myserver with the database demo.db started. To stop the server and database:
dbstop -c "UID=DBA;PWD=sql;Server=myserver" |
You are running a personal server named myserver. To stop the server and databases even if there are connections:
dbstop -y myserver |
You are running a server named myserver with the database demo.db. To stop only the database named demo, but not other databases or the server itself, run the following command:
dbstop -c "UID=DBA;PWD=sql;Server=myserver;DBN=demo" -d |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |