Download
Download
DB2 Software
DB2 Objects
DB2 Recovery
db2setup
db2_install
installFixPack -b db2dir
db2rspgn -i db2inst1
db2setup -r file.rsp
db2licm -l show detail
db2licm -a file.lic
db2level
db2ls
db2ls -q -b db2dir -a
DB2 Instance
db2start
db2stop
db2icrt -u db2fenc1 db2inst1
db2idrop db2inst1
db2iupdt db2inst1
db2iupgrade -u db2fenc1 db2inst1
db2ilist
DB2 Configuration
DB2 Connectivity
db2 "connect to db1"
db2 connect to db1 user u using p
db2 "connect reset"
db2 "list node directory"
db2 "catalog tcpip node n1 remote r1
server 50000"
db2 "uncatalog node n1"
db2 "list db directory"
db2 "catalog db db1 at node n1"
db2 "uncatalog db db1"
db2 "terminate"
DB2 Maintenance
db2 "reorgchk update statistics on table all"
db2 reorgchk update statistics on schema s1
db2 reorgchk update statistics on table system
db2 "reorg table t1"
db2 reorg table t1 inplace
db2 reorg index i1 for table t1
db2 reorg indexes all for t1
db2pd -d db1 -reorgs
db2 runstats on table t1 and indexes all
db2 "runstats on table t1 with distribution and detailed indexes all"
db2 runstats on table t1 with distribution on key columns
and sampled detailed indexes all
db2pd -runstats
db2look -d db1 -m -o file.sql
db2 "bind @db2ubind.lst blocking all grant public"
db2 "bind @db2cli.lst blocking all grant public"
db2rbind db1 -l logfile all
DB2 Security
DB2 Troubleshooting
db2 "force applications all"
db2 "force application (12345)"
db2diag -g -d db1 -l severe
db2diag -lastrecords 5
db2diag -rc
db2support . -d db1 -c
db2dart db1 /ts
db2dart db1 /t
db2dart db1 /ddel
db2 "inspect check table name t1 schema s1
indexdata results keep t1.out"
db2 inspect rowcompestimate table name t1
schema foo results f1.out
DB2 Development
db2 -td@ -svf file.sql
create procedure sp1(in p1 int) language sql begin select * from t1 where c1 = p1; end@
create trigger g1 after insert on t1 for each row update t2 set c1 = c1 + 1@
create function f1 (x double) returns double language sql return sin(x)/cos(x)@
create table t1 (id int, c1 char(1), c2 char(1)) organize by (c1, c2)@
Notes
System commands used for installing, managing, and updating software are
path dependant (i.e. /cdrom/db2setup, /opt/ibm/db2/V9.7/instance/db2icrt)
Before issuing DB2 commands or invoking the Command Line Processor, you
must source a db2profile (i.e. . /home/db2inst1/sqllib/db2profile)
DB2 commands can be grouped into scripts and executed from the command
line using db2 -tvf filename.clp -o filename.log
GRAESON LEWIS
[email protected]
ceevee.com/graeson
linkedin.com/in/graeson
graeson.wordpress.com