Using the kill command

WARNING! Use the kill command in Adaptive Server and Backup Server only as a last resort.

When possible, use the Transact-SQL shutdown or shutdown with nowait command. Do not use kill with the -9 flag because it exits the server without running a checkpoint to ensure that all database changes are written to the database device. Adaptive Server may also exit without removing associated shared memory files and network handlers.

Because Adaptive Server and Backup Server are background processes, they can be killed from the operating system by their owner or by “root” with the UNIX kill command. The syntax is:

kill pid

where pid is the process identification of any dataserver or backupserver process, as determined by the showserver command. Killing one engine for a particular Adaptive Server kills all engines for that server.

If more than one Adaptive Server is running on the same system, you must be careful that the engine you kill is associated with the correct Adaptive Server. If your Adaptive Server is configured to use multiple engines (CPUs), each engine has an associated operating system process. The correct way to kill a multi-engine server is to specify the process ID for engine 0.

This showserver output shows the processes for a four-engine server:

showserver

UID

PID

PPID

C

STIME

TTY

TIME

COMD

jorge

3320

1

80

10:31:40

pts/4

302:15

dataserver -dteamster

jorge

3321

3320

80

10:31:45

pts/4

324:47

dataserver -ONLINE:1

jorge

3322

3320

80

10:31:45

pts/4

326:02

dataserver -ONLINE:2

jorge

3323

3320

80

10:31:45

pts/4

328:56

dataserver -ONLINE:3

This example shows four running dataserver processes with operating system process identifications (PID) 3320, 3321, 3322, and 3323. (dataserver is the executable form of the Adaptive Server program.)

Child engine processes for the dataserver have the -ONLINE: argument.

Each child engine has a parent process identification (PPID) that is equal to the process identification (PID) of the parent. In the example above, the PID of the parent server is 3320. The other three engines spawned by the parent process have the same PPID.

If the PPIDs appear to be unrelated, and there is more than one dataserver process, then more than one Adaptive Server is running on the system.