![]() | ![]() |
Home |
|
|
Installation Guide Adaptive Server Enterprise for IBM RISC System/6000 AIX |
|
| Chapter 7 Starting and Stopping Servers |
|
| Stopping servers |
Only the System Administrator has permission to issue a shutdown command. Using a shutdown command minimizes the amount of work that automatic recovery needs to do when the servers are restarted.
The preferred method of stopping Adaptive Server or Backup Server is to use the Transact-SQL shutdown command. For Monitor Server, use the sms_shutdown command.
To shut down Adaptive Server:
Use isql to log in to an Adaptive Server account with System Administrator privileges:
isql -Usa -Ppassword -Sserver_name
Enter the following command to shut down the server:
1> shutdown 2> go
The default for the shutdown command is with wait. The with wait option allows Adaptive Server to finish executing SQL statements or procedures, perform a checkpoint in each database, disable new logins, and perform other shutdown tasks.
Issuing the shutdown command prints a message like this to the stderr file:
Server SHUTDOWN by request.The SQL Server is terminating this process.
CT-LIBRARY error:ct_results(): network packet layer: internal net library error: Net-Library operation terminated due to disconnect CT-LIBRARY error: ct_cancel(): network packet layer: internal net library error: Net-Library operation terminated due to disconnect
This is normal behavior. If the message indicates that Adaptive Server is waiting for processes to complete, and you need to stop Adaptive Server immediately, you can use the shutdown with nowait command. shutdown with nowait does not wait for currently executing statements to finish and does not perform checkpoints in every database.
To shut down a Backup Server:
Use isql to log in to a server with System Administrator privileges:
isql -Usa -Ppassword -Sserver_name
Enter the following command to shut down the specified Backup Server:
1> shutdown SYB_BACKUP 2> go
After you shut down a Backup Server, you must wait at least 30 seconds before restarting it.
Issuing the shutdown command prints a message similar to the following to the stderr file:
Backup Server: 3.48.1.1: The Backup Server will go down immediately. Terminating sessions.
This is normal behavior. If a message indicates that Adaptive Server or Backup Server is waiting for processes to complete, and you need to stop Adaptive Server or Backup Server immediately, you can use the shutdown with nowait command. shutdown with nowait does not wait for currently executing statements to finish and does not perform checkpoints in every database.
Using shutdown with nowait for Backup Server can cause inconsistent or incomplete dumps and loads. Use this command only when necessary.
For more information on the shutdown command, see the Reference Manual.
To stop a Backup Server that is not configured as the logical Backup Server (SYB_BACKUP) for Adaptive Server:
Change the logical Backup Server, SYB_BACKUP, to a different physical server:
1> sp_addserver SYB_BACKUP, NULL, common_name2> go
where common_name is the name of the server in the interfaces (sql.ini on Windows) file.
Perform the steps above to stop the server.
You must shut down Monitor Server before restarting Adaptive Server. If Adaptive Server stops, make sure that Monitor Server is shut down before you restart Adaptive Server. Monitor Server must be shut down to release resources. Otherwise, Adaptive Server may not be able to allocate enough resources to restart.
To shut down Monitor Server:
Log into the server:
isql -Smonitor_server -Usa -Pwhere monitor_server is the name of the Monitor Server with its extension.
Issue the shut down command:
1> SMS_SHUTDOWN 2> go
If the Monitor Server heartbeat feature is in effect, Monitor Server automatically detects the termination of Adaptive Server within the specified period and shuts itself down. Therefore, before attempting to restart Adaptive Server after a shutdown, either wait for the automatic shutdown of Monitor Server to occur, or explicitly stop Monitor Server.
For more information on stopping Monitor Server, see the Monitor Server User's Guide.
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.
When Adaptive Server starts, it creates the following files in $SYBASE to store information about the shared memory segments that it uses:
SERVER_NAME.krgSERVER_NAME.srg0
If Adaptive Server allocates more than one shared memory segment either during start-up or after start-up due to reconfiguration, it stores memory segment information in the file:
SERVER_NAME.srgNUM
where NUM is a number from 0 to 255. Note that Adaptive Server allocates a maximum of 257 shared memory segments.
|
|