The preferred ways to stop the database server are:
In Sybase Central (either UNIX or Windows), right-click the server name and choose Stop from the dropdown menu.
To shut down servers in an IQ multiplex, open the Multiplex folder, right-click the write server, and choose Server > Stop. You may then choose which server(s) to stop. Click Finish.
In UNIX, use the stop_asiq utility at the operating system command line. For details, see “Example — Stop a server with stop_asiq”.
When you run stop_asiq, it displays the following message:
"Please note that 'stop_asiq' will shut down a server completely without regard for users, connections, or load process status. For more control, use the 'dbstop' utility, which has options that control stopping servers based on active connections."
In Windows, click Shutdown on the database server display or right-click the IQ icon in the system tray and select Exit.
In Windows, if the server is run as a service, open the Service Manager in Control Panel. Select the service and click Stop.
Normally, you should 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.
You can also stop the database server in the following ways:
At the operating system command line, issue the DBSTOP command with appropriate parameters. Use the same parameters as when you started the server. Without the proper connection parameters DBSTOP doesn't know how to connect to the server to tell it to shut down. For details on using DBSTOP, see Chapter 1, “Running the Database Server” in the Sybase IQ Utility Guide.
In a DBISQL window or command file, issue the STOP ENGINE command to stop a named database server.
In UNIX, in the window where the database server was started, type:
q
This command does not work if you have redirected input to a different device.
In a UNIX cron or at job, use stop_asiq with the appropriate -stop option. The utility stops one or all servers associated with the user who starts the cron or at job depending on the parameter specified. The user must be the same one who started the server. No operator prompting occurs, and no operator action is required.
To use stop_asiq in such jobs, specify the utility with the appropriate -stop option:
stop_asiq -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.
stop_asiq -stop all
Setting -stop all shuts down all servers that were started by the user ID that starts the cron or at job.
You must specify the full pathname to the stop_asiq executable in the cron statement.
The following example uses the stop_asiq utility in a UNIX operating system command line to shut down an Sybase IQ server and close all user connections to it.
When you issue the stop_asiq command, Sybase IQ lists all the servers owned by other users, followed by the server(s) you own. It then asks if you want to stop your server. For example:
% stop_asiq
Checking system for ASIQ 12 Servers ... The following 3 server(s) are owned by other users. ## Owner PID Started CPU_Time -- --------- ----- -------- -------- ----------------------- hsin 19895 Mar.21 1:33 start_asiq -c 32m -gd all -gl all -gm 10 -gn 25 -gp 4096 -ti 4400 -n hsin -x tcp qadaily 24754 01:25:07 1286:53 start_asiq -gn 25 @/exp1/new.cfg asiqdemo.db -o /exp1/qa wb 28350 Apr.11 0:20 start_asiq -gn 25 @asiqdemo.cfg -o /exp1/wb/mysybase12/asiq1 The following 1 server(s) are owned by ’janed’ ## Owner PID Started CPU_Time -- --------- ----- -------- -------- ----------------------- 1: janed 2838 15:11:37 0:07 start_asiq -c 32m -gd all -gm 10 -gn 25 -gp 4096 -ti 4400 -tl 300 @asiqdemo.cfg -- Please note that ’stop_asiq’ will shutdown a server completely without regard for users connections or load processes status. For a finer level of detail the utility ’dbstop’ has the options to control whether a server is stopped based on active connections. Do you want to stop the server displayed above <Y/N>?
To shut down the server, type Y
(yes).
Messages like the following display:
Shutting down server (2838) ... Checkpointing server (2838) ... Server shutdown.
To leave the server running, type N
(no).
You return to the system prompt and IQ does not shut down the server.
If no running servers were started by your user ID, Sybase IQ displays information about servers run by other users, then a message like the following:
There are no servers owned by 'janed'
The following example stops a server from DBISQL:
STOP ENGINE Ottawa UNCONDITIONALLY
The optional keyword UNCONDITIONALLY specifies that the database server will be stopped even if there are connections to it.
You can stop a server from DBISQL if you are connected as DBA to one of the databases running on that server (including the utility_db database), or if the server was started with the -gk ALL option.