2. Using Ingres Commands : ckpdb Command—Checkpoint a Database
 
Share this page                  
ckpdb Command—Checkpoint a Database
Permission required: System administrator, DBA, or an Ingres user with the operator privilege. On VMS, to checkpoint a database in a group level installation, you must have the VMS CMKRNL privilege.
The ckpdb command checkpoints a database or selected tables in a database.
The command creates a new checkpoint for the specified database. If a table list is specified, only the tables on the table list are included in the checkpoint. If journaling is enabled for the database, all journal entries up to this checkpoint are marked as expired. Checkpointing takes place online (while the database is in use) by default and is transparent to users.
The ckpdb command creates the checkpoint, and then copies (to the dump file) the log records of any changes to the database that occurred during the checkpoint procedure. Rollforwarddb uses the dump file when it recovers a database that was checkpointed online.
Ingres knows whether the checkpoint is for a table or a database, and prevents attempts to roll forward an entire database from a table checkpoint. For table checkpoints, an infodb display of the mode field of the Checkpoint History for Journal and the Checkpoint History for Dump will indicate TABLE.
By default, the ckpdb command sequentially checkpoints data locations one at a time. A database with more than one data location can be checkpointed in parallel.
The ckpdb command has the following format:
ckpdb dbname[/server_class] [-d] [+j|-j] [-l] [#m[n]] [-mdevice {, device}]
[-table=tablename {, tablename}] [-v] [+w|-w] [-timeout=mm:ss] [keep=n]
[-uusername] [-help]
dbname
Specifies the database (one database name only) to be checkpointed, and the server_class, if required, as described in Standard Flags and Parameters (see page Standard Flags and Parameters).
-d
Destroys all previous checkpoint and journal files.
+j|-j
Enables or disables journaling for a database. When this flag is not specified, current journaling status of the database is maintained. If you specify this flag, the checkpoint is performed offline.
-l
Takes an exclusive lock on the database. If you specify this flag, the checkpoint is performed offline (while the database is not in use), which requires the database to be locked.
In an interactive session, if you specify the -l flag to perform the checkpoint offline, then you can also specify the +w or -w flag.
#m[n]
Checkpoints n locations at a time to disk, for a multi-location database.
-mdevice {, device}
Writes the checkpoint to the specified tape device. If a list of tape devices is supplied, parallel checkpointing is used for a multi-location database.
You can write one checkpoint only per tape. It is not necessary to mount the tape device. (When you restore a checkpoint that was created using the ckpdb -m command, you must use the rollforwarddb +c command.)
The –m option is not valid on Windows.
-table=tablename {, tablename}
Specifies a list of tables to be checkpointed. When specifying multiple tables, do not use a space between table names. Table checkpoint is not allowed for system catalogs.
To use this parameter, the database must be journaled. Do not use the +j or –j flag with -table.
-v
Indicates verbose mode, which displays interim messages as checkpointing proceeds.
+w|-w
Waits or does not wait for the database to be free (not in use) before performing the checkpoint. Use this flag only if you have specified the +j, -j, or -l flag. The default is -w.
This flag cannot be used if the checkpoint is performed online. An offline checkpoint requires the database to be locked.
If you specify +w, ckpdb waits as long as necessary for the database to become free for locking and checkpointing. If you specify -w, and the database is busy, an error is returned.
-timeout=mm:ss
Waits the specified number of minutes for active sessions to complete. If the active sessions do not complete in the specified time, the checkpoint is abandoned.
-keep=n
Preserves the specified number of last valid checkpoints and deletes all older checkpoints, valid or invalid.
-uusername
Specifies the effective user for the session, as described in Standard Flags and Parameters (see page Standard Flags and Parameters).
-help
Displays command syntax online.