This utility can be used to test the integrity of a backup
image and to determine whether or not the image can be restored. It
can also be used to display the metadata stored in the backup header.
Authorization
Anyone can access the utility,
but users must have read permissions on image backups in order to
execute this utility against them.
Command syntax
>>-db2ckbkp--+---------------------------------+---------------->
| .-,---------------------------. |
| V | |
+---+-------------------------+-+-+
| +- -a---------------------+ |
| +- -c---------------------+ |
| +- -d---------------------+ |
| +- -e---------------------+ |
| +- -h---------------------+ |
| +- -l---------------------+ |
| +- -n---------------------+ |
| +- -o---------------------+ |
| +- -p---------------------+ |
| +- -s---------------------+ |
| +- -t---------------------+ |
| +- -cl--decompressionLib--+ |
| '- -co--decompressionOpts-' |
+- -H-----------------------------+
+- -S-----------------------------+
'- -T-----------------------------'
.-,--------.
V |
>----filename-+------------------------------------------------><
Command parameters
- -a
- Displays all available information.
- -c
- Displays results of checkbits and checksums.
- -cl decompressionLib
- Indicates the name of the library to be used to perform the decompression.
The name must be a fully qualified path referring to a file on the
server. If this parameter is not specified, DB2® will attempt to use the library stored in
the image. If the backup was not compressed, the value of this parameter
will be ignored. If the specified library cannot be loaded, the operation
will fail.
- -co decompressionOpts
- Describes a block of binary data that will be passed to the initialization
routine in the decompression library. DB2 will
pass this string directly from the client to the server, so any issues
of byte reversal or code page conversion will have to be handled
by the decompression library. If the first character of the data block
is '@', the remainder of the data will be interpreted by DB2 as the name of a file residing
on the server. DB2 will then
replace the contents of string with the contents
of this file and will pass this new value to the initialization routine
instead. The maximum length for string is 1024 bytes.
- -d
- Displays information from the headers of DMS table space data
pages.
- -e
- Extracts pages from an image to a file. To extract pages, you
will need an input and an output file. The default input file is called extractPage.in.
You can override the default input file name by setting the DB2LISTFILE
environment variable to a full path. The format of the input file
is as follows:
For SMS table spaces:
S <tbspID> <objID> <objType> <startPage> <numPages>
Note: - <startPage> is an object page number that is object-relative.
For DMS table spaces:
D <tbspID> <objType> <startPage> <numPages>
Note: - <objType> is only needed if verifying DMS load copy images.
- <startPage> is an object page number that is pool-relative.
For log files:
L <log num> <startPos> <numPages>
For other data (for example, initial data):
O <objType> <startPos> <numBytes>
The
default output file is extractPage.out. You can override
the default output file name by setting the DB2EXTRACTFILE environment
variable to a full path.
- -h
- Displays media header information including the name and path
of the image expected by the restore utility.
The
following is a brief description of the media header parameters:
- Authentication Value
- Indicates the value of the Authentication type. Refer to sqlenv.h file
for more information.
- Backup Buffer Size
- Indicates the size in bytes.
- Backup Gran
- Indicates the Incremental type. 0 = FULL, 16 = INCREMENTAL, 48
= DELTA.
- Backup Mode
- Indicates whether the backup was taken online or offline. Possible
values are 0 = offline, 1 = online.
- Backup Type
- Indicates the type of backup. 0 = Database, 3 = Table space,
4 = Load copy.
- Catalog Database Partition Number
- Indicates the catalog partition number in a database with DB2
Database Partitioning Feature (DPF) enabled.
- Compression
- Indicates whether the backup is compressed. 0 = NO, 1 = YES.
- Database Seed
- An internal identifier that is assigned to a database when it
is created.
- DB Codeset
- Indicates the Codeset that is specified when database was created.
- DB Comment
- Indicates the database comment specified by the user when the
database was created.
- DB Territory
- Indicates the Territory that is specified when database was created.
- Include Logs
- Indicates whether logs are included in the backup image. 0 =
NO, 1 = YES.
- LogID
- Internal identifier that is used to identify which database the
log files belong to.
- Number of sessions
- Indicates the number of backup targets that are specified on
backup command.
- Platform
- Indicates the Server platform in hexadecimal digits where the
backup was taken. Refer to sqlmon.h file for
more information.
- Release ID
- Identifies the release id that is used internally by DB2.
- Sequence Number
- Indicates the sequence number of the backup image.
- Status Flags
- Internal flags
- System Cats inc
- Indicates whether the backup includes SYSCATSPACE. 0 = NO, 1
= YES.
- -H
- Displays the same information as -h but only
reads the 4K media header information from the beginning of the image.
It does not validate the image. This option cannot be used in
combination with any other options.
- -l
- Displays log file header (LFH) and mirror log file header (MFH)
data.
- -n
- Prompt for tape mount. Assume one tape per device.
- -o
- Displays detailed information from the object headers.
- -p
- Displays the number of pages of each object type. This option
will not show the number of pages for all different object types if
the backup was done for DMS table spaces data. It only shows the total
of all pages as SQLUDMSTABLESPACEDATA. The object
types for SQLUDMSLOBDATA and SQLUDMSLONGDATA will
be zero for DMS table spaces.
- -s
- Displays the automatic storage paths in the image.
- -S
- Displays the same information as -s but does
not validate the image. This option cannot be used in combination
with any other options.
- -t
- Displays table space details, including container information,
for the table spaces in the image.
- -T
- Displays the same information as -t but does
not validate the image. This option cannot be used in combination
with any other options.
- filename
- The name of the backup image file. One or more files can be checked
at a time.
Note: - If the complete backup consists of multiple objects, the validation
will only succeed if db2ckbkp is used to validate
all of the objects at the same time.
- When checking multiple parts of an image, the first backup image
object (.001) must be specified first.
Examples
Example 1 (on UNIX platforms)
db2ckbkp SAMPLE.0.krodger.NODE0000.CATN0000.19990817150714.001
SAMPLE.0.krodger.NODE0000.CATN0000.19990817150714.002
SAMPLE.0.krodger.NODE0000.CATN0000.19990817150714.003
[1] Buffers processed: ##
[2] Buffers processed: ##
[3] Buffers processed: ##
Image Verification Complete - successful.
Example
2
db2ckbkp -h SAMPLE2.0.krodger.NODE0000.CATN0000.19990818122909.001
=====================
MEDIA HEADER REACHED:
=====================
Server Database Name -- SAMPLE2
Server Database Alias -- SAMPLE2
Client Database Alias -- SAMPLE2
Timestamp -- 19990818122909
Database Partition Number -- 0
Instance -- krodger
Sequence Number -- 1
Release ID -- 900
Database Seed -- 65E0B395
DB Comment's Codepage (Volume) -- 0
DB Comment (Volume) --
DB Comment's Codepage (System) -- 0
DB Comment (System) --
Authentication Value -- 255
Backup Mode -- 0
Include Logs -- 0
Compression -- 0
Backup Type -- 0
Backup Gran. -- 0
Status Flags -- 11
System Cats inc -- 1
Catalog Database Partition No. -- 0
DB Codeset -- ISO8859-1
DB Territory --
LogID -- 1074717952
LogPath -- /home/krodger/krodger/NODE0000/
SQL00001/SQLOGDIR
Backup Buffer Size -- 4194304
Number of Sessions -- 1
Platform -- 0
The proper image file name would be:
SAMPLE2.0.krodger.NODE0000.CATN0000.19990818122909.001
[1] Buffers processed: ####
Image Verification Complete - successful.
Usage notes
- If a backup image was created using multiple sessions, db2ckbkp can
examine all of the files at the same time. Users are responsible for
ensuring that the session with sequence number 001 is
the first file specified.
- This utility can also verify backup images that are stored on
tape (except images that were created with a variable block size).
This is done by preparing the tape as for a restore operation, and
then invoking the utility, specifying the tape device name. For example,
on UNIX based systems:
db2ckbkp -h /dev/rmt0
and
on Windows: db2ckbkp -d \\.\tape1
- If the image is on a tape device, specify the tape device path.
You will be prompted to ensure it is mounted, unless option -n is
given. If there are multiple tapes, the first tape must be mounted
on the first device path given. (That is the tape with sequence 001
in the header).
The default when a tape device is detected is
to prompt the user to mount the tape. The user has the choice on
the prompt. Here is the prompt and options: (where the device I specified
is on device path
/dev/rmt0)
Please mount the source media on device /dev/rmt0.
Continue(c), terminate only this device(d), or abort this tool(t)?
(c/d/t)
The user will be prompted for each device
specified, and when the device reaches the end of tape.