db2adutl ”Work with TSM Archived ImagesThis utility allows users to query, extract, verify, and delete backup images, logs, and load copy images saved using Tivoli Storage Manager (formerly ADSM). On UNIX-based operating systems, this utility is located in the sqllib/adsm directory. On Windows, it is located in sqllib\bin. Usage:
Notes : One parameter from each group below can be used to restrict what backup images types are included in the operation:
Take a database backup using TSM: $ db2 backup database sample use tsm Backup successful. The timestamp for this backup is : 20020811130942 Output from db2adutl: $ db2adutl query Query for database SAMPLE Retrieving full database backup information. full database backup image: 1, Time: 20020811130942, Oldest log: S0000028.LOG, Sessions used: 1 full database backup image: 2, Time: 20020811142241, Oldest log: S0000029.LOG, Sessions used: 1 Retrieving table space backup information. table space backup image: 1, Time: 20020811094003, Oldest log: S0000026.LOG, Sessions used: 1 table space backup image: 2, Time: 20020811093043, Oldest log: S0000025.LOG, Sessions used: 1 table space backup image: 3, Time: 20020811105905, Oldest log: S0000027.LOG, Sessions used: 1 Retrieving log archive information. Log file: S0000025.LOG Log file: S0000026.LOG Log file: S0000027.LOG Log file: S0000028.LOG Log file: S0000029.LOG Log file: S0000030.LOG $ db2adutl delete full taken at 20020811093043 db sample Query for database SAMPLE Retrieving full database backup information. Please wait. full database backup image: SAMPLE.0.v8inst.NODE0000.CATN0000.20020811093043.001 Do you want to deactivate this backup image (Y/N)? y Are you sure (Y/N)? y $ db2adutl query Query for database SAMPLE Retrieving full database backup information. full database backup image: 1, Time: 20020811130942, Oldest log: S0000028.LOG, Sessions used: 1 full database backup image: 2, Time: 20020811142241, Oldest log: S0000029.LOG, Sessions used: 1 Retrieving table space backup information. table space backup image: 1, Time: 20020811094003, Oldest log: S0000026.LOG, Sessions used: 1 table space backup image: 3, Time: 20020811105905, Oldest log: S0000027.LOG, Sessions used: 1 Retrieving log archive information. Log file: S0000026.LOG Log file: S0000027.LOG Log file: S0000028.LOG Log file: S0000029.LOG Log file: S0000030.LOG db2ckbkp ”Check BackupThis utility can be used to test the integrity of a backup image or multiple parts of a backup image and to determine whether the image can be restored. It can also be used to display the metadata stored in the backup header. Usage:
Notes:
Take a database backup: $ db2 backup database sample to /data/dbbackup Backup successful. The timestamp for this backup image is : 20020828231900 The following is sample output from db2ckbkp: $ db2ckbkp /data/dbbackup/SAMPLE.0.v8inst.NODE0000.CATN0000.001 [1] Buffers processed: ##### Image Verification Complete - successful. $ db2ckbkp h /data/dbbackup/SAMPLE.0.v8inst.NODE0000.CATN0000.001 ===================== MEDIA HEADER REACHED: ===================== Server Database Name -- SAMPLE Server Database Alias -- SAMPLE Client Database Alias -- SAMPLE Timestamp -- 20020828231900 Database Partition Number -- 0 Instance -- v8inst Sequence Number -- 1 Release ID -- A00 Database Seed -- 719E1F66 DB Comment's Codepage (Volume) - 0 DB Comment (Volume) -- DB Comment's Codepage (System) - 0 DB Comment (System) -- Authentication Value -- 255 Backup Mode -- 0 Backup Type -- 0 Backup Gran. - 0 Status Flags -- 1 System Cats inc -- 1 Catalog Partition Number -- 0 DB Codeset -- ISO8859-1 DB Territory -- Backup Buffer Size -- 4194304 Number of Sessions -- 1 Platform -- 4 The proper image file name would be: SAMPLE.0.v8inst.NODE0000.CATN0000.20020828231900.001 [1] Buffers processed: ##### Image Verification Complete - successful. db2ckrst ”Check Incremental Restore Image SequenceThis utility allows the user to query the database history in order to generate a suggested sequence of backup image timestamps. It also gives a simplified restore syntax needed for a manual restore. Usage:
Notes:
The following is sample output from db2ckrst: $ db2ckrst d sample t 20020828233730 r database Suggested restore order of images using timestamp 20020828233730 for database sample. ================================= restore db sample incremental taken at 20020828233730 restore db sample incremental taken at 20020828233647 restore db sample incremental taken at 20020828233730 ================================= $ db2ckrst d sample t 20020828233730 r tablespace n userspace1 Suggested restore order of images using timestamp 20020828233730 for database sample. ================================= restore db sample tablespace (USERSPACE1) incremental taken at 20020828233730 restore db sample tablespace (USERSPACE1) incremental taken at 20020828233647 restore db sample tablespace (USERSPACE1) incremental taken at 20020828233730 ================================= db2flsn ”Find Log Sequence NumberThis utility returns the log file name that contains the log record identified by the given log sequence number (LSN). The input LSN must be a string of length 12 or 16 representing the LSN in hex. Usage:
Notes:
The following is sample output from these commands: $ db2flsn 000000BF0030 Given LSN is contained in log file S0000002.LOG $ db2flsn q 000000BF0030 S0000002.LOG $ db2flsn 000000BE0030 Warning: the result is based on the last known log file size. The last known log file size is 23 4K pages starting from log extent 2. Given LSN is contained in log file S0000001.LOG $ db2flsn q 000000BE0030 S0000001.LOG db2inidb ”Initialize a Mirrored DatabaseThis utility initializes a mirrored database in a split mirror environment. The mirrored database can be initialized as a clone of the primary database, placed in rollforward pending state, or used as a backup image to restore the primary database. Usage:
Sample command from db2inidb: $ db2inidb <database_alias> as < snapshot standby mirror > [ relocate using <config_file> ] $ db2initdb sample as snapshot |