sa_checkpoint_execute system procedure

Function

Allows the execution of shell commands during a checkpoint.

Syntax

sa_checkpoint_execute 'shell_commands'

Parameters

shell_commands One or more user commands to be executed in a system shell. The shell commands are specific to the system shell. Commands are separated by a semicolon (;).

Permissions

None.

Description

sa_checkpoint_execute allows users to execute shell commands to copy a running database from the middle of a checkpoint operation, when the server is quiescent. The copied database can be started and goes through normal recovery, similar to recovery following a system failure.

sa_checkpoint_execute initiates a checkpoint and then executes a system shell from the middle of the checkpoint, passing the user commands to the shell. The server then waits for the shell to complete, creating an arbitrary size time window in which to copy database files. Most database activity stops while the checkpoint is executing, so the duration of the shell commands should be limited to acceptable user response time.

If the shell commands return a non-zero status, sa_checkpoint_execute returns an error.

Do not use the sa_checkpoint_execute with interactive commands, as the server must wait until the interactive command is killed. Supply override flags to disable prompting for any shell commands that might become interactive; in other words, the COPY, MOVE, and DELETE commands might prompt for confirmation.

The intended use of sa_checkpoint_execute is in conjunction with disk mirroring to split mirrored devices.

Example

The following statement issues a checkpoint, copies all the asiqdemo database files to a backup directory, then completes the checkpoint.

sa_checkpoint_execute 'cp asiqdemo.* /backup'