Stopping Servers

Different ways to stop a server.

SERVER OPERATOR system privilege is the default permission level required to stop a server, but you can use the -gk startup option to change the default to ALL or NONE. Setting the permission level to ALL lets all users stop the server; setting the permission level to NONE means that no one can stop the server. In a production environment, only the Server Operator be allowed to stop the database server.

Do not shut down a server while it is still connected to one or more clients. If you try this, you get a warning that any uncommitted transactions will be lost. Disconnect or close all the clients and try again.

Server Shutdown Commands

Several commands shutdown the database server.

Command Description

stop_iq

Shuts down a server completely without regard for users, connections or load process status. Syntax:

stop_iq [ options ] 

dbstop

Stops a server or database. Additional options let you stop a server, even if there are active connections.

Syntax:

dbstop [ options ] server-name 

To use dbstop to stop a server, you must specify a server-name, as well as any connection parameters you specified when you started the server.

STOP ENGINE

STOP ENGINE is a SQL statement that stops a database server.

Syntax:

STOP ENGINE engine-name [ UNCONDITIONALLY ]

The UNCONDITIONALLY argument stops a database server, even if there are client connections to the server.

Server Shutdown Methods

There are several methods to shut down or stop a server.

To stop the server from.. Do this...

Command line

Run the stop_iq or dbstop commands.

Interactive SQL

Run the stop engine command to to stop a named database server.

Stopping Servers in Cron or At Jobs

To use stop_iq in a cron or at job, specify the full path name to the stop_iq executable and the appropriate –stop option:

stop_iq –stop one

Setting –stop one shuts down a single server, when exactly one running server was started by the user ID that starts the cron or at job. This prevents accidentally shutting down the wrong server if several are running.

stop_iq –stop all

Setting –stop all shuts down all servers that were started by the user ID that starts the cron or at job.

Additional Information

  • Reference: Statements and Options > SQL Statements > STOP ENGINE Statement
  • Utility Guide > Stopping the Database Server
  • Administration: Database > Run Database Servers > Database Server Shutdown
Related concepts
Demo Database
Running SAP Sybase IQ Server
Starting and Stopping the Sybase Control Center Agent
Post-Installation Tasks
Related tasks
Running Interactive SQL