Stopping the server

Stop utility syntax

To stop the server, run the stop_asiq utility, using the following command format:

stop_asiq [ -agent | -cleanup | -stop [one | all ] | -help ]

Switches

Table 1-6: Switches for stop_asiq utility

Parameter

Purpose

-agent

Stops the ASIQ Agent on UNIX or Linux systems

-cleanup

Kills the orphan ASIQ process on Linux

-stop [one | all]

Removes user interaction with stop_asiq. Assumes “Y” response to all questions.

-help

Displays stop_asiq syntax and switches

Example on stopping the server

To stop a server, run the stop_asiq command, for example:

stop_asiq
Checking system for ASIQ 12 Servers ...The following 2 server(s) are owned by 'rsmith' ##     Owner    PID   Started  CPU_Time -- ---------  -----  --------  -------- 1:   rsmith   4378  10:34:42      0:04 start_asiq -gn 25 @asiqdemo.cfg asiqdemo.db -o /c--2:   rsmith   4726  10:41:09      0:04  start_asiq -gn 25 @jd_banking.cfg jd_banking.db -o /c--Please note that ’stop_asiq’ will shutdown a server
completely without regard for users, connections or load
process status. For a finer level of detail the utility
’dbstop’ has the options to control whether a server is stopped based on active connections.
Enter the server to shutdown (’1’...’2’) or ’Q’ to Quit:
2
Shutting down server ...Checkpointing server ...............Server shutdown

Managing processes

On RedHat 2.1 (Linux kernel 2.4.9), each thread is listed as a process. Output from the ps command may list a single process dozens to hundreds of times. Linux users can use ps -efw to generate wide format output. Even with extended output lines, it may still be difficult to identify a single process from the display. The stop_asiq -agent command lets you stop the IQ Agent on your Unix or Linux system. This is compatible with Sybase IQ 12.5 if you have ESD8 or above installed.

On rare occasions, the server may stop in a way that leaves some threads running. Before starting a server, always shut down any remaining threads cleanly using stop_asiq -cleanup. This command only shuts down threads owned by the person who runs it.

Stopping servers in cron or at jobs

To use stop_asiq in a cron or at job, 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. This prevents accidentally shutting down the wrong server if several are running.

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 can specify both options on the same command, for example:

stop_asiq -agent -stop all

NoteYou must specify the full pathname to the stop_asiq executable in the cron statement.

Other ways to stop servers

There are other ways to stop an IQ database server: