DB2 Tools Cheat Sheet

Posted by

By Special request, a DB2 Tools Cheat Sheet. Not all-inclusive, but some of the ones you’re most likely to use in supporting e-commerce databases. Click on the command to get to the DB2 Info Center entry on each one. If you think I’ve missed something important, comment with it.

Tool Category Purpose
Export Data Movement Pull data out of a table into ixf, csv(del), or other formats.
Import Data Movement Get data into a table from ixf, csv(del), or other formats – fully logged
Load Data Movement Get data into a table from ixf, csv(del), or other formats – optional logging and deferred constraint checking
db2move Data Movement Use export, import, or load with multiple tables at once – can be whole-database
db2relocatedb Data Movement Rename or move all or part of a database
db2look Data Movement Get all DDL, DCL, or statistical information in an executable format – great to have for backing out database structure changes
Get snapshot Monitoring Get detailed information about database activity
db2top Monitoring Real-time monitoring based on the snapshot monitors
db2pd Monitoring Get detailed information about database activity
Event monitors Monitoring Get line-item detailed information about various database activities – be careful of overhead
db2mtrk Monitoring Report memory allocated to db2 and various heaps
db2evmon Monitoring Parse db2 event monitors to a human-readable format
db2gov Performance / Security Work with db2 governor
db2exfmt SQL Analysis Parse explain data and generate explain plan
db2batch SQL Analysis Benchmark timing of SQL statements
db2advis SQL Analysis Use db2 design advisor to recommend indexes
db2audit Security Manage db2audit facility for auditing database activity
db2cfexp Configuration Export major configuration to a file to use as backup or to move between environments
db2cfimp Configuration Import major configuration from a file created by db2cfexp
Get dbm cfg / update dbm cfg Configuration Get or change the database manager configuration
Get db cfg / update db cfg Configuration Get or change the database configuration
Get cli cfg / update cli cfg Configuration Get or change the cli configuration
db2set Configuration Manage the db2 registry
db2ckbkp Recovery Check integrity of a backup image
db2dart Data Integrity Offline check of physical data
db2diag Error Investigation Parse the db2 diagnostic log
db2support Error Investigation Gather information to send to db2 support
db2trc Error Investigation Use db2 trace facility – usually at db2 support’s request
db2icrt Build Create db2 instance
db2idrop Build Drop db2 instance
db2sampl Build Create Sample database
db2iupdt Instance management Update db2 instance
db2ilist Instance management List db2 instances
db2level Instance management Display db2 version and fixpack
db2start Instance Management Start db2 instance
db2stop Instance Management Stop db2 instance
db2rbind Package management Rebind packages
Runstats Performance Collect optimizer statistics
Reorgchk Performance Check the need for reorgs on tables
Reorg Performance Reorganize tables/indexes on disk
Backup database Recovery Take a backup of the database
Restore database Recovery Restore a database from a backup image
Rollforward Recovery Play transactions from a backup through a specified point in time

Ember is always curious and thrives on change. She has built internationally recognized expertise in IBM Db2, and is now pivoting to focus on learning MySQL. Ember shares both posts about her core skill set and her journey learning MySQL. Ember lives in Denver and work from home

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.