The preferred ways to stop the database server are:
In Sybase Central (either UNIX or Windows), right-click the server name and choose Stop Server.
To shut down servers in an IQ multiplex, open the Multiplex folder, right-click the server that needs to be stopped and choose Control > Stop.
In UNIX, use the stop_iq utility at the operating system command line. For details, see “Example — Stop a server with stop_iq”.
When you run stop_iq, it displays the following message:
"Please note that 'stop_iq' 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 does not 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 Utility Guide.
In a dbisql window or command file, issue the STOP ENGINE command to stop a named database server.
In a UNIX cron or at job, use stop_iq 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_iq in such jobs, specify the utility with 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.
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.
You must specify the full path name to the stop_iq executable in the cron statement.
The following example uses the stop_iq 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_iq 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_iq
Checking system for IQ 15 Servers ... The following 2 server(s) are owned by other users. ## Owner PID Started CPU_Time Additional Information -- ----- ----- -------- -------- ----------------------- handari 19895 15:43:44 183:38 start_iq @iqdemo.cfg iqdemo.db -gn 105 -o /server1/users/surya/IQ-15_0/logfiles/surya_ibm2.001.srvlog -hn 8 pamela 409802 18:05:02 0:05 SVR:ibm1_iqdemo2 DB:iqdemo PORT:2678/ibm1/users/sybase/iq151/IQ-15_2/bin64/iqsrv15 @iqdemo.cfg iqdemo.db -ti 4400 -gn 25 -o /ibm1/users/sybase/iq151/IQ 15_2/logfiles/ibm64qa_iq The following 1 server(s) are owned by 'kermit' ## Owner PID Started CPU_Time Additional Information -- --------- ----- -------- -------- ----------------------- 1: kermit 422034 15:11:37 0:07 SVR:myserver_iqdemo DB:iqdemo PORT:2638 /myserver/users/sybase/iq151/IQ-15_2/bin64/iqsrv15 @iqdemo.cfg iqdemo.db -ti 4400 -gn 25 -o /myserver/users/sybase/iq151/IQ- 15_2/logfiles/myserver_iq start_iq -c 32m -gd all -gm 10 -gn 25 -gp 4096 -ti 4400 -tl 300 @iqdemo.cfg -- Please note that 'stop_iq' will shut down a server completely without regard for users connections or load processes status. For more control, use the 'dbstop' utility, which has options that control stopping servers 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 (422034) ... Checkpointing server (422034) ... 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 'kermit'
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.