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

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - Database Administration » SQL Anywhere database connections » SQL Anywhere database servers » Starting and stopping databases

 

Stopping a database after disconnecting (SQL)

To stop a database you are connected to, you must disconnect from it, and then stop it using the STOP DATABASE statement. Databases started with the AUTOSTOP connection parameter automatically stop when the last user disconnects.

Prerequisites

By default, you must have the SERVER OPERATOR system privilege. The required privileges can be changed by using the -gd database server option.

You must be connected to another database on the same database server to stop a database.

 Task
  1. Make sure you are connected to another database on the same database server. If there is no other database running on the database server, you can connect to the utility database.

  2. Execute a STOP DATABASE statement.

Results

The database is stopped.

Example

The following statements connect to the utility database and stops the tempdb database.

CONNECT to 'TestEng' DATABASE utility_db
AS conn2
USER 'DBA'
IDENTIFIED BY 'sql';
STOP DATABASE tempdb;

 See also