Specifying a wait time

When the server prepares to shut down, it:

  1. Performs checkpoint on all the databases.

  2. Prevents any new user from logging in.

  3. Waits for all running or sleeping processes to finish their job.

  4. Performs another checkpoint on the databases, this time with a flag indicating it needs to flush:

When you use with wait with the hh:mm:ss option, the time you specify is not the maximum total time Adaptive Server takes to shut itself down. Instead, Adaptive Server takes into account the time it takes to perform the first checkpoint, and automatically subtracts this from the time you specified.

For example, if you specify a maximum wait time of 20 minutes and the first checkpoint takes 3 minutes, Adaptive Server allows up to 17 minutes for the processes to finish. If for some reason the second checkpoint takes longer, however, this is not calculated into the with wait hh:mm:ss parameter you specify.

Adaptive Server also allows a checkpoint to take longer than the time you specify in with wait hh:mm:ss. For example, if you specify a wait time of 10 minutes but the first checkpoint takes 20 minutes to complete, Adaptive Server does not interrupt checkpoint midway, but instead waits for checkpoint to complete. When this occurs, Adaptive Server immediately begins to shut down after checkpoint is complete, since the time you specified has passed, and runs the last checkpoint with the flag informing you of the flushes you must perform.