DB2 数据库调整数据库性能

freesian

贡献于2013-01-16

字数:0 关键词: DB2 数据库服务器

DB2 f> 9.5 Linux f"UNIX fM Windows f w{}]bT\ 2008 j 3 B|B S151-0613-01  DB2 f> 9.5 Linux f"UNIX fM Windows f w{}]bT\ 2008 j 3 B|B S151-0613-01  "b 9CKE"0d'VDz70,kHDAZ 395 3D=< B, :yw;BD#fE"# ^)fyw KD5|, IBM DyP(E"#|ZmI-iPa),R\f((D#$#>vfoP|,DE";|(TNNz7D #$,Ra)DNNod<;h*gKbM# zIZ_r(}1XD IBM zm&): IBM vfo# v *Z_):vfo,k*A IBM vfoPD,x7*:www.ibm.com/shop/publications/order v *iR1XD IBM zm&,k*A IBM +r*5K?<,x7*:www.ibm.com/planetwide *S@zrSCsD DB2 P!Mz[?): DB2 vfo,kBg 1-800-IBM-4YOU(426-4968)# 1zr IBM "ME"1,4,bZh IBM @;^~D(&T|O*J1R;aTzlINN0lD==9CrV"C E"# © Copyright International Business Machines Corporation 2006, 2008. All rights reserved. ?< Z 1 ?V T\*X .........1 Z 1 B T\w{G<*zTa_i/T \ .................35 Z 11 B a_ekT\ ........37 Z 12 B |B&m ..........39 Z 13 B M'z/~qw&m#M ....41 Z 4 ?V T\w{DlYt/ ..........88 uYXimMw}Dh* .........89 T/Xi ..............90 9CX5w}4a_T\ ..........91 X5w}DF.a> ..........92 X5w}DT\a> ..........94 w}e}M,$ ............96 KbVxmODw}P* .........97 l=w}e} ............100 *zw}{mi, ...........102 KbVxmOD/:w}P* .......102 }]bzmLr.............105 }]bzmLr\m ..........106 M'z,SD,S/PwDF .......108 Vx}]bPDzmLr.........109 }]b53`SwE" ..........110 P'D SELECT od...........111 Z 15 B XFw5CLr.......115 t/M#9XFw ............115 XFwX$Lr.............116 dCXFw ..............117 XFwdCD~............117 XFwfr*X............119 XFwdCD~>} ..........123 XFwU>D~............124 XFwU>D~i/ ..........127 Z 16 B y} ..........133 Z 17 B hFKJLr .......135 9ChFKJLr ............138 (e“hFKJLr”D$w:X .......139 9ChFKJLrS%;Vx(F=`Vx}]b 140 hFKJLrDV^TM^F ........140 © Copyright IBM Corp. 2006, 2008 iii Z 5 ?V w{}]b&CLrT\ 143 Z 18 B &CLr"bBn ......145 "PTJb ..............145 tk6pMT\............146 8(tk6p ............148 x(k"PTXF ............150 x(tT ..............152 x(j8LH ............153 x(H}M,1............153 x(*; ..............165 @9kx(`XDT\Jb ........165 |}x(}6Jb ...........167 (}x(SY4T4d5D}]s5 .....168 CZvT4d5ekD!n ........170 x(`Mf]T............170 jG< .....203 a_sM3FE"U>Di/T\......208 U/M|B3FE"DD3FE"......213 9C3FE"E*D~U/3FE" .....214 ?<3FE"m.............216 V<3FE" ............219 E/wgN9CV<3FE" .......222 V<3FE"9CD)9>} .......222 j8Dw}3FE" ..........226 S*X3FE"............227 C'I|BD?<3FE" .........228 C'(eD/}D3FE" ........228 CZ(#MYhivF.D?<3FE" ...229 CZTzz}]b(#D3FE"......230 CZV/|B?<3FE"D;cfr ....232 CZV/|BP3FE"Dfr ......232 CZV/|BV<3FE"Dfr......233 CZV/|BmMGF3FE"Dfr ....234 CZV/|Bw}3FE"Dfr......234 Z 21 B }L ...........237 f"}L} ..........246 =J`MMCJ=8 ..........252 *O}]bi/`kwWN ........253 }]CJ=( .............261 (}w}(hD}]CJ.........261 w}CJD`M............264 w}CJM/:HJ ..........265 ,S ................266 ,S=( ..............267 !qnQ,SD_T ..........269 Vx}]b73PX4D_e/i/m ....271 Vx}]bPD,S_T.........273 Vx}]b73PD,S=( .......274 ErMViD'{ ............280 E/_T ...............281 VxZ"PTDE/_T.........281 MDC mDE/_T ..........283 VxmDE/_T ...........285 _e/i/m .............289 5w$_ ...............291 9C5wE"D SQL 4,oz ......390 CJ;,f>D DB2 E"PD .......390 Z DB2 E"PDPTzDW!oTT>wb: . . 391 |B20ZzDFczrZ?x~qwOD DB2 E "PD................391 DB2 LL...............393 DB2 JOoOE"............393 unMu~ ..............393 =< B. yw ............395 w} ...............399 ?< v vi w{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EDU _L#K|nIZ UNIX M Windows 53O$w# TZ}ZCJD?v}]b,t/wV EDU T&mwV}]bNq,}g,$!"( EMU>G<#}]bzmLrG;`XbD EDU,4(|GG*K&m}]bD&C Lrks# ?vM'z&CLr,SDTsDd{j8E": M'zLr M'zLrT6L==KPrw*}]b~qwZ,;zwOKP#|G(}l}w ("k}]bDWN*5#;s,aT|G8(-wzmLr(db2agentP)# < 2. DB2 53DxLXM'zLr9CxLd(E(IPC)l}w (db2ipccm)#l}w|(: v db2ipccm,CZ>XM'z,S v db2tcpcm,CZ TCP/IP ,S v db2tcpdm,CZ TCP/IP "V$_ks zmLr aT4TM'z&CLrDyP,Sks(;\G>XD9G6LD)Vd`&D- wzmLr(db2agent)#4(-wzmLr.s,|+zm&CLr4PyP}] bks# ZtCK}]bVx&\?~(DPF)rtCK intra_query "PTD73P,-wzm Lra+}]bksV"xSzmLr(Vp* db2agntp M db2agnts)#b)zmLr *&CLr4Pks#;)4(K-wzmLr,|Mazmd&CLr&myP} ]bks,=(G-wT}]b4PksDSzmLr(db2agntp)#k&CLrX* +10&ZUP4,DSzmLrC{F db2agnta j6# -wzmLrI\: v ,SA_Pp{D}]b#}g,“db2agent (DATA1)”,SA}]bp{“DATA1”# v ,SA5}#}g,“db2agent (user1)”,SA5}“user1”# DB2 xL 9.5 *<, DB2 9ITZh*1/,\mUPzmLrXDs!# db2fmp h@==xL#|:pZ@p=b4P\@$Df"}LMC'(eD/}#db2fmp x Li5(v JCZ UNIX)# }]b EDU TBPm|(?v}]b9CD;)X* EDU: v db2pfchr,CZ:eX$!Lr# 14 w{}]bT\ v db2pclnr,CZ:eX3e}Lr# v db2loggr,CZ&mU>D~T&mBq&mMV4# v db2loggw,CZ+U>G<4kU>D~# v db2logts,CZzYD)mUdZD)U>D~P_PU>G<#KE"GD~DU>D~DAw# v db2shred &mU>3PDwvU>G<# v db2redom,CZXvwxL#ZV4Zd,&mXvU>G<"+U>G<8( xXv$wLr4xP&m# v db2redow,CZXv$wLr#ZV4Zd,ZXvwxLks1&mXvU> G<# v db2logmgr,CZU>\mw#\mIV4}]bDU>D~# v db2wlmd,CZT/U/$w:X\m3FE"# v 4gBy>j6B~`Sw_L: – db2evm%1%2 (%3),dP %1 IT*: - g - +VD~B~`Sw - l - >XD~B~`Sw - t - mB~`Sw - gp - +V\@B~`Sw - lp - >X\@B~`Sw dP %2 IT*: - i - -wLr - p - ;G-wLr x %3 GB~`Sw{F v 4gBy>j68]M4-_L: – db2bm.%1.%2 G8]M4-:exY]Lr,x db2med.%1.%2 G8]M4 -iJXFw,dP - %1 - XF8]r4-a0DzmLrD EDU j6 - %2 - CZxVtZX(8]r4-a0D_L(I\Pm`v)D3r5 }g:db2bm.13579.2 j6_P EDU j6* 13579 D db2agent _LXFDZ ~v db2bm _L# Z 5 B e5a9MxL 15 }]b~qw_LMxL 53XFw(Z UNIX O* db2sysc,xZ Windows O* db2syscs.exe)Xkf Z,}]b~qwE\$w#mb,Xkt/BP_LMxL,E\4PwVNq: v db2resync,(h+VY,=PmDY,=zmxL v db2wdog,Z UNIX M Linux Yw53O&ml#U9D4XLr v db2fcms,lY(E\mw"M=X$Lr v db2fcmr,lY(E\mwSU=X$Lr v db2pdbc,"P53XFw,C4&m4T6LZcD"Pks(vZVx}]b 73P9C)# v db2cart,CZCJdC*tC USEREXIT D}]b1Di5U>D~ v db2fmtlg,CZCJdC*tC LOGRETAIN +{C USEREXIT D}]b1Dq =/U>D~ v db2panic,t1zmLr,Z3X(ZcOo=zmLrD^F1&mt1ks (vZVx}]b73P9C) v db2srvlst,\mng DB2 z/OS fD53DX7Pm v db2fmd,JO`SwX$Lr v db2disp,M'z,S/PwVIw v db2acd,w\KP4v`SwMT/,$5CLrDTwFcX$Lr#KxLT 0F* db2hmon# v db2licc,\mQ20D DB2 mI$ v db2thcln,Z EDU U91XBt/J4(vJCZ UNIX) v db2aiothr,\m}]bVxDl= I/O ks(vJCZ UNIX) v db2alarm,Z EDU ksDF1w=Z1(* EDU(vJCZ UNIX) v db2sysc,&mX| DB2 ~qwB~Dw53XFw EDU @x 1=v&CLrKKx(T=yhD}]1M"zK@x,b+#+;Yh*DdvD~} %4IZBN$n}]b1XB$nB~`Sw# g{;h*j8@xB~`Sw,G4I9CTB|n>}B~`Sw: DROP EVENT MONITOR db2detaildeadlock Z&CLrCJGFD*O5373P,IZ}]4&"z@xxI\^(q!&C LrksD}]#1"zbViv1,DB2 @?}]4D@x&m$_#g{Z`v} ]4.d"z@x,G4 DB2 @?}]4,1zFb*@x# *G#+;Yh*DdvD~} %4IZBN$n}]b1XB$nB~`Sw# K|nG9CTBod44(D: db2 create event monitor db2detaildeadlock for deadlocks with details write to file ’db2detaildeadlock’ maxfiles 20 maxfilesize 512 buffersize 17 blocked append autostart WITH DETAILS Sd+a)ngTBE":"z@x1}Z4PDod;g{ dbmon QPfZc;DZf,G49+a)x(Pm# +Z}]b?}]bO,B~`SwdvD~I\;ZTB?PG<;ukTB{"`FD{": 18 w{}]bT\ 2004-12-01-22.58.24.968000 Instance: DB2 Node: 000 PID: 1116(db2syscs.exe) TID: 2540 Appid: *LOCAL.DB2.041202080328 database monitor sqm__evmgr:: log_ev_err Probe:2 Databse:XXX ADM2001W The Event Monitor "DB2DETAILDEADLOCK" was deactivated because the MAXFILES and MAXFILES CREATE EVENT MONITOR parameters’ limits have been reached. +;Yh*DdvD~}%4IZBN$n}]b1YNt/`Sw#g;h*j8 @xB~`Sw,IKPTB|n4>}: DROP EVENT MONITOR db2detaildeadlock g{zXD@xDiv,G4k;*>}K`Sw# ELf"wEv ELf"wT\rX 9I53D2~I\a0l53DT\#w*2~0lT\D>},mI\;0l9C|D53DT\,+KQDf"wG;VICZ Zp&DFT\DJ4# v EL I/O DV< gNmG}]3 PG<*<;CDVZ;F#5* -1 Du?kQ>}DG<`T&# G}#Z 9Cw}4j6 RID .s,c9CC RID 4=o}7D}]3MC3O}7D[E# ;)TG<8(K RID,ZxPmXi.0,C RID c;a|D# Xim1,5J>}G 8.1 *<,DB2 M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{C AIC,h*T=tCSYw}e}*vzF#ITIC=V=(48 (SY*v:+"amd? DB2_MDC_ROLLOUT hC* DEFER T0"v SET CURRENT MDC ROLLOUT MODE od#Z4PSYw}e}*vZd,wvi;j G*Q*v,+G4|B RID w},1=d5Bq.sEaxP|B#Z>}ZdT ;ae}ij6(BID)w},bGr*|G";h*4PP6p&m# Zd5*v>}1+wC*v AIC;g{}]bQXU,G4ZXBt/C}]b.s WNCJm12awC*v AIC#ZxP AIC 1,Tw}xPDyPi/(|(+C J;e}Dw}DG)i/)^wY&\)#IT9C SET UTIL_IMPACT_PRIORITY |nr db2UtilityControl API 4|DKEH6# `S r*ZjIe}.sE\4C MDC mOQ*vDi,yT`SSYw}e}*vDx H+\PC#9C LIST UTILITIES `Sw|n4T>;e}D?vw}D5CLr` Swu?#9IT(}SYw}e}*v(BLOCKS_PENDING_CLEANUP)"9C SYSPROC.ADMIN_GET_TAB_INFO_V95 m/}4i/10}Ze}DmPDi}#* i/}]b6pD MDC mi]Re}},k9C GET SNAPSHOT |n# Z LIST UTILITIES |nDTBy>dvP,xHI?vw}PQ;e}D3}8># dvPP>D?vWN}ZTme}D;v RID w}# db2 LIST UTILITIES SHOW DETAILS dv# j6 =2 `M = MDC ROLLOUT INDEX CLEANUP }]b{F = WSDB VxE =0 hv = TABLE.. *<1d = 06/12/2006 08:56:33.390158 4, = }Z4P wC`M = T/ }ZwY: EH6 =50 xH`X: @FQjIDYVH =83 WNE =1 hv = . $w\F =133 © IBM Corporation 1993, 2008 29 QjID$w =133 *<1d = 06/12/2006 08:56:33.391566 WNE =2 hv = . $w\F =133 QjID$w =133 *<1d = 06/12/2006 08:56:33.391577 WNE =3 hv = . \F$w =93 QjID$w =33 *<1d = 06/12/2006 08:56:33.391587 30 w{}]bT\ Z 9 B w}a9 }]b\mw9C B+ wa9xPw}f"#;v B+ wP;cr`c,gB,dP,RID m>Pj6: %cF*yZc#WcI6ZciI,Wcf"Kw}|5,"P;v8k8r|, |5DmPDP#yZccM6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^[DVU>G<_T,T;c}]Mw}3ywDyP|D:e x#U>:exPD}]IG}]4kELsE\xP: v KP COMMIT od1 v Z+`&}]34kEL.0,r* DB2 9C$4G<#$4U>GG<4kU>:ex1,g{U>:exQz DB2 TbV=(\mrEL4kU>}]D?DG!I\XuL&mSY1d#Z"z m`O!D""BqD73P,s`}&mSYGI COMMIT odlID,r*Ko dXkH}U>}]4kELsE\xP#rK,G}] 4kELalIs?&mSY,mb;)SYGIU> I/O *zlID#*=bK`U >G}]# TsTs(LOB)M LONG VARCHAR D|D(}0S3fwHxPzY#}G8( U>#t,"RZ9C CREATE TABLE od4(m1;P9C NOT LOGGED Sd (e LOB P,qr;G< LOB P|D#g,;c}]3;y,T LONG r LOB } ]`MDVd3D|D2a;G33_P c;DICUd,CUd2I\r*;m;vBqD4d5D DELETE od#tx; IC#*7#4d5DICUdGICD,&-#“d5”Bq# DB2MAXFSCRSEARCH "amd?DhC7(mP* INSERT xQwD FSCR }?# K"amd?D1!5G 5#g{Z8(}?D FSCR PR;=Ud,ZmD)2&7 SekDG<#*E/ INSERT YH,9I\a+sxG<7SAm)2,1=nzK =v)9}]i*9#ZnzK=v)9}]i.s,B;v INSERT ZO;Qwax &D FSCR LxQw# " : * E / INSERT Y H ( I \ D z [ G m v $ C | S l ),+ DB2MAXFSCRSEARCH "amd?hC*O!D}#*E/Ud4C(I\Dz[G INSERT YHu}),+ DB2MAXFSCRSEARCH hC*|sD}# TbV==Qw{vmPDyP FSCR s,7S*ekDG: v APPEND MODE ZK==P,)D T\# v ZmO(e/:w}# ZbVivB,}]b\mw"T+GG<4kU >:ex#w*KYwD;?V,q!U>rE(LSN),"+df"Z}Z|B D3D37P# 2. TC3xP|D# 3. !{x(C3# r*P4+TC3ywD|D4kEL,yTO*C3G“`”3# 4. U>:exQ|B# +U>:exPD}]M“`”}]3?F4kEL# *Ka_T\,b) I/O ;SYA;v=cD1d(}g,Z530k1D]#Z d),rSYAXk7#IV4TD1d,rSYA^FDV41d#_eX5, “`”3ZBfb)1r;?F4kEL: v 1m;vzmLr!q|w*~|3D1r# v 1IZBP-rlI3e}LrT34PYw1: – m;vzmLr!q|w*~|3# – ,} chngpgs_thresh }]bdCN}YVH5#1,}K51,l=3e}Lrc ;=Q,"+|D}D34kEL# g{tCKw/e}3,G4K5;OJ,"R;a%"3e}# – ,} softmax }]bdCN}YVH5#;),}K5,l=3e}Lrc;= Q,"+|D}D34kEL# g{T}]btCKw/e}3,"RQ-*}]b}7dCK3e}Lr}, G4XM6L&CLrxLIT9C,;}]b#6L&CLrGSw*}]bzwD 6LzwtC}]bYwD&CLr#>X&CLr1Sk~qwzwOD}]b` ,# DB2 \mM'z,SD==!vZ,S/PwGr*9GXU#1 max_connections } ]b\mwdCN}DhC5sZ max_coordagents dCN}DhC51,,S/Pw &Zr*4,# v g{,S/Pw&Z“XU”4,,?vM'z&CLryaVd;vF*-wzm LrD(; EDU,|IT-wC&CLrD&m"k.(E# v g{,S/Pw&Z“r*”4,,?v-wzmLryI;N\m`vM'z, S,"I-wd{$wLrzmLrTjIbn$w#TZ_Pm``X2,,S DrXx&CLrr_Pm``X!BqD`F&CLr,,S/Pw(}Jmx P|`DM'z&CLr,S4a_53DT\#|9ITuY?v,ST53J 4D9C# B}fIwH%*(EDU),EDU G9CYw5 3_L5VD# ZIT4P&CLr*T}]b4PD$w.0,XkZ&CLrk}]b\mw. d(";V(E=(# ZBXM'zWH(} db2ipccm ("(E#Z A2 &,db2ipccm 9 C db2agent EDU,C EDU I*4T>XM'zD&CLrksD-wzmLr#; sC-wzmLr*5 A3 &DM'z&CLrTZM'z&CLrM-wLr.d( "2mZf(E#>XM'zOD&CLrk A4 &D}]b`,# ZB"=WNd5(COMMIT)"8]M4-NqT0 d{Nq# < 8. xLKw*~qwzw73;?VD=S}fIwH%*(EDU)#?vn/}] byPTmD$!Lr(db2pfchr)M3e}Lr(db2pclnr)D2mX,"PTmD G)xP\mT!I\ uYkd4(M>}`X*D*z#keepfenced }]b\mwdCN}D1!5* “YES”,K59B;NwCDf"}LITX49Cf"}LxL# ":*qC|CDT\,;\@$D UDF Mf"}L1SZzmLrDX7UdKP# +G,IZ|GTzmLrDX7UdDCJ(;\^F,rKZ9C|G.0,h *T|GxPOqDbT# `}]bVx&m#MG%;}]bVx&m#MD_-)9#5JO,%;+2z kb'Vb=V==DYw#BK%;}]bVx&m#M(g0=)k`}]bVx&m#M.dfZD`FTknl# < 9. xL,IZ&CLr A Z Node0000 O4( PROD }]b,rKZCZcO 4( PROD }]bD?<#,y,IZ&CLr B Z Node0001 O4( TEST }] b,rKZCZcO4( TEST }]bD?<#zI\kZzD5373PD;,Zc O4(}]b,Sx+k?v}]bD?<`XD``n/=yV,TcTC, SxP&m#-wzmLrG8k&CLr`%(E(4SUksM"MX&)Dz mLr#|TmIT&mks,2IT-w`vSzmLrTksxP&m#-wz mLryZD}]bVxF*C&CLrD-wLrZc#-wLrZc9IT9C SET CLIENT CONNECT_NODE |nxPhC# -wLrZc+4T&CLrD?V}]bks"MAd{}]bVxPDSzmL r;;s-wLrZc+d{}]bVx5XDyPa{O",""MXx&CL r# "v CREATE DATABASE |nD}]bVxF*C}]bD“?dCDBP(i: v 9C“XFPD”D“dCKJLr”Tq!PX53DOmu<1!5D(i#&1 *(;2~73w{k DB2 ;p;6D1!5# U/PX>c2~DE",TcITXpr,"ZTsKPCE># KE>2a)n;cDw{N}DPmT)TsN<# v 9C“XFPD”M“M'zdCzV”PDd{r<44PkT\`XD\mNq# b)Nq(#G(}(QOY1dM,&MIqCX*DT\a_DNq# d{rc|B”r<#“KP4vPD”a);i`SMw{ $_# v 9CXFPDPD“hFKJLr”r_9C db2advis |n4KbD)w}"_e/ i/m"`,/:mM}]bVx+a_i/T\# v 9C ACTIVATE DATABASE |n4t/}]b#ZVx}]bP,K|n$ny P}]bVxOD}]b,"\b1Z;v&CLrxP,S1u"r*XhvKICZ}]b\mwM?v}]bD?vd CN}# b)\am|,;vP,CP8>w{N}GK}]b\mw*;,C>VdDwvZfxMJmXFKZfs!DdC N}#k"b,Z|(`v_-}]bVxDs5~qwf73P,?v}]bVx :ex) – 5CLrQ – Lr|_Y:f – ?<_Y:f – x(Pm(;\/,XvSKZfx,;\uY#) ZQtC}]b\mwVxZ"PTdCN}(intra_parallel)D73"QtC,S /PwD73r_QtC}]bVx&\(DPF)D73P,9ITVd2mEr Qw*}]b+VZfD;?V#mb,g{}]b\mwdCN} sheapthres h C* 0(1!5),G4yPEr<+9C}]b+VZf# v 1&CLr,SA}]b1:VdK&CLrQ#?v&CLr<_P|T:D& CLrQ#g{h*D0,IT9C applheapsz dCN}4^FNN;v&CLr ITVdDZf?,r_9C appl_memory dCN}4^F{DD&CLrZf\ ?# }]b\mwdCN} max_connections hCITk5},Sr_kC5}PfZ DNN}]b,SD&CLr}DO^#r*?vk}]b,SD&CLrKgNVd}]b\mwZ f#T>DdCN}JmzXFwvZfxDs!# Z 14 B YwT\ 51 sF:ex KZfxCZ}]bsFn/#K:exs!I audit_buf_sz dCN}7(# `SwQ KZfxCZ}]b53`SD}]#KZfxs!I mon_heap_sz dCN }7(# < 12. }]b\mwgN9CZf 52 w{}]bT\ lY(E\mw(FCM):eX TZVx}]b53,lY(E\mw(FCM)h*c;`DZfUd,Hd GZ fcm_num_buffers D5Os1#S FCM :eXPVdh*D FCM Z f# }]b+VZf “}]b+VZf”\BPdCN}0l: v database_memory N}*}]b+VZfDs!a)K;vB^# v BN}rrSXF}]b+VZfxDs!: – :eXDs!# – x(PmDnsf"w(locklist) – }]bQ(dbheap) – 5CLrQs!(util_heap_sz) – Lr|_Y:fs!(pckcachesz) – 2mErQ(sheapthres_shr) – ?<_Y:f(catalogcache_sz) &CLr+VZf &CLr+VZfII appl_memory dCN}XF#I9CBPdCN}4 ^FNN;v&CLrI{DDZf?: v &CLrQs!(applheaps) v odQs!(stmtheap) v 3FE"Qs!(stat_heap_sz) zmLr(CZf v ?vzmLrXM'zDzmLr/&CLr2mZfND\}\BP}]bdCN} PDOM_^F: – yPn/}]bD maxappls D\} – max_coordagents D5# " : Z t C K } f / O D d CP( max_connections > max_coordagents),&CLrZf{D+\ max_connections ^F# v “zmLr/&CLr2mZf”9\BP}]bdCN}0l: – &CLr'VcQs!(aslheapsz)N} – M'z I/O is!(rqrioblk)N} Z 14 B YwT\ 53 FCM :eXMZf*s ZVx}]b53P,}]b\mw2mZfM FCM :eXgBy># ?v}]bVxD FCM :ex}I fcm_num_buffers dCN}XF#1!ivB,K N}hC* AUTOMATIC#*V/w{KN},9C buff_free(10ICD:ex) M buff_free_bottom(n!IC:ex53`S*X)PD}]# ?v}]bVxD FCM E@}I fcm_num_channels dCN}XF#1!ivB,K N}hC* AUTOMATIC#*V/w{KN},9C ch_free(10ICDE@)M ch_free_bottom(n!ICE@53`S*X)PD}]# w{ZfVdN} hCZfVdN}DW*-rG:}G-}wXVv,qrPp+b)N}hC*n s5#K-ruA9JCZ_PnsZfD53#m`0lZfDN}I9}]b\ mw\;=cl]XT\kN}5DHJ,G4z_* <=o.=H(Zr*ZKcOVdd{Zf";avS& CLrT\D5,rK;GKQZfxQ# v 8vN}DZfVdO^I\,vKVP2~MYw53DZf]?#b)^FJ mCZ+4DZfv$# v *KbN}DP'6',kND?vN}Dj8E"# Tw{ZfEv Tw{Zf&\(}T/hCZfdCN}5T0w{:eXs!4r/ZfdCN q#tCK&\.s,Zfw{wMaZ`vZf9C_(|(ErZf"Lr|_ Y:f"x(PmZfM:eX).d/,VdICZfJ4# Bm4`pP>KTw{Zfwb: m 1. Tw{ZfE"Ev `p `Xwb ;cE"M^F v Z 56 3D:Tw{Zf; v Z 58 3D:Tw{ZfYwDj8E"MV^T; v self_tuning_mem-self_tuning_mem - Tw{ZfdCN} tCM{C v Z 56 3D:tCTw{Zf&\; v Z 57 3D:{CTw{Zf&\; `S v Z 57 3D:7(tCKTw{&\DZf9C_; DPF "bBn v Z 59 3D:Vx}]b73PDTw{Zf; v Z 61 3D:ZVx}]b73P9CTw{Zf; IT/w{DdCN} v 6dCN}N<7PD:database_memory - }]b2mZfs!; v 6dCN}N<7PD:locklist - x(PmDnsf"?; v 6dCN}N<7PD:maxlocks - }6.0x(PmDnsYV H; v 6dCN}N<7PD:Lr|_Y:fs!; v 6dCN}N<7PD:sheapthres_shr - 2mErDErQP5; v 6dCN}N<7PD:sortheap - ErQs!; Z 14 B YwT\ 55 Tw{Zf S DB2 f> 9 *<,BDZfw{&\a(}T/hC;)ZfdCN}D54r/ ZfdCNq#tCK&\.s,Zfw{wMaZBPZf9C_.d/,VdI CZfJ4::eX"Lr|_Y:f"x(ZfMErZf# w { w Z database_memory d C N } ( e D Z f ^ F 6 ' Z $ w # database_memory 5>m2ITT/w{#T database_memory tCT/w{(+ |hC* AUTOMATIC).s,w{w+7(}]bD{eZfhs"y]10}]b hs4vSruYVdx}]b2mZfDZf?#}g,g{10}]bhs\ _,"R53OPc;DICZf,G4}]b2mZf+{DO`DZf#g{} ]bZf*sB5,r_53ODICZf?dC}M,MaME;)}]b2mZ f# g{z4TTw{tC database_memory N}(4+KN}hC* AUTO- MATIC),G4{v}]b<+9Cz*KN}8(DZf?,Sxy]h*Z}] bZf9C_.dVdZf#IT(}=V=(8(}]b9CDZf?:+ database_memory hC*;v}5r_+|hC* COMPUTED#ZZ~VivB, \Zf?Gy]}]bt/1D}]bZfQu<5\FxFcD# }K9C database_memory dCN}4w{}]b2mZfTb,z9IT9d{ Zf9C_xPTw{,gBy>: v TZ:eX,9C ALTER BUFFERPOOL M CREATE BUFFERPOOL od# v TZLr|_Y:f,9C pckcachesz dCN}# v TZx(Zf,9C locklist M maxlocks dCN}# v TZErZf,9C sheapthres_shr M sortheap dCN}# tCTw{Zf&\ Tw{Zf&\(}T/hCZfdCN}5T0w{:eXs!4r/ZfdCN q#tCK&\s,Zfw{wMaZ8vZf9C_(|(Er"Lr|_Y: f"x(PmxrM:eX).d/,XVdICZfJ4# 1. (}+ self_tuning_mem hC* ON 4T}]btCTw{&\#IT9C UPDATE DATABASE CONFIGURATION |n"SQLFUPD API r(}XFPDPD|D} ]bdCN}0Z4+ self_tuning_mem hC* ON# 2. *TIZfdCN}XFDZfxrtCTw{&\,k9C UPDATE DATA- BASE CONFIGURATION |n"SQLFUPD API r(}XFPDPD|D}]bd CN}0Z+`XdCN}hC* AUTOMATIC# 3. *T:eXtCTw{&\,k+:eXs!hC* AUTOMATIC#IT9C ALTER BUFFER POOL od(TZVP:eX)r CREATE BUFFER POOL o d(TZB:eX)4jIKYw#g{Z DPF 73P+:eXs!hC* AUTO- MATIC,M;&CZ sysibm.sysbufferpoolnodes P*C:eX(eNNu?# ": 1. IZTw{&\Z;,Zfxr.dXBVdZf,yT,XkAYtC=vZf xr(}gx(ZfxrM}]b2mZfxr)E\9Tw{&\pwC#(; D}bGI sortheap dCN}XFDZf#1v+ sortheap hC* AUTOMATIC 1,+tC sortheap DTw{&\# 56 w{}]bT\ 2. **Tw{&\tC locklist dCN},9Xk*Tw{&\tC maxlocks,rK1 locklist hC* AUTOMATIC 1,maxlocks 2hC* AUTOMATIC#**Tw{ &\tC sheapthres_shr dCN},9Xk*Tw{&\tC sortheap,rK1 sheapthres_shr hC* AUTOMATIC 1,sortheap 2hC* AUTOMATIC# 3. v1}]b\mwdCN} sheapthres hC* 0 1,EJmT/w{ sheapthres_shr r sortheap# 4. Tw{Zf&\vZ HADR w~qwOKP#Z HARD 53O$nTw{Zf& \s,@6;aZ(z~qwOKPK&\,"R,v1}7XhCdCs,K& \EaZw~qwOKP#g{KPKP; HADR }]bG+D|n,Tw{Zf Yw2aP;,SxZBDw~qwOKP# {CTw{Zf&\ IT(}+ self_tuning_mem hC* OFF 4T{v}]b{CTw{&\#1 self_tuning_mem hC* OFF 1,hC* AUTOMATIC DZfdCN}M:eXT* AUTOMATIC,"RZfx#Vd10s!;d# IT9C UPDATE DATABASE CONFIGURATION |n"SQLFUPD API r(}X FPDPD|D}]bdCN}0Z4+ self_tuning_mem hC* OFF# g{;P;vZf9C_tCKTw{&\,G49ITP'XT{v}]b!{$ nTw{&\#bGr*,1vtCK;vZfx1,;\TZfxPYV<# }g,*{C sortheap dCN}Tw{&\,ITdkTBod: UPDATE DATABASE CONFIGURATION USING SORTHEAP MANUAL *{C sortheap dCN}Tw{&\,",1+ sortheap D105|D* 2000,kd kTBod: UPDATE DATABASE CONFIGURATION USING SORTHEAP 2000 Z3)ivB,*T;vZfdCN}tCTw{&\,9XkTm;v`XZfd CN}tCK&\#}g,v1tCK locklist dCN}DTw{&\1,EJmtC maxlocks dCN}DTw{&\#,y,v1tCK sortheap dCN}DTw{&\ 1,E\tC sheapthres_shr dCN}DTw{&\#bb6E,g{{C locklist r sortheap N}DTw{&\,2+Vp{C maxlocks r sheapthres_shr N}DTw{ &\# (}+:eXhC*X(s!,IT{C:eXDTw{&\#}g,BPod+{ C bufferpool1 DTw{&\: ALTER BUFFERPOOL bufferpool1 SIZE 1000 7(tCKTw{&\DZf9C_ *i4dCN}XFDZf9C_DTw{hC,k9CBPdP;V=(# v *S|nPi4dCN}DTw{hC,k9C GET DATABASE CONFIGURA- TION |n"8( SHOW DETAIL N}# ZdvP,ITtCTw{&\DZf9C_+Vi=;p,gBy>: Z 14 B YwT\ 57 hv N} 105 SYD5 -------------------------------------------------------------------------------------------- Tw{Zf (SELF_TUNING_MEM) = ON (Active) ON }]b2mZfs!(4KB) (DATABASE_MEMORY) = AUTOMATIC(37200) AUTOMATIC(37200) nsx(Pmf"w(4KB) (LOCKLIST) = AUTOMATIC(7456) AUTOMATIC(7456) ?v&CLrDx(PmYVH (MAXLOCKS) = AUTOMATIC(98) AUTOMATIC(98) Lr|_Y:fs!(4KB) (PCKCACHESZ) = AUTOMATIC(5600) AUTOMATIC(5600) 2mErDErQP5(4KB) (SHEAPTHRES_SHR) = AUTOMATIC(5000) AUTOMATIC(5000) ErPmQ(4KB) (SORTHEAP) = AUTOMATIC(256) AUTOMATIC(256) v 2IT9C db2CfgGet API 47(GqtCw{&\#+5XBP5: SQLF_OFF 0 SQLF_ON_ACTIVE 2 SQLF_ON_INACTIVE 3 S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uning dbpartitionnum ’) "vK|n1,+Tl===r_Z}]bBNt/1|Bw{Vx# v *CZfw{wT/XB!qw{Vx,kT 5dk -1# Z DPF 53Ot/Zfw{w IZTw{&\*syPVx<&Zn/4,E\}7Xw{`Vx53ODZf, yT,Z DPF 73P,v19CT= ACTIVATE DATABASE |n$n}]b1, Eat/Zfw{w# Tx(}]bVx{CTw{&\ v * T ; ? V } ] b V x { C T w { & \ , k + ; k w { D } ] b V x D self_tuning_mem dCN}hC* OFF# v *TX(}]bVxOIdCN}XFD;?VZf9C_{CTw{&\,kZ C}]bVxO+`XdCN}5r:eXs!hC* MANUAL rX(5#+G, (i9Tw{dCN}5ZyP}ZKPDVxP;B# v *T3v}]bVxODX(:eX{Cw{&\,k"v8(Ks!5D ALTER BUFFER POOL |n"8( PARTITIONNUM N}5,T8>*{CTw{&\D Vx# 9C PARTITIONNUM SdZX(}]bVxO8(s!D ALTER BUFFERPOOL od+Z SYSCAT.SYSBUFFERPOOLNODES ?}:eXT0w{:eXDs !#I9C ALTER BUFFERPOOL od4vs:eXDs!#1!ivB,T ALTER BUFFERPOOL od8( IMMEDIATE X|V"RZZfIC1,;dk|nMaVd Zf#g{Zf;IC,G4Cod+w* DEFERRED 4P,"R+ZXB$n}] b1VdZf#g{u!:eXDs!,G4+ZBqd51MEZf#Z!{$n }]b1ME:eXZf#Zns;v&CLrKv1I\a~=!{$n}]b, b!vZ$n}]bD==# ":*K\brvs:eXDs!xXkvs dbheap }]bdCN}Ds!,8uy P:eXZfyI}]b2mZf/zz,"RITT/w{s!# *K7#J1D:eXZyPivByIC,DB2 4(Km`!M53:eX,|GD ?v3Ds!*:4K"8K"16K M 32K#?v:eXDs!* 16 3#C'4;=b ):eX#|G;avVZ53?#gPX*,+mUdXB3d=53:eX#T \I\wTB5# v Z}]b,SZd^(t/U(D:eX KJb(#IOXD-r(gZf;;u~)}p#d; DB2 +r*53:eXx dV"Sd&\,+T\awTB5#z&"4bvKJb#1"zKJb1,z aSU=;u/f,"R53+;u{"4k\m(*U># 62 w{}]bT\ 4(:eX1,}GT=8(m;v3s!,qr3s!+*4(}]b18(Ds !#IZvZmUd3s!k:eX3s!`,1EIT+3Ak:eX,rKz* :eX8(D3s!&ImUdD3s!7(#z;\Z4(:eX.sDd|D3 s!#XkC;,D3s!4(BD:eX# db2mtrk wCDZfzYLrJmzi4*:eXVdD}]bZfs!#TBy> db2mtrk dvT>K;vC'4(D:eX(C(EPD}V“1”j6)MDv53:e X(C(EPD3s!j6): > db2mtrk -d Tracking Memory on: 2005/10/24 at 12:47:26 Memory for database: XMLDB utilh pckcacheh catcacheh bph (1) bph (S32K) bph (S16K) bph (S8K) 64.0K 576.0K 64.0K 4.2M 576.0K 320.0K 192.0K bph (S4K) shsorth lockh dbh other 128.0K 0 640.0K 4.2M 192.0K }]3D:eX\m :eXPD3I\}Z9C,2I\;P9C,|GI\G`3,2I\GI;3: v }Z9CD3MG10}ZA!r|BD3#g{33}Z|B,G4;P|B_ E\CJC3#+G,g{334Z|B,G4IT,1Pm`vDA_# v “`”3|,Q|D+P44kELD}]# b)3+;1#tZ:eXP,1=}]bXU"d{3h*9C3;3y}TsD}LP#TBu~CZ7 (*}%D;3T}kd{3: v G`C0}CD3 v YN}CC3DI\T v 3P}]D`M v C3GqQZZfP|D+P44kEL(|DD3Pm`,=}]3rw}34Ywkl=}]3rw}34Yw`X1Hd GgK# PX|`E",kND:Z 67 3D:w/D3e}; :eX}]3\mD>} Z 14 B YwT\ 63 BD~XEBq# V4ZdXkA!DU>Ds!GU>PBPGG< v hvT:eXPD}]yvDng|DDU>G<# 3e}Lr+`34kEL,TcZV4Zdh*XEDU>Ds!S;,}TB 5: logfilsiz * softmax / 100(T 4K 3F) dP: v logfilsiz m>U>D~Ds! < 14. l=3e}Lr. Q“`”34AEL# 64 w{}]bT\ v softmax m>Z}]b@#s*V4DU>D~DYVH#}g,g{ softmax D5 * 250,G4g{"z@#,2.5 vU>D~+|,h*V4D|D# *+V4ZdU>A!1duAn!,9C}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l=(#XiIuYmyhDUd?"a_}] CJMi/T\# Xk_P SYSADM"SYSCTRL"SYSMAINT r DBADM (^,r_Xk_PTmD CONTROL (^E\Xim#Xk_P}]b,SE\Xim# j6h*XiDm.s,ITTb)mKP REORG 5CLr,"RIT!qTZb) mO(eDNNw}KPC5CLr# 1. *9C CLP Xim,k"v REORG TABLE |n: db2 reorg table test.employee *9CY1mUd mytemp Xim,kdk: db2 reorg table test.employee use mytemp *Xim"y]w} myindex TPxPXBEr,kdk: db2 reorg table test.employee index myindex 2. *9C SQL wCodXim,k9C ADMIN_CMD }L"v REORG TABLE | n: call sysproc.admin_cmd (’reorg table employee index myindex’) 3. *9C DB2 \m API Xim,k9C db2REORG API# ZXim.s,&U/PXmD3FE",TcE/w_Pn<7D}]4@@i/ CJ=8# QzmXiDV4: Z 14 B YwT\ 79 Zf;WN*<.0,QzmXiG;vj+I&rj+'\D}L#bm>g{5 3ZErr9(WN@#,G4XimYw+Xv,"R;aZ@#V41XBxP CYw#xGXkZV4sXB"v REORG TABLE |n# g{53Zxkf;WNs@#,G4XimYwXkjI#bGr*QjIyPX im$w,- TsPDyP}]#ZbVivB, SMS mUdk DMS mUd.dP;vnp:X k+ SMS TsS;vTs4F=m;vTs,xZ DMS P,g{XiZ`,mUd PxP,G4v8rUUXiDTs"Oz-RGQ-5PBTs,rK;XB4PNNYw#gOy v,+;X(w},+Z@#V4Zda+w}jG*^'#}]b+y];cfr 7(X(w}D1d:Z}]bXBt/1rZ;NCJw}1# TZ0vV4,g{If>DmZELO,G4XBxPXimYw#0vYw9C Z9(WNG44Pw}(hr(hEr,"Rg {nu9CKY1mUd,G4h*D(;Y1mUd+CZQXiTsD1>#0 vZd,IZxP"PV4,rKIT,1XB4P`vXimYw#ZbViv B,9CDELUd+HKP19CD*`# a_QzmXiDT\: QzmXiDT\Z\sLHOI}]b73DXwv(# B5O,T NO ACCESS ==KPDXimYwkT ALLOW READ ACCESS == KPDXimYwZT\=f;PNNnp#(;DxVZZ,TZ READ ACCESS = =,DB2 Zf;m.0}6TCmDx(,rK5CLrI\XkH=VP(hjI" MEdx(#Zb=V==B,mZXimYwDw}X(WN;IC# PXa_T\D9C`,DmUd,x ;9CY1mUd#b+Z!SY1mUdP4FmyCD1d# v };X*Dw},TcZXimYwZd,$OYDw}# v 7#}7hCKQXiDmyZDmUdD$!s!# v tC INTRA_PARALLEL,Tc9C"P&mjIw}X(# v w{ sortheap M sheapthres }]bdCN}TXFErUd#r*?v&mw<+ 4P=PEr,yT sheapthres D5AY&* sortheap x 9CD&mw}# v (}w{3e}LrD}?7#!lS:eXPe}`w}3# *zmXi *zr-XmXiJmC'Xim,",1JmTCmxPj+CJ#d;*zmX iJmC';POT}]DCJ,+dYHHQzmXi*}# 80 w{}]bT\ xP*zmXi1,;G"4Xi{vm#xG43rXimDwv?V#;a+} ]4F=Y1mUd:ZVPmTsPF/PTXB("/:"XUICUd"{} gvP# *zmXi|(Dvw*WN: 1. !q N 3 ZKWNP,DB2 +!q N 3,dP N G|,*xPXim&mDnY 32 vP r3D)9}]is!# 2. Zv6' !( N 3s,*zmXi+K6'ZDyPPFAmPDIC3#?v;F/DP <#t;u RP(Xim8k)G<,CG<|,PDB;CD RID#+Pw*|, }]D RO(Ximgv)G} RP G <"+ RO G<*;*}#G<# 3. nd6' ZvyPP.s,+ICQXiDq="y]9CDNNw}xPErsD3r" q-(eDNN$!^F4Xb)P#nd6'PDyP3s,+ZmP!qB; v N Pr3,"RYN*}K .OLR 4,D~,G4Xim}L;\Lx,"Ra5X SQL2219 ms# Xkt/BDXim}L# ;&S53PV/}%kXi}LX*DD~# T*z==Xim: *zr-XmXiJmC'ZXimD,1CJCm# Z 14 B YwT\ 81 Xk_P SYSADM"SYSCTRL"SYSMAINT r DBADM (^,r_Xk_PTmD CONTROL (^E\Xim#Xk_P}]b,SE\Xim# IT9C CLP |n"9C SQL wCodr(} DB2 API 44P*zmXi# 1. *9C CLP T*z==Xim,k"v9C INPLACE !nD REORG TABLE | n: db2 reorg table test.employee inplace 2. *9C SQL wCodT*z==Xim,k9C ADMIN_CMD }L"v REORG TABLE |n: call sysproc.admin_cmd (’reorg table employee inplace’) 3. *9C DB2 \m API Xim,k9C db2REORG API# ZXim.s,&U/PXmD3FE",TcE/w_Pn<7D}]4@@i/ CJ=8# V4'\D*zmXi: (#IZELQzrU>G*“Q]#”# *zmXi]#GIPO}/D,bb6E|ITIC'((}9C REORG TABLE | nD]#!nr?F4P&CLr|n)rI DB2 Z3)ivB(}g,Z53@# 1)]## ]#"XBt/*zmXi: C'IT]#"XBt/}ZxPD*zmXi# *]#rXBt/*zmXi,zXk5PBPdP;n(^rX(: v sysadm v sysctrl v sysmaint v dbadm v TmD CONTROL X(# 1. *]#*zmXi,k"v9C PAUSE !nD REORG TABLE |n: db2 reorg table homer.employee inplace pause 82 w{}]bT\ 2. *XBt/Q]#D*zmXi,k"vxP RESUME !nD REORG TABLE | n: db2 reorg table homer.employee inplace resume ": v ]#*zmXis,;\*1=NNVP&CLr<;5 Pmx((|(4T UR (hLrD IN x()1,XimYwEjI# v 9ITy]mx(`Mq!Px(: g{5PTmD S x(,G4;h*%@DP6p S x(,rK;h*x;=x (# g{5PTmD IS x(,G4ZF/P.0+q!P6p S x(,"ZF/jIs MECx(# v I\h*Z?x(4XFT*zmXiTsMd{*z DB2 5CLr(g*z8]) DCJ# x(a0lXimM""C'&CLrDT\#?R(izZ4P*zmXi1li x(lU}]TKbx(n/# `SmXi I T 9 C GET SNAPSHOT | n " SNAPTAB_REORG \ m S < r SNAP_GET_TAB_REORG m/}q!PXmXiYwD4,DE"# Xk,SA}]b"R_PBP(^: v SYSMON (^ v T SNAPTAB_REORG \mSXiQI&jI#49wC&CLrU9d}]b,S, db2Reorg x L2aLx# w}Xi (}>}MekYwTmxP|Bs,w}DT\a5M,dmV==gB: v 6S3VN 6S3;VN.s,IZXkA!|`D6S3E\Cfm3,rK I/O YwI>a vS# v omw}3D3r;Ykb)3OD|3r`%d(KF*;}3v|RICUd!Z8( DYVH1,}]b~qwaT/O"w}6S3#K}LF**zw}{mi,# +G,*4-w}/:MICUdT05M66p,k9CBPdP;V=(: v >}"XB4(w}# v 9C REORG INDEXES |n*zXiw}# r*K=(JmC'ZX(mw}ZdTmxPA4Yw,yTZzz73PI\ h*!qK=(# v 9CJmQzXim0dw}D!nKP REORG TABLE |n# *zw}Xi 84 w{}]bT\ Z9C ALLOW WRITE ACCESS !nKP REORG INDEXES |n1,g{,1J mT8(DmxPA4CJ,G4aX(CmDyPw}#xPXi1,Ty!my wDNN+a0l=w}D|D<+GP#mb,g{PNNZ?Zf :exUdI)9C,G49+b)|DEZbyDZfUdP#Xi+&myG< D|DTcZX(w}1k104n/#V,=|B#Z?Zf:exUdGy]h *S5CLrQPVdD8(Zfxr,|C4f"T}Z4(rXiDw}ywD |D#9CZf:exUd9w}XiYw\;(}byD==4&m|D,4H1 SSZfA!,;sA!U>(gPX*),+A!U>D1d*mC`#ZXiY wjIs,+MEyVdDZf#XijIs,X(Dw}I\;GnQ/:Dw }#g{*w}8( PCTFREE,G4ZXiZd,?3Oya#t`&YVHDUd# TZVxm,'VTwvw}xP*zw}XiMe}#*Twvw}xPXi,8 (w}{:REORG INDEX index_name for TABLE table_name TZUdw}r`,/:(MDC)m,;'VIC ALLOW WRITE ==D*zw}X i# ":REORG INDEXES/INDEX |nD CLEANUP ONLY !n;\j+Xiw}# CLEANUP ONLY ALL !n+}%G)jG*“>}”R;O**d5D|#Kb,| 9+MEyPjG*“>}”R;O**d5D|yZD3#ZME3s,`ZD6S 3+aO",0aGbyvITZO"3OAYtv PCTFREE ICUd#PCTFREE G 8Z4(w}1*d(eDICUdYVH#CLEANUP ONLY PAGES !nv>}G )jG*“>}”R;O**d5DyP|yZD3# 9C CLEANUP ONLY !nTVxmDw}xPXi1,'VNNCJ6p#g{4 8( CLEANUP ONLY !n,G41!CJ6p ALLOW NO ACCESS G(;'V DCJ6p# w}Xi_PBP*s: v Tw}Mm_P SYSADM"SYSMAINT"SYSCTRL r D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PAGES Pf"19Cw}4CfmP1Z3r3 CJ.dD=yfzm3}#1s`}343r1,$!LrvTY?Dfz 3,"4QdCD$!s!Lx$!#1mdC|SlR1,fzCf3}Ma vS#(#IZZmD)2rZgv3P"zK^rDekZm3DwvrP .dXkfzCfD=ym3}#1fzCJm`31"zb)iv,baPO $!Lr#OsD}8>^i/DmrOn/:Dw}# 3. |,jG*Q>}+4}%D RID Dw}6S3} Z 2 `w}P,1 RID jG*>}1,(#4ZomO>} RID#bb6EIC UdI\a;b)_-OQ>}D RID } D6S3D}?,i/ SYSCAT.INDEXES M SYSSTAT.INDEXES 3FE"mD NUM_EMPTY_LEAFS P#TZ"GyP RID }D6S3,_-OQ> }D RID D\}f"Z NUMRIDS_DELETED PP# 9CKE"4(}4Px CLEANUP ALL !nD REORG INDEXES @FITX U`YUd#*k;XUyP RID <;jG*Q>}D3PDUd,4PxP CLEANUP ONLY PAGES !nD REORG INDEXES# 4. w}D/:HJM/:rS3FE" /:HJ3FE"f"Z SYSTCAT.INDEXES ?9Cw}D}]/:DLH#g{U/ DETAILED w}3FE",0 M 1 .dDCD/:rS3FE"f"Z CLUSTERFACTOR P P,"R CLUSTERRATIO D5* -1#b=v/:3FE"P;P;vITGVZ\Y*,;w}/ :}],G4zI\kXiCmTYN/:}]# 5. 6S3} i/ SYSCAT.INDEXES mPD NLEAF PTcKbw}}{v6'ZDP1,I\vVU3# fEU3}Dv`,M|h*xPmXi#Xim1+XUU3"uYmy9CD Ud?#mb,r*a+U3Ak:eXTxPm(h,yTXU49CD3IT a_m(hDT\# 1mPD\3}(FPAGES)!ZrHZ NPARTITIONS * 1 v)9}]is!1, ;(ixPmXi#g{GVxm,G4 NPARTITIONS *}]Vx},qr* 1# ZVx}]b73P,+mD}]bVxiPD}]bVx}w*rSs,ivd * FPAGES <= mD}]bVxiPD}]bVx} * NPARTITIONS * 1 v) 9}]is! ZXi.0,k[OMXimrw}yhDI> (|( CPU 1d"DC1dM REORG 5CLrZjIXiYw.0x(mlID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Z 14 B YwT\ 89 – Zw}O9C8(D PCTFREE 44(/:w}# – +}]0k=mP.0T}]xPEr mO}7hCK PCTFREE D/:w}PzZ#V-mPD}]V}s?Ps,2h*4 Pd{DAYw#9CT/mXi4tC DB2 \mQzMw}Xi,T9z^h#G N19CNV=(4Xi}]#ItC DB2 4Xi53?m# ":*i/DmOfZX5w}";#$a{/QEr#;P ORDER BY SdE7# a{/DEr# !\w}ITxuLCJ1d,+G|G2IxT\x4:f0l#Z4(w}. 0, 4(DX5w}&C!vZX5}]MCJC}]Di/# 9C“XFPD”PD“hFKJLr”r_ db2advis $_4iRX(i/r(e$w: XD;ii/DnQw}#K$_*X5w}(iKby;)T\a_&\?~: INCLUDE P"LPD(;w}M ALLOW REVERSE SCANS w}# TBMUd: 92 w{}]bT\ – \b4(DX5w}Gb)POd{w}|D?V|#}g,g{P a"b M c O Pw},G4P a M b ODZ~vw};cC&;s# – ;*ZyPPONb4(X5w}#;X*Dw};v9CUd,xR}M|BYwDT\,Zb|O4(X5w}# v *a_f0= IMMEDIATE M INCREMENTAL MQT D DELETE M UPDATE Y wDT\,T MQT D~,(;|4((;X5w},C~,(;|G MQT (eD GROUP BY SdPDP# v TZlYErYw,Z51CZErX5}]DPO4(X5w}# v *a_`PX5w}D,ST\,g{Z;v|PP`n!q,G49Cn#C“=” (H5,S)=J8(DG;P,r9CgZ;v|Gy_Pn`%5DG)P# v *ozBekDPy]w}xP/:"\b3Vn,(e;v/:w}#/:w} &TxuYXimDh*# 1(em19C PCTFREE X|V48(3O&CtB`YICUd,E\Jm+e kPJ1XEZ3O#2IT8( LOAD |nD pagefreespace MODIFIED BY S d# v *tC*zw}{mi,,4(X5w}19C MINPCTUSED !n#MINPCTUSED 8(w}6S3Pn!9CUd?DP5"tC*zw}{mi,#g{b)>} 5JOSw}3}%|,G4bITZ|>}ZdTT\p'*z[xuYXiD h*# ZBPivB,}9C DISTINCT Sd: SELECT DISTINCT WORKDEPT FROM EMPLOYEE }]b\mwI9C WORKDEPT O(e*}rr5rDw}4{}X45#K,;v w}2ICZ GROUP BY SdP,T+5Vi,gTB>}y>: SELECT WORKDEPT, AVERAGE(SALARY) FROM EMPLOYEE GROUP BY WORKDEPT Z 14 B YwT\ 93 v 9C4O|4(X5w},C||{odP}CD?vP#1CK==8(w} 1,ITS?w}lwX5}],bHCJm|P'# }g,},I+(;X 5w}(e*: CREATE UNIQUE INDEX x ON employee (workdept) INCLUDE (lastname) 8( lastname * INCLUDE Px;Gw}|D;?V,b6E lastname ;f"Z w}D6S3O# X5w}DT\a> MZ?Zf :exUdP#Z?Zf:exUdGy]h*S5CLrQPVdD8(Zfx r,|C4f"T}Z4(rXiDw}ywD|D#9CCZfxrIT9,= |BWN\;|lX$w#Z4(rXiYwjIs,+MEyVdDZf#g{ 7#Pc;D5CLrQ4]IT}Z4(rXiDw}xPD+?rs?V| D,G4aT,=|BWNDT\zzG#}+D0l# v Z SMP zwOKP1vs sheapthres dCN} ?vSzmLr+q! sortheap dCN}y8(DZf?,TcZ(hm1\bE rgv#z&`SErgv}"`&Xvs sheapthres# v *X5w}8(;,DmUd I+w}f"Zkm}];,DmUdP#by,(}uYw}CJZdA/4E7 DF/,IT|P'X9CELf"w#2ITZ|lDomh8O4(w}mU d#xR,IT+w}mUd8(x;,D:eX,IZ|G;km}]3:y, bIT+w}3O$1d#fZ:exZ# 1;+w}ECZ%@DmUdP1,}]3Mw}39C`,D)9}]is! M$!?#g{Tw}9C;,DmUd,G4I*mUdDyPXw!q;,D 5#r*w}(#Hm!,RV|M# – P`vw}I)CJCm# 4(/:w}.s,T+3==4P REORG TABLE,bI4(i/jCDw}#* XB/:m,IT4PErM0k4zf#(#,;\Z;vw}O/:m#Z9 (/:w}.s9(d{w}#/:w}T<,$}]DX(3r,TDx RUNSTATS 5CLrU/D CLUSTERRATIO r CLUSTERFACTOR 3FE"# * o z , $ / : H J , Z 0 k r X i m . 0 , Z D dm1 8 ( J 1D PCTFREE#PCTFREE 8(D?3ODICUda)CZekDUd,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Ps5(Siv 1 *<),T7 (4(w}D;C#1kdP;Viv`%d1,s5+#9: iv 1: 1Z CREATE INDEX ... IN odP8(Kw}mUd1, + P8(DmUdCZKw}# iv 2: 1Z CREATE TABLE .. INDEX IN odP8(Kw}mUdP, + P8(DmUdCZKw}# iv 3: 48(NNmUd1,9CZ;vQ,SDrIS}]Vx9CDmUd# 4(w}D;C!vZZ CREATE TABLE odZd4PDYw#TZGVxm,g{ 48(NN INDEX IN Sd,G4}]b+ZCSdPn4zD}]mUd#TZV xm,g{z+|tU,G4|+#t*UW,K1iv 3 JC# >} 1: K>}Y(fZVxm sales (a int, b int, c int),"ZmUd“ts1”P4(( ;w}“a_idx”# CREATE UNIQUE INDEX a_idx ON sales(a)IN ts1 >} 2: K>}Y(fZVxm sales (a int, b int, c int),"ZmUd“ts2”P4(w }“b_idx”# CREATE INDEX b_idx ONsales(b)IN ts2 l=w}e} l=w}e}(AIC)GZ9w}u?''DYw.sDSYw}e}#y]w}D` M,u?ITGPj6(RID)rij6(BID)#^[GDVj6,b)u?<+I w}e}Lr}%,w}e}LrZs(l=KP# AIC SlSVxmpk}]VxDYH#g{Vxm|,;vr`vGVxw},G4 +t/ AIC#ZbVivB,AIC +}%}CKQpkD}]VxMNNQ1>}Du ?DyPGVxw}u?#Ze}yPw}.s,+S53?}Du?#+G,IZS4q!x (,rK"PT;a\0l# ?ve}Lr}9C|nP&mw(CLP)gf]>K10}]bVxP WSDB }]bPD AIC n/: $ db2 list utilities show detail j6 =2 `M = ASYNCHRONOUS INDEX CLEANUP }]b{F = WSDB VxE =0 hv = m:USER1.SALES,w}:USER1.I2 *<1d = 12/15/2005 11:15:01.967939 4, = }Z4P wC`M = T/ }ZwY: EH6 =50 xH`X: \F$w =53 QjID$w =03 *<1d = 12/15/2005 11:15:01.979033 j6 =1 `M = ASYNCHRONOUS INDEX CLEANUP }]b{F = WSDB VxE =0 hv = m:USER1.SALES,w}:USER1.I1 *<1d = 12/15/2005 11:15:01.978554 4, = }Z4P w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}{mi,+P'#+G,g{Z|>}ZdTm;P X x(,|jG* Q>},+5JO"4Sw}3O}%#a{{mi,4I&# * { m | j G * Q > } + 5 J O T Z w }3P D 2 ` w } D i , , C CLEANUPONLYALL !n4P REORG INDEXES |n#CLEANUP ONLY ALL ! n{mw}i,,k MINPCTUSED D5^X#g{C CLEANUP ONLY ALL 4P REORG INDEXES,G4g{=v`Z6S3DO"AYITZO"3OtB PCTFREE ICUd,G4O"b=v`Z6S3#Zw}4(1d8( PCTFREE,R1!*Y V..# KbVxmOD/:w}P* TVxm9C/:w}IqCkT#fm9C/:w}`,DC&#+G,Z!qX ZmVx|(eD/:w}1Xk!D# IT9CNN/:|ZVxmO4(/:w}#}]b~qw"T9C/:w}4T >X==/:?v}]VxPD}]#ZQ.V/:DekZd,+Zw}PxPi /TR=OJDPj6(RID)#+SK RID *}Py>: PARTITION BY RANGE (Month, Region) CREATE INDEX ...(Month, Region, Department) CLUSTER d;}]b~qw;?FKX*,+9G#{w}PDyP|4Vxj6[/Z; p,TqCOCD/:#}g,g{;vm4>HxPVx,x/:w}4UZ( e,IZ>HkUZ.dfZX*,yTITqC_PX==/:# 104 w{}]bT\ gZ 104 3D< 18Py>,Zxv?v>}Pw}M}]D X==/:w}#r*h*mVxPkw}P.dfZX*,yTy>;I\P;v j@D>X/:=8# /:DC&|(: v Z?v}]VxZ,PT|D3rEP# v /:w}DFKT|D3r(h{EmDT\#bGr*(hCfZ;3DZ; P,;sCf,;3OD?;P,ZCfKC3ODyPP.s,EFAB;3# bm>NNx(1dZ<;h*mD;3;Z:eXP#`4,g{m4/:,G 4CfD?PPI\G;,3PD#}G:eXPPUd#f{vm,qrba< B?3;Cf`N,Sx+sXu}(hYH# TZVxm,;P1mVx|G/:|D0:(kNDZ 104 3D< 18 PDZ;v <)1,E\#$(hZdvV?3;Cf;NDmkiv#+G,g{qOfh vDGy/:|kmVx|;`X,"R}]G>X/:D,G41:eXPPc ;DUd4#f?v}]VxD;31,T;ITqC/:w}D+?C&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1d.s,g{Q,SD&CLr;Y4PNN$w,G 4-wzmLr+dC;n/"RI\U9# g{,S}uYK,+GI#`,S4PD$w?9\s,G4-wzmLr}I\ ;a"4uY#max_connections M max_coordagents N};a1S0lzmLrOCr zmLrU9#}#DzmLrU9frT;JC,bb6E,S}k-wzmLr }.dDH5";UCGz8(DH5#zmLrZU9.0I\a5X=zmLr XT)4C# g{h*xPj8LH|_DXF,(i8(r/DH5#}g,IT+Ov 300:100 H5r/* 3:1 H5#g{ max_connections hC* 3(AUTOMATIC)R max_coordagents hC* 1(AUTOMATIC),G4JmT? 3 v,S4( 1 v-w zmLr# Z 14 B YwT\ 107 M'z,SD,S/PwDF TZ_Pm``T21D,SDrXx&CLrr`F`MD&CLr,,S/Pw (}JmP'X&m|`M'z,S4DFT\#|2uY?v,SDZf9C," uYOBD*SDN}# ":1 max_connections D5sZ max_coordagents D51,tC,S/Pw# Z*s,1"zm`C',SD73Z,ITtC,S/PwT|P'X9C53J 4#K&\?~aOKT0vZ DB2 Connect™ ,SXPE_PDEc#6DB2 Con- nect C'8O7PhvK,SXM,S/Pw#WN,Ss,,S/PwauYkwz D,S1d#1kskwzO*,S1,aO*k>,S,xZf"XP#tkwz Dv>,S#1"v;vBksT,SAwz1,}]b\mw+"T4CCf"X PVPDv>,S# ":1&CLr9C,SXr,S/Pw1,w{XF_Y:f}]is!DN}, Tq!nQT\#PX|`E",kND6DB2 Connect C'8O7# 9C,SX1,DB2 Connect ;\xPk> TCP/IP Mv> TCP/IP ,S# C(>} >} 1: }P,NNsZ 250 D5<+cT7#r*,S/Pw) v num_poolagents hC*1!5,+GC1!5&7#}]bzmLrICZ ~qkVM'zks,;GvS4(BDzmLrD\Y*z >} 2: Zk>} 1 PD53`FD53P(C53FuT,S};P^F),ITC -wzmLr}2y],S}xvS#TZ>>},Y(=y,SK 1000 vC ',s

|B}]b\mwdC: db2 update dbm cfg using MAX_COORDAGENTS 250 AUTOMATIC db2 update dbm cfg using MAX_CONNECTIONS 1000 AUTOMATIC bb6EfE,S}vS=,} 1000,+y]h*44(|`-wzmLr, dns5I,S\}47(#ZT=vN}<8(;v5"R} 3: 108 w{}]bT\ Zz;kTdtC,S/Pw"+Gk^FQ,SDC'}(}g,;N;J m,S 250 vC')D53P,+}]b\mwdCN}hC*gBy>: v + max_connections hC* 250# v + max_coordagents hC* 250# >} 4: Zz;kTdtC,S/Pw"R;k^FQ,SDC'}D53P,+}] b\mwdCN}hC*gBy>: db2 update dbm cfg using MAX_COORDAGENTS AUTOMATIC db2 update dbm cfg using MAX_CONNECTIONS AUTOMATIC Vx}]bPDzmLr TZVx}]b73MtCVxZ"PTD73,?v}]bVx(4?v}]b~ qwrZc)P|T:DzmLrf"X,ISPivSzmLr#r*PK:e X,SzmLrM;XZ?Nh*14(rjId$w1F5t#b)SzmLrT ;ITw*K:eXPD`XzmLr,"I}]b\mw9C,T4Pk|G`X D&CLrr_B&CLr"vDBks# TZVx}]b73MtCVxZ"PTD73,T53PT\MZfI>D0lk zmLrf"XGgNw{DP\sX5: v zmLr:eXs!D}]b\mwdCN}(num_poolagents)0lIk;v}] bVx(2F*Zc)OD&CLr#V`XDzmLrMSzmLrD\}#g {:eXs!+!RC:eXQz,G4SzmLrb}|T:k|}ZdO$w D&CLrDX*"U9#r*Xk##4(SzmLr,"XB9|Gk&CL r`X,yTT\a\p# 1!ivB,num_poolagents hC* AUTOMATIC "R5* 100#1KN}hC* AUTOMATIC 1,}]b\mw+T/\mXPDUPzmLr}# mb,g{ num_poolagents D5+!,G4;v&CLrMI\nzP`XSzmL rD:eX#rK,1m;v&CLrh*BDSzmLr,"RZdX*Dzm LrXP;PSzmLr1,|+Sd{&CLrDzmLrXPXBt/;n/ DSzmLr#bVP*I7#dV{CJ4# v Xky]ZNNx(1dJm}`zmLrn/DJ4I>(bb)iv# }g,g{ num_poolagents D5+s,9C;\CZd{NqD}]b\mwJ4, G4`XDSzmLr2m\$1d}]b\mwM}]bGgNdCDT0ozzw{|GDE"# v 18(}]b"z@x1,f0=D)&CLrT0D)x(&ZyCP# v I&CLrr}]bRpDx(DPm#g{&CLrIZH}x(x;\Lx4 P,G4fZPXCx(Dd{E",|(Dv&CLrRpKCx(# r**U/;)bV}]ax DB2 DYwx4*z,yTIC`S*X4XF*U/ D)E"#*T=XhC`S*X,I9C UPDATE MONITOR SWITCHES |nr sqlmon() API#(zXk_P SYSADM"SYSCTRL"SYSMAINT r SYSMON (^#) IT(}q!lUr(}9CB~`Sw4CJ}]b\mw,$D}]# q!lU ITICBf}V==DdP;V4q!lU: v S|nP9C GET SNAPSHOT |n# v 9C db2GetSnapshot() API wC`4T:D&CLr# v 9ClUm/}45Xk}]b53DX(xr`XD`Sw}]# 9CB~`Sw 1"zqBqax"odaxrlb=@xbyDX(B~s,;vB~`Sw+6 q53`SwE"#IT+KE"4kD~r|{\@P# *9CB~`Sw: 1. CXFPDr SQL od CREATE EVENT MONITOR 4(d(e#KodZ}] b53?D_Y:f/, SQLM XQuery od DZf;a;ME,1=;Yh*CX(odz7G<(4,10$w%*ax) *9#bI\a: g{B~`Sw`M* DEADLOCK "R WITH DETAILS HISTORY !n}ZKP,G4vS? *:X*100 vVZKT$ZKPDns""&CLr}?,dP X G&CLrD$w%*P $ZDnsod}?#g{B~`Sw`M* DEADLOCK "R WITH DETAILS HISTORY VALUES !n}ZKP,G4vS?*:X*Y vVZKT$ZKPDns""&CLr }?,dP Y G;s(= SQL M XQuery odPDN}5D$Znss!.M# ZtCK VALUES !nDivB@xB~`Sw&Zn/4,1,aTBP==(} K0fT HISTORY !nP>DG)==.b)0l DB2 }]b53D;cT\: v IZ+odE"4F=odz7G}T>=vSd: SELECT EMPNAME, SALARY FROM EMPLOYEE ORDER BY SALARY DESC FETCH FIRST 100 ROWS ONLY OPTIMIZE FOR 20 ROWS v *{CPVi,8( FOR READ ONLY r FOR FETCH ONLY Sd4DFT\# mb,r*ZlwDPOS;Rp%bx(,yT"PT2aa_#2I"zd{ i/X4#8( FOR READ ONLY r FOR FETCH ONLY SdT0 BLOCKING ALL BIND !nIT`FD==DF*O53Pi/GFDT\# v TZ+9C(;|B4|BDNj,8( FOR UPDATE OF SdTJm}]b\m wu&CLr}9C}`DX(J4#fr+8(*4PDYw,g|D&CLr DEH6r?F&CLrk}]bO*,S# g{k3vfr`XDYw|D&CLrDEH6,G4XFwZ"zJ4%}D} ]bVxO|DzmLrDEH6#ZVx}]bP,g{?F+&CLrk}]b O*,S,G4CYw"z,49lb=%}DX$Lr}Z&CLrD-wLrZ cOKP2GgK# XFwG<|y4PDNNYw#*4iYw,i/U>D~# t/M#9XFw XFw5CLr`S,SA}]bD&CLr,"y]ZXFwdCD~PTC}] b8(Dfr|D&CLrDP*# t/XFw.0,Xk4(dCD~# *t/r#9XFw,Xk_P sysadm r sysctrl (^# *t/r#9XFw: 1. *t/XFw,Z DB2 |nP4P db2gov |n# dkBPXhDN}: v START database_name 8(D}]b{FXkk8(DdCD~PD}]b{F%d#g{{F;` ,,G45X;ums#"b,g{XFwGT`v}]bKPD,G4+*? v}]bt/;vX$Lr# v config_file_name K}]bOXFwDdCD~D{F#g{CD~;Z1!;C(C;C* sqllib ?<),G4Xk|(76MD~{# © Copyright IBM Corp. 2006, 2008 115 v log_file_name KXFwDU>D~Dy>{F#ZVx}]bO,TX$Lr*KXFw5} KPD?v}]bVxmS;v}]bVxE# *ZVx}]bD%v}]bVxOt/XFw,mS nodenum !n# }g,*9CdCD~(F* salescfg)MU>D~(F* saleslog)ZVx}]b DZc 3 O*}]b(F* sales)t/XFw,kdkBP|n: db2gov START sales nodenum 3 salescfg saleslog *Z sales }]bDyP}]bVxOt/XFw,kdkBP|n: db2gov START sales salescfg saleslog 2. *#9XFw,kdkx STOP !nD db2gov |n# }g,*Z sales }]bDyP}]bVxO#9XFw,kdkBP|n: db2gov STOP sales *vZ}]bVx 3 O#9XFw,kdkBP|n: db2gov START sales nodenum 3 XFwX$Lr 1XFwX$Lrt/1(1z(} db2gov 5CLr4P|r1|=Q1),|KP BPNq-7# 1. |lidXFwdCD~GqQ|DrGqP4A!#g{zcNN;vu~,G 4CX$Lr+A!CD~PDfr#bJmzZXFwX$LrKP1|DdP *# 2. |ksXZ}Z}]b$wD?v&CLrMzmLrDJ49C3FE"DlU E"# ":Z3)=(O,;\S“DB2 `Sw”q! CPU 3FE"#ZbVivB,J 'frM CPU ^F;IC# 3. |y]XFwdCD~PDfrli?v&CLrD3FE"#g{frJCZ& CLr,G4XFw4P8(DYw# ":XFw+[}DE"kdCD~P(eD5wHO#bm>g{9C&CLr I\Q%4DB54|BdCD~,G4kC%}`XDXFwfrZB;vXF w1ddt+"4&CZC&CLr# 4. |T4PDNNYwZXFwU>D~P4k;uG<# ":g{ agentpri }]b\mwdCN};G531!5,G4;\9CXFw4w{ zmLrEH6# 1XFwjIdNqs,|aZdCD~P8(D1ddtZ]_#1-}K1dd t.s,XFw=Q"YN*,T8>|l#ax# ":!\XFwX$Lr;G}]b&CLr,"rK;,$k}]bD,S,+| 75_P5},S#r*|IT"vlUks,yTXFwX$LrITlb}]b \mwN1ax# dCXFw *dC“XFw”,4(dCD~,T7(“XFw”D5}`SD}]bT0|gN\m i/# dCD~I;ifriI#0}ufr8(*`SD}]b"4U>G`-wPr*CD~"dkdCE"MYwu~# CVE(;)ax?ufr#(iBPdCE": v dbname:*`SD}]bD{Frp{# v account:VS},ZCVS}.sXFw5}+ CPU 9Civ3FE"4kdU >D~# v interval:k},-}Ck}.s+=QXFwX$Lr4`Sn/#g{;8( 1ddt,G49C1!5 120 k# }g,dCD~PD7}ufrI\4p4gB: { Wake up once a second, the database name is sales, do accounting every 30 minutes. } interval 1; dbname sales; account 30; mS;)fr,b)fr8(*`SDu~M1fr@@*f1*I!DYw#} g,ITmSby;ufr,Cfr+$w%*(UOW)IKPD1d?^F* 1 !1,.s+;?Fk}]bO*,S,gBy>: setlimit uowtime 3600 action force; 3. #fCD~# XFwdCD~ 1t/XFw1,z*8(|,frDdCD~,b)frXFT}]bKPD&C Lr#XFw@@?ufr"1fr@@*f14P8(DYw# g{frhs|D,G4`-dCD~x;X#9XFw#?vXFwX$Lrlb =D~Q|D,"XBA!D~# XkZ;vgyP}]bVx20D?G G<#1`4U>G<1,|G|, CPU 3FE",b)E"43TC,SD O;vU>GGG

: 1. desc(I!):XZfrD"M,C}E(p 2. time(I!):Z@@fr1D1l1d 3. authid(I!):&CLrZdB4PodD;vr`vZ(j6 4. applname(I!):,S=}]bDI4PD~rTsD~D{F#K{FxV s!4#g{&CLr{P|,Uq,G4XkC+}E+&CLr{}p4# 5. setlimit:XFwliD^F#b)^FITG8n^F(}g,CPU 1d"5XD P}r_UP1d)DdP;n# 6. action(I!):1o=^F1*4PDYw#g{48(Yw,G41o=^F 1,XFwa+*&CLr$wDzmLrDEH65M 10#T&CLrDYwI T|(5MdzmLrDEH6,?F|k}]bO*,Sr*dYwhCwH! n# (}Z?ufrPv9C?vSd;N,ITiO`vfrSd4NI;ufr," CVEaxfr,gBP>}Py>: 118 w{}]bT\ desc "Allow no UOW to run for more than an hour" setlimit uowtime 3600 action force; desc "Slow down the use of db2 CLP by the novice user" authid novice applname db2bp.exe setlimit cpu 5 locks 100 rowssel 250; g{P`ufrJCZ3v&CLr,G4&CyPb)fr#(#,kWHv=D fr^F`XDYwGZ;v*&CDYw#g{frPD3vSd* -1,G4"zz 8(Dl##ZbVivB,*sxfrPDSd8(D5;\2GH0*`,Sd 8(D5:H0frPDd{SdTP'#}g,;ufr9C rowssel 100000 uowtime 3600 Sd48(g{&CLrDDC1dsZ 1 !1,r_g{|!q`Z 100000 P,G4&5MC&CLrDEH6#sxfr9C uowtime -1 Sd48(, ;&CLrI_P;\^FDDC1d#ZbVivB,g{&CLrKP 1 !1T O,;a|DdEH6#2MG5,uowtime -1 2G uowtime 3600#+G,g{|! q`Z 100000 P,G4IZ rowssel 100000 TP'xa5MdEH6# fr&CLrD3r XFwZdCD~PSD~%?=D~W?4&mfr#+G,g{sffrD setlimit SdH0fDfrI",G4Ta&CP|`^FDfr#}g,ZBfDdCD~ P,admin +;^F* 5000 Px;D3r8(#ZSdhvP,[] 8>I!Sd# I!D*<*X [desc] 8(CfrDD>hv#XkC%}Er+}E+Chv}p4# [time] 8(TCfrs5D1dN# Z 15 B XF}]bn/ 119 XkTBPq=8(C1dN:time hh:mm hh:mm,}g,time 8:00 18:00# g{;8(KSd,Cfr;l 24 !1# ^FSd setlimit 8(XFw*liD;vr`v^F#b)^F;\G -1 rsZ 0 (}g, cpu -1 locks 1000 rowssel 10000)# X k A Y 8 ( b ) ^ F (cpu"locks"rowsread M uowtime)PD;v,RCfr48(DNN^F< ;\CX(frD^F#XFwIliBP^F: cpu nnn 8(;v&CLrI{DD CPU k}#g{z8( -1,G4XFw; ^F&CLrD CPU 9C# locks nnn 8(;v&CLrIRpDx(}#g{z8( -1,G4XFw;^F &CLrRpDx(}# rowssel nnn 8(5XA&CLrDP}#K5+vZ-wLrZcO*Gc5# g{z8( -1,G4XFw;^FI!qDP}#I* nnn 8(Dn s5G 4294967298# uowtime nnn 8($w%*(UOW)SZ;Nxkn/4,*`XrSD X*(g{|k;vv>`XrSX*D0),"y]XFwy8( DzmLrEH64hCd`TEH6#;\9CXFw4DdC' (eD~q,`MS`PDzmLrEH6#`4,Xk9CC~q ,`rS`DzmLrEH6hC4XFZb)~q`PKPD&C Lr#+G,IT9CXFwZNN~q`P?F,S# ":Z AIX 5.3 O,5}yP_Xk_P CAP_NUMA_ATTACH \ &E\a_*&CLr$wDzmLrD`TEH6#*ZhK\ &,kT root C'm]G<"KPTB|n: chuser capabilities=CAP_NUMA_ATTACH,CAP_PROPAGATE force 8(?F*C&CLr9CDzmLr#("v FORCE APPLICA- TION TU9C-wzmLr#) Z 15 B XF}]bn/ 121 ": Z`Vx}]b73P,v1}Z&CLrD-w}]bVxOK PXFwX$Lr1,Ea4P?FYw#rK,g{}ZVx A O KPXFwX$Lr,x-w}]bVx*}]bVx B D3)&C Lr,v^F,G4ax}?FYw# schedule [class] wHIDF4P&CLrDzmLrDEH6,d?jG+=yl& 1duAnM,,1,$yP&CLr.dD+=T# XFwy]BP}vu~!qCZwHD08v&CLr: v Rps`}x(D&CLr K!n"Tu!x(H}}# v nID&CLr v _PnL@F#`KP1dD&CLr# K!n"TJmZ1ddtZjI!I\`DL1dn/Dod# xh?vu~PE{0};D&CLrHyPd{&CLr|_DE H6,2MG5,xh?vu~iPE{Z;D&CLrn_DEH 6,xhE{Z~D&CLrZ~_DEH6,T0xhE{Z}D &CLrZ}_DEH6#g{Pv&CLrZ`vu~PDu~!q 9 v&CLr,|GG?v`PE{0};D &CLr#g{8(`!n,Kfry!qDyP&CLr;4w% v`,"R!q 9 v&CLr"xh|GO_DEH6,gOyv# g{Z`vXFwfrP!qK3v&CLr,G4I!qKC&C LrDns;vfrXFC&CLr# ":g{9CK sqlmon(}]b53`Sw*X)API 4!{$nC od*X,b+0lXFwy]CodDC1d4XF&CLrD\ w9C`Sw4U/PXC53DE"#g{zZ}]b\ mwdCD~PXUKb)*X,G4TZ{v5},|2aXU, RXFw+;YSUKE"# wHYwIT: v 7#;,iPD?v&CLrq!1d,x;CZyP&CLr. dyHX.V1d# }g,g{ 14 v&CLr(}vLD"evPH$HMyv$D) ,1KP,G4|GDl&1dI\<\$,r*|G,19C CPU#}]b\m1IThC=vi:PH$HD&CLrM$& CLr#9CEH6,XFwJmyPLD&CLrKP,"7# n`}vPH$HD&CLrM}v$&CLr,1KP#*K, XFwdCD~|,;ukTPH$H&CLrDfr,M;uk T$&CLrDfr# 122 w{}]bT\ TB>}T>;vXFwdCD~D;?V,TY}5wb;c: desc "Group together medium applications in 1 schedule class" applname medq1, medq2, medq3, medq4, medq5 setlimit cpu -1 action schedule class; desc "Group together long applications in 1 schedule class" applname longq1, longq2, longq3, longq4, longq5, longq6 setlimit cpu -1 action schedule class; v 7#`vC'i(}g,z9T?E)PD?;v}T>;vXFwdCD~D;?V, TY}5wb;c: desc "Group together Finance department users" authid tom, dick, harry, mo, larry, curly setlimit cpu -1 action schedule class; desc "Group together Inventory department users" authid pat, chris, jack, jill setlimit cpu -1 action schedule class; desc "Group together Planning department users" authid tara, dianne, henrietta, maureen, linda, candy setlimit cpu -1 action schedule class; v JmXFwwHyPD&CLr# g{YwP4|(`!n,G4XFway]wHYwBn/&C LrDv}44(|T:D`,"y] DB2 i/`kw*C&CL rKPDi/yvDI>@F,4+b)&CLrCZ;,D` P#\m1IT;^(X!q&CLr,TwHyPD&CLr# 4,;a) applname r authid Sd,setlimit SdM;azzNN ^F# ":g{,}^FR48(YwSd,G4XFw5M4PC&CLrDzm LrDEH6# XFwdCD~>} TB>}T>;vXFwdCD~,|hC8uxYwDfr: Wake up once a second, the database name is ibmsampl, do accounting every 30 minutes. } interval 1; dbname ibmsampl; account 30; desc "CPU restrictions apply 24 hours a day to everyone" setlimit cpu 600 rowssel 1000000 rowsread 5000000; desc "Allow no UOW to run for more than an hour" Z 15 B XF}]bn/ 123 setlimit uowtime 3600 action force; desc ’Slow down a subset of applications’ applname jointA, jointB, jointC, quryA setlimit cpu 3 locks 1000 rowssel 500 rowsread 5000; desc "Have governor prioritize these 6 long apps in 1 class" applname longq1, longq2, longq3, longq4, longq5, longq6 setlimit cpu -1 action schedule class; desc "Schedule all applications run by the planning dept" authid planid1, planid2, planid3, planid4, planid5 setlimit cpu -1 action schedule; desc "Schedule all CPU hogs in one class which will control consumption" setlimit cpu 3600 action schedule class; desc "Slow down the use of db2 CLP by the novice user" authid novice applname db2bp.exe setlimit cpu 5 locks 100 rowssel 250; desc "During day hours do not let anyone run for more than 10 seconds" time 8:30 17:00 setlimit cpu 10 action force; desc "Allow users doing performance tuning to run some of their applications during lunch hour" time 12:00 13:00 authid ming, geoffrey, john, bill applname tpcc1, tpcc2, tpcA, tpvG setlimit cpu 600 rowssel 120000 action force; desc "Some people should not be limited -- database administrator and a few others. As this is the last specification in the file, it will override what came before." authid gene, hershel, janet setlimit cpu -1 locks -1 rowssel -1 uowtime -1; desc "Increase the priority of an important application so it always completes quickly" applname V1app setlimit cpu 1 locks 1 rowssel 1 action priority -20; XFwU>D~ ?1XFwX$Lr4PYw1,|+;uG<4k|DU>D~#Yw|(TBw n: v ?F&CLr v A!XFwdCD~ v |D&CLrEH6 v v=msr/f v t/rax ?vXFwX$LrD~P#@"DU>D~@9D~x(? 1,K?1I\aZm`XFwX$Lr,14k,;vD~1zz#*+U>D~ O"Z;p"i/|G,I9C db2govlg 5CLr# U>D~f"Z sqllib ?D~ Dy>{F#7#U>D~{|,}]b{F,TxV\XFD?v}]bVxOD 124 w{}]bT\ U>D~#*K7#D~{TZVx}]b73PD?vXFwG(;D,T/+K PXFwX$LrD}]bVxE7SAU>D~{# U>D~GD~PD?vG<_PBPq=: Date Time NodeNum RecType Message ":Date M Time VNDq=* yyyy-mm-dd hh.mm.ss#IT(}TKVNxPEr4 O"?v}]bVxDU>D~# NodeNum VN8>XFwKPyZD}]bVxD`E# RecType VN|,;,D5,b!vZ4kCU>DU>G STOP STOP G FORCE ?1XFw7(y]XFwdCD~PDfrh*?F9C&CLr1,Ma `4 FORCE G<#FORCE G<_PTBq=: dP: 8(&CLrD-w}]bVxD`E# 8(XFwdCD~P a)PX,vfrDivDj8E"#bI|,BP5: v CPU:\&CLr USR cpu S SYS cpu 1d(TkF) v Locks:&CLrVPD\x(} Z 15 B XF}]bn/ 125 v Rowssel:&CLr!qD\P} v Rowsread:&CLrA!D\P} v Idle:&CLrUPD1d v ET(DC1d):TSt/&CLrD10$w%*T4DDC1 d(,}K uowtime setlimit) NICE NICE G () dP: 8(+T&CLrDzmLrDEH65ywDvs(ru!)# 8(XFwdCD~P a)PX,vfrDivDj8E"#bI|,BP5: v CPU:\&CLr USR cpu S SYS cpu 1d(TkF) v Locks:&CLrVPD\x(} v Rowssel:&CLr!qD\P} v Rowsread:&CLrA!D\P} v Idle:&CLrUPD1d v ET(DC1d):TSt/&CLrD10$w%*T4DDC1 d(,}K uowtime setlimit) ERROR ERROR G: v wC sqlefrce API T?F9C&CLr,+C API 5X}D SQLCODE# v lUwC5X"G 1611(“SQL1611 ;5XNN}]”)D}D SQLCODE# v lUwC5X"G -1224(“SQL1224N ;\t/}]bzmLr4&mks, r _ } ] b z m L r r } ] b 5 3 X U r ? F | n x U9” ) r -1032(“SQL1032N ;P"vNNt/}]b\mw|n”)D:D SQLCODE#b)5XkZXUH0n/D>}s"z# v Z UNIX 73P,"T20EE&mLr,+"T'\# ACCOUNT ACCOUNT G: v TON*K&CLr`4 ACCOUNT G SCHEDGRP SCHEDGRP G dP: 8(XFwdCD~P a)PX,vfrDivDj8E"#bI|,BP5: v CPU:\&CLr USR cpu S SYS cpu 1d(TkF) v Locks:&CLrVPD\x(} v Rowssel:&CLr!qD\P} v Rowsread:&CLrA!D\P} v Idle:&CLrUPD1d v ET(DC1d):TSt/&CLrD10$w%*T4DDC1 d(,}K uowtime setlimit) r*4kDGj<5,zIi/;,`MDYwDU>D~#Message VNa)d{G j Message VNPD&CLrE",x ERROR G<|(ms{"# gBy>G;vU>D~>}: 1995-12-11 14.54.52 0 START Database = TQTEST 1995-12-11 14.54.52 0 READCFG Config = /u/db2instance/sqllib/tqtest.cfg 1995-12-11 14.54.53 0 ERROR SQLMON Error: SQLCode = -1032 1995-12-11 14.54.54 0 ERROR SQLMONSZ Error: SQLCode = -1032 XFwU>D~i/ ?vXFwX$Lr<4kT:DU>D~P#I9C db2govlg 5CLr4i/CU >D~#I4UZM1dEr4P>%v}]bVxMyP}]bVxDU>D~# 2Iy] RecType U>VNxPi/#db2govlg Do(gBy>: b)N}gBy>: log-file zki/D;vr`vU>D~Dy>{F# nodenum node-num XFwKPyZD}]bVxDZcE# db2govlg log-file nodenum node-num rectype record-type < 19. db2govlg Do( Z 15 B XF}]bn/ 127 rectype record-type zki/DGD~,T7($wD~M8]D;C,"bT8]}L#Kb, liLr|,T7#ZI\1tCT\!n,gPVi# z&CQZ&CLr`LMbTWNo=by;v1r,4,+Jmz4(ymMyM'X7MJ';+G,9XkO"d{ 8vm,T&mM/IyPh*DJ'BqE"#&m;vJ'yhD$w ?KT,;v\ZZXk&mD8'vJ',ZbVivB,I\Z!D1 dH9a_T\*s# 130 w{}]bT\ v P;C&CLro= I/O ^ F,x;G CPU D9Co=z:I#y,RI\^(43C'h*#*a)< 7D#b,ymD5J T\# db2batch yN}|DyzzD0 l# 1KPy|,|DH04 ,,4Q<8CxPBNbT# – 9C IMPORT r LOAD 5CLr44-C}]D#K=(;Jm4- \0lD}]#&T|,K}]DmMw}KP REORG M RUNSTATS 5CL r# v *+&CLr5XA|D-<4,,+&CLrXBs(A}]b# E(p4,q-TB=hr|z4T}]b&CLr4Pys!,|&Z&CLrD%*bTM53bTZd7(# v *K9&CLr\;KPxXk|DDN}(4,*@9vVodQZfC jb`B~x# K}/Lr+4Py} y: ":Of(fPD}]v)5w.C#|;m>b?Da{# VvT>:CONNECT(od 01)C% 1.34 k,OPEN CURSOR(od 10)C% 2 VS 8.15 k,FETCHES(od 15)5X_PRSY1dn$,* .28 k,CLOSE CURSOR(od 20)C% .84 k,x CONNECT RESET(od 99)C% .03 k# g{zDLrIT(gD ASCII q=dv}],G4ITZTs+C}]dvI\G: Test Iter. Stmt Timing SQL Statement Numbr Numbr Numbr (hh:mm:ss.ss) 002 05 01 00:00:01.34 CONNECT TO SAMPLE 002 05 10 00:02:08.15 OPEN cursor_01 002 05 15 00:00:00.24 FETCH cursor_01 002 05 15 00:00:00.23 FETCH cursor_01 002 05 15 00:00:00.28 FETCH cursor_01 002 05 15 00:00:00.21 FETCH cursor_01 002 05 15 00:00:00.20 FETCH cursor_01 002 05 15 00:00:00.22 FETCH cursor_01 002 05 15 00:00:00.22 FETCH cursor_01 002 05 20 00:00:00.84 CLOSE cursor_01 002 05 99 00:00:00.03 CONNECT RESET < 20. ya{ Z 16 B yNNb?Da{# PARAMETER VALUES FOR EACH BENCHMARK TEST TEST NUMBER 001 002 003 004 005 locklist 63 63 63 63 63 maxappls 88888 applheapsz 48 48 48 48 48 dbheap 128 128 128 128 128 sortheap 256 256 256 256 256 maxlocks 22 22 22 22 22 stmtheap 1024 1024 1024 1024 1024 SQL STMT AVERAGE TIMINGS (seconds) 01 01.34 01.34 01.35 01.35 01.36 10 02.15 02.00 01.55 01.24 01.00 15 00.22 00.22 00.22 00.22 00.22 20 00.84 00.84 00.84 00.84 00.84 99 00.03 00.03 00.03 00.03 00.03 < 21. yF1(f 134 w{}]bT\ Z 17 B hFKJLr DB2 hFKJLrG;v$_,IozzTxa_$w:XT\#!q**4S$w: X4(D)w}"MQT"/:,r}]bVxDNqI\anK.V74#“hFKJ Lr”j6Ka_$w:XT\yh*DyPTs#g{$w:XPfZ;i SQL o d,G4“hFKJLr”+*BPwna);)(i: v BDw} v BD_e/i/m(MQT) v 7(/:w}DmS v T`,/:(MDC)mD*; v mDYV" v ((} GUI $_)>}8(D$w:X49CDw}M MQT IT9C“hFKJLr”"45Vb)(iPD;?V(iryP(i,2IT2E Ts5Vb)(i# “hFKJLr”IT9C“hFKJLr”GUI r|nP$_4ozr/BPNq: f.r("BD}]b 1hF}]b1,9C“hFKJLr”44PBPNq: v ZVx}]b73rw}"MQT M MDC mDbT73PzIhF8Cn# v TZVx}]b73,IT9C“hFKJLr”4jIBPNq: – +}]0k}]b07(}]bVx_T# – ozS%;Vx DB2 }]b(F=`Vx DB2 }]b# – ozSm;v}]bz7(F=`Vx DB2 }]b# v TQV/zIDw}"MQT"MDC mr}]bVx_TxP@@# $w:XT\w{ Z("}]b.s,IT9C“hFKJLr”4: v a_X(odr$w:XDT\# v a_\e}]bT\,9Cy>$w:XDT\w*b?j<# v a_n514PDi/(}g,I“n/`Xw”j6Di/)DT\# v 7(gNE/B|i/DT\# v T“KP4vPD”a)D;)(iwvl&,b)(iGkT2mZf5C Lrr_Ps?ErD$w:XPDErQJbavD# v iR$w:XP49CDTs# hFKJLrdv g{9C“hFKJLr”GUI,G4ITS“hFKJLr”Pi4"#fr5V(i# g{S|nPKP“hFKJLr”,G41!ivB+Qdvr!Aj5CLrDt/1dM#91d# v g{5CLrI&ax,G4 STATUS VN+|,“COMPLETED”# v MODE VN8>Gq9CK -m !n# v COMPRESSION VN8>9CD9u`M# IT9C -o !n+“hFKJLr”(i#fA3vD~##fD“hFKJLr”dv| ,BP*X: v *BDw}"MQT"}]bVx_TM MDC ma)D CREATE STATEMENTS# v * MQT a)D REFRESH od# v *BTsa)D RUNSTATS |n# v g{9CKVP MQT Mw}"R9C|G44P$w:X,G4|G+vVZ(i DE>P# ":ADVISE_MQT mD COLSTATS P|, MQT DP3FE"#3FE"IC XML a9,gBy>: COLNAME1 1000 999 2 .... COLNAME100 55000 49999 100 9mSy]d(ew}Dy>m#I9C benefit 5Tw}M MQT xPE{#2I T9C“benefit - 0.5**z”T MQT xPE{,"9C“benefit - overhead”Tw}x PE{#w}M MQT DPmsfG$w:XPDodPm,|( SQL D>"od `E"y](i@FDT\a_(Dx),T0od9CDm"w}M MQT DP m# ":Kdv#tK SQL D>PD-V* 80 vV{Dx"MP# MDC MVx4w7T>ZK XML dvP#KdvD>}gBy>: 136 w{}]bT\ -- -- -- -- --MQT612152202220000 --ZILIO2 -- --3 --1013562.481682 --1468328.200000 --0.004906 -- ..... -- -- --IDX612152221400000 --ZILIO2 -- --

--PART --TPCD --
--22 --820160.000000 --0.000000 --9.063500 -- ..... -- --11 -- -- -- select -- c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, -- sum(l_quantity) from tpcd.customer, tpcd.orders, -- tpcd.lineitem where o_orderkey in( select -- l_orderkey from tpcd.lineitem group by l_orderkey -- having sum(l_quantity) > 300 ) and c_custkey -- = o_custkey and o_orderkey = l_orderkey group by -- c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice -- order by o_totalprice desc, o_orderdate fetch first -- 100 rows only -- -- -- --MQT612152202490000 --ZILIO2 -- -- --ORDERS --TPCD -- -- --CUSTOMER --TPCD -- -- --IDX612152235020000 --ZILIO2 -- -- --IDX612152235030000 --ZILIO2 -- -- --IDX612152211360000 --ZILIO2 Z 17 B hFKJLr 137 -- -- --2091459.000000 --1 -- "b,XML a9IT|,`vP#TZ?;P,aT>Py}(4,CPPD5D v})T0 high2 M low2 |(I!)# 1a)K MQT"}]bVxr MDC (i1,`XD ALTER TABLE f"}LwC |nEZ ADVISE_TABLE D ALTER_COMMAND PP# ":ALTER TABLE f"}LwC|nI\arT ALTOBJ f"}LDmD^Fx' \# ZxP;)8"D^D.s,IT+KdvD~w* CLP E>4KPT4((iDT s#zI\k4PD^D|(: v +yP RUNSTATS |nodiO*TBTsrQ^DDTsD%v RUNSTATS w C# v a)H53zIDj6|JCDTs{# v }%r"Mt;k"45VDTsDNN DDL# 9ChFKJLr ITS|nPKPhFKJLr,2IT9CXFPDPD“hFKJLr”GUI 4KP CLr# v XFPD=(: 1. (e$w:X#kNDZ 139 3D:(e“hFKJLr”D$w:X;# 2. r*XFPD# 3. ZXFPDP,(}4PTBYw4KPhFKJLr:CsjR|%wJ1D }]br}]bPDX(w},;sS/vK%P!q“hFKJLr”# 4. ZhFKJLrzI(ijIs,zIT!q+b)(i#f=;v(fP,2 ITChFKJLr5V3)r+?(i# v |nP=(: 1. (e$w:X#kNDZ 139 3D:(e“hFKJLr”D$w:X;# 2. T$w:XKP db2advis |n# ":g{}]b3FE";GnBD,G4zID(iM;G4I?# 3. bM db2advis Ddv"xPX*D^D# 4. 5)!qDhFKJLr(i# 138 w{}]bT\ (e“hFKJLr”D$w:X $w:XG}]b\mwXkZx(1dNZ&mD;i SQL od#}g,Z;vB D1dZ,}]b\mwI\Xk&m 1000 v INSERT"10000 v UPDATE"10000 v SELECT M 1000 v DELETE#“hFKJLr”+Vv8(D$w:X"Rn!D;)(iD}]bDXw# S“hFKJLr”GUI $w:X3P,IT4(BD$w:XD~,r_^DH0QP D$w:XD~#ITSTB8V4+;)odD~ v B~`Swm v Query Patroller z7G<}]m((}S|nP9C -qp !n) v EXPLAINED_STATEMENT mPD5wod v 9C DB2 lU6q=DnB SQL od# v $w:X\mwn/m v $w:X\mwB~`Swm((}S|nP9C -wlm !n) ZD;v r`v4PCod`Td{odZ$w:XPvVDN}# }g,;vX(D SELECT odZ$w:XPvVK 100 N,xm;v SELECT odvVK 10 N#*Km>b=vodD`T5J,IT8(Z;v SELECT odD5J* 10,Z~v SELECT odD5J* 1#IT(}ZX(odsf ekBfb;P4V/|DCodZ$w:XP_PD5Jr(X - # SET FRE- QUENCY n,dP n Gk**Cod8(D5J5# 3. (}9C -i !n"Rsz$w:XD~D{F4KP db2advis |n# v *T ADVISE_WORKLOAD mP|,D$w:XKP“hFKJLr”,KPxP -w !n"Rsz$w:X{FD db2advis# Z 17 B hFKJLr 139 9ChFKJLrS%;Vx(F=`Vx}]b IT9C“hFKJLr”4ozzS%;Vx(F=`Vx}]b#“hFKJLr”I a)PXV<}]D(i,,1a)PXBw}"_e/i/m(MQT)M`,/: (MDC)mD(i# 1. 9C db2licm |n"a DB2 z7r&\?~mI$\? 2. Z`Vx}]bVxiPAY4(;vmUd# ":r*“hFKJLr”;\(iTVPmUdYV"}],yTZKP“hFK JLr”.0,Vx}]bPXkfZzk*“hFKJLr”},G4TZ IMMEDIATE MQT,+;|(|D(}g,|B)MQT DT\# v v1*!q`,/:1,E(i4(/: RID w}#KJLr+Q RID /:w }w*;v!n4x;G*m4( MDC a9# 2. TZ MQT (iD^F v “hFKJLr”(i;*9Cv? MQT#g{k*4(v? MQT,I9C REFRESH IMMEDIATE MQT "9Cz!qDG(m4+|G*;*v? MQT# v T MQT (iDw}C4a_$w:XT\x;G MQT "BT\# v g{8(D$w:XP;|(|B"ekr>},G4;P# ZKivB,+zI/f{"# v +x}(4,;}b)m#g{44Pj“hFKJLr”,I\a}b)mPD3) m#ZKivB,IT(}S|nPXBt/5CLr49C“hFKJLr”>} b)m#*}%#b? 9.5 *<,-f !nG1!5#bm>g{T!qD MQT KP db2advis, G4}]b\mw+9Ck#={`,DC'j6T/>}yP>X#b?}CP"d5|D# Ts,g{&CLr A T}# v CqAVs#ZBPivB+vVCqAVs: 1. zD&CLr4P;vi/,Ci/y]3)Qwu~A!;iP# 2. m;v&CLrekB}]r|BVPD}]TzczD&CLri/# 3. zD&CLrS=h 1 *}rekI\a0la{ mDP#“IX4A”&CLr;\i4d{&CLrD4d5|D# {C“IX4A”,+ax(}CD?;P,x;vvGlwDG)P#4PKJ1D x(,rKd{&CLr;\ekr|BP(CPI\*mS=i/y}CDPDP mP,g{XB4Pi/D0)#b+@9vVCqP#}g,g{z(h 10000 P" T|G&C=J,!\;P 10 Pzcu~,+Tax(+?D 10000 P# ":“IX4A”tk6p7#Z&CLr4=}].0yP5XD}]<#V;d, 499CKY1mrPVi2GgK# IZ“IX4A”I\qCMRps?x(,rKb)x(I\,vIw* locklist M maxlocks dCN}DP'a{Dx(}#*K\bx(}6,E/wZO*\I\a" zx(}6D1r,I\!q"4qC%vm6px(CZw}(h#bMq}]b \mwzmz"vK;v LOCK TABLE od;y#g{;kqCm6px(,7#P c;Dx(ICZCBqr9C“AH(T”tk6p# @@}C}1,“AH(T ”;x(^(DP#by,9C“AH(T”1,;lw 10 P,R;TG.PRpx(# +|k“IX4A”TH,ZK>}P,IX4AaZyPD 10000 PORpx(#Rp Dx(ITG2m"BN2m"|Br%bx(# ":“AH(T”tk6p7#Z&CLr4=}].0yP5XD}]#V;d,4 99CKY1mrPVi2GgK# “AH(T”tk6pDdP;v?jGa)O_"PTLHT0}]DH(S<#* KPzZo=K?j,E/w7#Z"zx(}60;q!m6x(# “AH(T”tk6pnJCZ|(BPyPXwD&CLr: v Z""73BKP v h*^(3)PZ$w%*KPZd#VH( v Z$w%*P;a`N"v`,Di/,r_Z,;$w%*P"v`Ni/1" ;*sCi/qC`,DXp# NjH(T NjH(T(CS)1ZPO(;Nj1ax(NNI&CLrDBqyCJDP#K x(ZA!B;PrU9Bq.0P'#+G,g{|DK3;PODNN}],G 4ZT}]bd5|D.0XkRpCx(# TZ_P“NjH(T”D&CLrQlwDP,1CPOPNNI|BDNj1,N Nd{&CLr<;\|Br>}CP#“NjH(T”&CLr;\i4d{&CL rD4d5|D# YN}C(h 10000 PD>},g{9C“NjH(T”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qC%vBqmx(|I!: v mG;AD,R+,x;PJm&CLrd5MECx(DBq#*\bZbVivB#9 &CLr,+ locktimeout dCN}hC*NN&CLr&H=q!x(Dn$1d# hCKN}PzZ\b+V@x,XpGZV<=$w%*(DUOW)&CLrP# g{x(ks&Z]RD1dsZ locktimeout 5,G4ks&CLr+SU=;vm s"+dBqXv#}g,g{ APPL1 "Tq!;vQI APPL2 RpDx(,G4 Z 18 B &CLr"bBn 153 APPL1 Z,1\Z=Z15X SQLCODE -911(SQLSTATE 40001),-rk* 68#locktimeout D1!5* -1,|XUx(,1lb# ":TZm"P"}]VxM MDC ix(,&CLrI9C SET CURRENT LOCK TIMEOUT 42G}]b6p locktimeout hC# *zIXZx(,1D(fD~,+ DB2_CAPTURE_LOCKTIMEOUT "amd?h C* ON#x(,1(f|(XZmDj8E",gx({F"x(`M"Pj6"mUdj6 Mmj6# *+PXx(ks,1D|`E"Gk db2diag.log D~,+}]b\mwdCN} diaglevel hC* 4#Gwq!PX x(H}}Mx(,1DE"# x(,1(f x(,1(f&\6qXZx(,1B~DE",|(XZ(g{JCD0,kND Z 156 3D:&\V^T; TKbj 8E"#) v &CLr4, v 10Yw 154 w{}]bT\ v x(}6 x(yP_rzm I\P`vx(yP_#}g,13vx(;`v&CLrT2m==5P 1,v(fXZv=DZ;vx(yP_DE"#Z;vx(yP_Gd{x (yP_Dzm# v &CLrj6E",g&CLr{FM-wLrVx v 5PDx(== v KVxP10n/D SQL odDPm 1. Lr|j6 2. Nu?E 3. SQL E",}g,odG/,9G2,D,odD`M 4. P'Dx(tk 5. `XodD>(ZIC1) v K}]bVxD10$w%*PD;n/ SQL odDPm(v1_Podz 7G(ZIC1) *U/d{E"(}g,Yw53rd{`X73E"),k9C(F db2cos E># &\C> DB2_CAPTURE_LOCKTIMEOUT "amd?XFx(,1(f&\# 1K"amd?hC* ON 1,C&\6qXZ DB2 5}P"zD?vx(,1Dy >E","R4(x(,1(f#g{C"amd?hC*U,G4C&\;{C# *tCx(,1(f&\,k"vTB|n: db2set DB2_CAPTURE_LOCKTIMEOUT=ON *{Cx(,1(f&\,k"vTB|n: db2set DB2_CAPTURE_LOCKTIMEOUT= Z3)ivB,zI\#{6q"zx(,1.0Zx(yP_D$w%*P4PD yPod#}g,g{x(,1GIH04PD SQL odzzD,G4byv\PC# *+$w%*T0Dz7G<|(Z10x(yP_Dx(,1E"P,9Codz 7G}P,APPL2 4PD SELECT od}ZH} APPL1 4PDH0 INSERT o dPq!DPx(#ZbViv,;4= APPL1 104PD SELECT od;\oz 7(x(yCD_e-r#x(yP_Dodz7G<+T>H0 INSERT odMx( yCD-r# g{5Px(D&CLrZx(,1DivB4KP SQL od,G44(_Podz 7G<&\DB~`Sw2Poz#g{_Pz7GDiv),"GyPE""GZyPivBGmTs(gLr|)rCZd{ Z? DB2 &m# x(,1(fD~ Zx(,1(f&\&Zn/4,DivB,g{"zx(,1,G4SUx(,1 msDzmLr+zI;v(fD~#KD~ECZ"zx(,1msD}]bVx DoO}]?<76P# IT9C}]b\mwdCN} diagpath 4(eoO}]?<76#g{4hCKN },G4D~;C+;,#kND diagpath N}hvTKb(fD~D;C# 156 w{}]bT\ ZVx}]b73P,;v&CLrIT,1Z;vr`v}]bVxO4P$w" q!x(#(}*?v"zx(,1JbD}]bVxzI(f,x(,1(f&\ IoztkX(}]bVx#(f|(XZCVxO"zDx(,1JbD(;OB DE"# (ff"Z9CTB{Fq=DD~P:db2locktimeout.par.AGENTID.yyyy-mm-dd-hh- mm-ss,dP v par G}]bVxE#ZGVx}]b73P,par hC* 0# v AGENTID GzmLrj6# v yyyy-mm-dd-hh-mm-ss G1dAG,Ij"B"U"!1"VSMkiI# T B G ; v x ( , 1 ( f D ~ { D > } : /home/juntang/sqllib/db2dump/ db2locktimeout.000.4944050.2006-08-11-11-09-43# ":1;Yh*x(,1(fD~1,kS?}#r*(fD~kd{ oOU>;Z`,;C,yTZC?ZPD=h4zIdMDx(,1(f#Y(K>}P9CD MYDB2 }] bQfZ# 1. ,SA}]b MYDB2: db2 connect to mydb2 2. 4(;vF* T1 Dm: db2 create table T1 ( c1 int ) 3. 4gBy>+5ekCmP: db2 insert into T1 values 0,1,2,3,4,5,6,7,8,9 4. 4(F* TESTIT DB~`Sw: db2 create event monitor testit for deadlocks with details history write to table autostart 5. $nCB~`Sw: db2 set event monitor testit state 1 6. d5ywD|D: db2 commit 7. tCx(,1(f/}: db2set DB2_CAPTURE_LOCKTIMEOUT=ON 1Z=v%@D CLP 0ZPKPD=v&CLrCJ MYDB2 1,9CBP=h44 (x(,1#Z;v CLP 0Z+C4KP Appl1 &CLr,Z~v CLP 0Z+C4 KP Appl2 &CLr# 1. Z+KP Appl1 &CLrDZ;v CLP 0ZP,dkBP|n: db2 connect to mydb2 db2 commit 2. Z+KP Appl2 &CLrDZ~v CLP 0ZP,dkBP|n: db2 connect to mydb2 db2 set lock timeout 1 Z 18 B &CLr"bBn 157 ":Zzz73P,(i;*+x(,11ddthC* 1 k# 3. ZZ;v CLP 0ZP,dkBP|n: db2 +c declare c1 cursor for select tabname from syscat.tables db2 +c open c1 db2 +c fetch c1 db2 +c insert into T1 values 8 ":9C +c !n1+XUT/d5&\# 4. ZZ~v CLP 0ZP,dkTB|n: db2 "select * from T1" Appl1 +Tm T1 Rp%bG}P|(DPE;Gx(,1(fD;?V#Z;,D DB2 "PfP,7 3Py4(D(fDq=I\T"Py;,,IZv?K(f&\,rKI\amS BVN# m 7. x(,1(fZ] x(,1(f?V hv 1.x(,1(f 2.UZ: 07/01/2007 3.1d: 15:22:13 4.5}: juntang 5.}]b: MYDB2 6.}]bVx:000 Z 2 P=Z 6 P8>"zx(,1D1dM;C: v }]bVxD1XUZ:2007 j 1 B 7 U# v }]bVxD1X1d:15:22:13# v }]b5}{:juntang# v }]b{F:MYDB2# v VxE:0# 7.x(E": 8.x({F: 0002000A000000000300000B52 9.x(`M: P 10.x(8Z: mUdj6 =2,mj6 =10, Pj6 = x000000000300000B Z 7 P=Z 10 PT>"z,1Jb1Dx(E": v x({F:0002000A000000000300000B52# v x(`M:P,|8>TX(PxPx(# v R p x ( D m U d " m M P D j 6 V p * 2 " 10 M x000000000300000B#IT9CKE""(}i/ SYSCAT.TABLES 5 3?P4Tx(ks_y9CDx(xP}6# 24.x(ksDOBD: 25. j6:UOW j6(28);n/j6(1) 26. n/E": 27. Lr|#=:(NULLID) 28. Lr|{F:(SQLC2F0A) 29. Lr|f>:() 30. Zu?E: 201 31. SQL `M: /, 32. od`M:DML,!q(Ih{) 33. P'tk: NjH(T 34. od Unicode j>: q 35. od: select * from t1 Z 24 P=Z 35 Pa)KPXx(ks_yKPD SQL odDj8E ": v x(ks_D10 UOW Dj6(28)T0C UOW PDn/j6 (1)# v Lr|#=:NULLID# v Lr|{F:SQLC2F0A# v x(ks_}ZKPD SQL odDZE:201# v SQL `M:/,#m;vP'5*“2,”# v odYw`M:DML,!q(Ih{)#d{P'5|( DDL Yw# v *x(ks_hCDtk==:NjH(T(CS)# v SQL od:SELECT * FROM T1# ": TZ2, SQL od,“od”VNI\*U#*7(2, SQL od D>,IT9C“Lr|{F”"“Lr|#=”"“Lr|f>”M“Zu? E”b)VNPD54i/53?}Py>: SELECT SEQNO, SUBSTR(TEXT,1,120) FROM SYSCAT.STATEMENTS WHERE PKGNAME = ’Package Name value’ AND PKGSCHEMA = ’Package Schema value’ AND VERSION = ’Package Version value’ AND SECTNO = Section Entry Number value r*Ki/I\a:() 51. Zu?E:1 52. SQL `M: /, 53. od`M:DML,!q(Ih{) 54. P'tk: NjH(T 55. od Unicode j>: q 56. od:select tabname from syscat.tables 57. 10 UOW P;n/ SQL odDPm: 58. u?: #1 59. j6:UOW j6(7);n/j6(2) 60. Lr|#=:(NULLID) 61. Lr|{F:(SQLC2F0A) 62. Lr|f>:() 63. Zu?E: 203 64. SQL `M: /, 65. od`M:DML,Insert/Update/Delete 66. P'tk: NjH(T 67. od Unicode j>: q 68. od: insert into t1 values 8 Z 45 P=Z 68 PT>Kx(yP_D SQL odz7G<#b)E" `FZZ 24 P=Z 35 P.dDx(ks_Dn/E": v Z 46 P=Z 56 Pa)KPXx(yP_D10 SQL odDE"# x(VP_DodI\;IC#1x(VP_y&mDns;vod KPjO.sMa"zbViv# v Z 57 P=Z 68 Pa)KPXH0Zx(yP_D UOW PKPR P4d5D;n/ SQL odDE"#ZK>}P,;P;v;n/D SQL od;xZd{73P,I\P`v;n/D SQL od# y>x(,1(f >ZT>KZ;,ivBzIDx(,1(f: v 9C/, SQL(x(yP_44P$w) v 9C/, SQL(x(yP_}Z4P3)$w) v 9C2, SQL iv 1:9C/, SQL(x(yP_44P$w) Ky>T>46qodz7G<"Rx(yP_1044PNN$wDivBzID x(,1(fDZ]#g{_Podz7G P,x(VP_104KP SQL od;rK,;PI*x(VP_(fDn/od# x(,1(f UZ: 06/11/2006 1d: 18:36:43 5}: juntang }]b: MYDB2 }]bVx: 000 x(E": 160 w{}]bT\ x({F: 00020002000000070000000052 x(`M: P x(8Z: mUdj6 =2,mj6 =2,Pj6 = 00000007 x(ks_: 53Z(j6: JUNTANG &CLrdz: [1-53] &CLrj6: *N1.juntang.061106233631 &CLr{F: db2bp "vksDzmLrj6: 1024114 -wzmLrj6: 0 -wLrVx: 1 x(,15: 1000 Ak ksDx(==: .NS &CLr4,: (SQLM_UOWEXEC) 10Yw: (SQLM_FETCH) x(}6: q x(ksDOBD: j6:UOW j6(2);n/j6(1) n/E": Lr|#=:(NULLID) Lr|{F:(SQLC2E07) Lr|f>:() Zu?E: 201 SQL `M: /, od`M: DML,!q(Ih{) P'tk: NjH(T od Unicode j>: q od: select * from T1 x(yP_(zm): 53Z(j6: JUNTANG &CLrdz: [0-53] &CLrj6: *N0.juntang.061106233613 &CLr{F: db2bp "vksDzmLrj6:1429550 -wzmLrj6: 1429550 -wLrVx: 0 5PDx(==: ..X n/D SQL odDPm:4a) 10 UOW P;n/ SQL odDPm:4a) iv 2:9C/, SQL(x(yP_}Z4P3)$w) Ky>T>6qodz7G<"Rx(yP_10}Z4P3)$wDivBzID x(,1(fDZ]#*x(VP_6qKodz7G<,r*_Pz7G:() Zu?E: 201 SQL `M: /, od`M: DML,!q(Ih{) P'tk: NjH(T od Unicode j>: q od: select * from T1 x(yP_(zm): 53Z(j6: JUNTANG &CLrdz: [0-55] &CLrj6: *N0.juntang.061106234256 &CLr{F: db2bp "vksDzmLrj6: 1102052 -wzmLrj6: 1102052 -wLrVx: 0 5PDx(==: ..X n/ SQL odDPm: u? #1 j6:UOW j6(2);n/j6(2) Lr|#=:(NULLID) Lr|{F:(SQLC2E07) Lr|f>:() Zu?E:1 SQL `M: /, od`M: DML,!q(Ih{) P'tk: NjH(T od Unicode j>: q od: select tabname from syscat.tables 10 UOW P;n/ SQL odDPm: u? #1 j6: UOW j6(2);n/j6(4) Lr|#=:(NULLID) Lr|{F:(SQLC2E07) Lr|f>:() Zu?E: 201 SQL `M: /, od`M: DML,!q(Ih{) P'tk: NjH(T od Unicode j>: q 162 w{}]bT\ od: select * from T1 u? #2 j6: UOW j6(2);n/j6(3) Lr|#=:(NULLID) Lr|{F:(SQLC2E07) Lr|f>:() Zu?E: 203 SQL `M: /, od`M: DML,Insert/Update/Delete P'tk: NjH(T od Unicode j>: q od: insert into T1 values 7 u? #3 j6: UOW j6(2);n/j6(1) Lr|#=:(NULLID) Lr|{F:(SQLC2E07) Lr|f>:() Zu?E: 203 SQL `M: /, od`M: DML,Insert/Update/Delete P'tk: NjH(T od Unicode j>: q od: insert into T1 values 8 iv 3:9C2, SQL Ky>T>_Podz7G:() Zu?E: 3 SQL `M: 2, od`M: DML,Select P'tk: NjH(T od Unicode j>: q od: ;IC x(yP_(zm): 53Z(j6: SVTDBM9 &CLrdz: [0-78] &CLrj6: *N0.svtdbm9.061105192017 &CLr{F: am25c "vksDzmLrj6:6111474 -wzmLrj6: 6111474 -wLrVx: 0 5PDx(==: ..X n/ SQL odDPm: u? #1 j6: UOW j6(1);n/j6(4) Lr|#=:(ABSOLUT) Lr|{F:(AM0PC_L0) Lr|f>:() Zu?E: 3 SQL `M: 2, od`M: DML,Insert/Update/Delete P'tk: NjH(T od Unicode j>: q od: 10 UOW P;n/ SQL odDPm: u? #1 j6: UOW j6(1);n/j6(3) Lr|#=:(ABSOLUT) Lr|{F:(AM0PC_L0) Lr|f>:() Zu?E: 4 SQL `M: 2, od`M: DML,Insert/Update/Delete P'tk: NjH(T od Unicode j>: q od: u? #2 j6: UOW j6(1);n/j6(2) Lr|#=:(ABSOLUT) Lr|{F:(AM0PC_L0) Lr|f>:() Zu?E:1 SQL `M: 2, od`M: DML,Insert/Update/Delete P'tk: NjH(T od Unicode j>: q od: u? #3 j6: UOW j6(1);n/j6(1) Lr|#=:(ABSOLUT) Lr|{F:(AM0PC_L0) Lr|f>:() Zu?E: 2 SQL `M: 2, 164 w{}]bT\ od`M: DML,Insert/Update/Delete P'tk: NjH(T od Unicode j>: q od: x(*; |DQRpDx(==F**;#1;vxLCJ|QRpx(D}]Ts,RCJ ==h*HQRpDx(|OqDx(1,+xPx(*;#;vxLZN;1dT }]Ts;\Rp;vx(,!\|IT(}i/dSXT,;}]Ts`Nksx (# 3)x(==vJCZm,xP)x(==vJCZPri#TZPri,g{h* X RRp S r U(|B)x(,G4xP*;# +G,Zx(*;b;cO,IX(br%b)M S(2m)x(GXbiv#S M IX x(DOqLH`1,yTg{RpK;vxksm;v,G4a{*;* SIX(xb r%bD2m)x(#g{yksD==|OqD0,yPd{D*;<}mPDP,r+PekmP# T%b==x(m k*|BmDs?V#`TZ|Bm1x(?;P,;sZd5yP|D1 bxPxT,h9yPd{C'CJCmD*zY"R|P'# 9C LOCK TABLE IN EXCLUSIVE MODE,yPd{C'<;x(Zb; ;Pd{&CLrITCJCm,}G|GG4d5DA&CLr# v Z&CLrP9C ALTER TABLE od# x LOCKSIZE N}D ALTER TABLE odG LOCK TABLE odD8Cod# LOCKSIZE N}Jmz8(B;NmCJD ROW x(r TABLE x(Dx(j8 LH#TZ MDC m,|9Jmz8( BLOCKINSERT SdDx(j8LH# 1B(;vm1,!q ROW x(,!q1!x(s!^NNxp#!q TABLE x (Ia_i/T\,=(G^Fh*q!Dx(D}?#+G,"PTI\IZy Px(;Zj{DmOx5M#TZ MDC m,!q BLOCKINSERT SdIa_ INSERT YwDT\,=(GZi6px(x\bTek9CPx(#T;aTyP d{Yw4PP6px("T|ek4PP6px(T#$IX4A(RR)(hL r#BLOCKINSERT !nTZ%vBqs?ek=%*qDYwG#PC#;P LOCKSIZE !nah9}#Dx(}6# v XUNjTME|GRpDx(# 1C|( WITH RELEASE SdD CLOSE CURSOR odXUNj1,}]b\m w"TMEyP*NjRpDAx(#mAx(G IS"S M U mx(#PAx(G S"NS M U Px(#iAx(G IS"S M U ix(# WITH RELEASE SdT}Z CS r UR tk6pBYwDNj;pwC#1T} Z RS r RR tk6pBYwDNj8( WITH RELEASE Sd,|+axG)t k6pD;)#$#w7X5,RS NjI\-z;IX4AVs,x RR NjI\ -z;IX4ArCsA!Vs# 166 w{}]bT\ g{;v-4G RR r RS DNj(}9C WITH RELEASE SdXUsXBr*, G4qCBDAx(# Z CLI &CLrP,DB2 CLI ,StT SQL_ATTR_CLOSE_BEHAVIOR IC4 qCk CLOSE CURSOR WITH RELEASE `,Da{# v ZVx}]b73P,1|D0lx(DdCN}1,7#TyP}]bVxw8>),G 4h*VvJb"v(gNbvKJb# 7#GPTd}6x(DyPmxPVv# KU>D~|(BPE": v 10RpDx(}?# v Zx(}6jI.0yhDx(}?# v }6D?vmDmj6E"Mm{# v 10RpDGmx(D}?# v w*}6D;?V,q!Bm6pDx(#(#,+q!“S”(4,2mx() r“X”(4,%bx()# v q!Bmx(6pa{DZ?5Xk# 2. 9C\m(*U>PDE"4v(gNbv}6Jb# }P#g{tCK DB2_SKIPDELETED "amd?,G4 DB2 Z 2 `w}(hP+x}Q>}D|# b)"amd?Z`k1JCZ/, SQL r XQuery od,xZs(1JCZ2, SQL r XQuery od#bb6E,49ZKP1tCKC"amd?2;a9C\bx (_T(}GZs(1tCK DB2_EVALUNCOMMITTED)#g{Zs(1tCKC" amd?,+GZKP14tC|,G4\bx(_TT;P'#TZ2, SQL r XQuery od,g{XBs(KLr|,G4s(1D"amd?hCGJCDhC#2 , SQL r XQuery odD~=XBs(+9C DB2_EVALUNCOMMITTED D10 hC# T;,CJ=8D4d5}]s5DJCT m 8. “v RID w}”CJ =J T4d5D}]s5 ^ q SARGable G m 9. “v}]”CJ(X5 RID PmrSY RID Pm) =J T4d5D}]s5 ^ q SARGable G m 10. “RID w}M}]”CJ =J T4d5D}]s5 w} }] w}CJ }]CJ ^^qq ^ SARGable qq SARGable ^ G q SARGable SARGable G q 168 w{}]bT\ m 11. iw}M}]CJ =J T4d5D}]s5 w} }] w}CJ }]CJ ^^qq ^ SARGable q G SARGable ^ G q SARGable SARGable GG >} TB>}T1!x(P*kBDT4d5D}]xPs5DP*wKHO# BmG SAMPLE }]bPD ORG m# DEPTNUMB DEPTNAME MANAGER DIVISION LOCATION -------- -------------- ------- ---------- ------------- 10 Head Office 160 Corporate New York 15 New England 50 Eastern Boston 20 Mid Atlantic 10 Eastern Washington 38 South Atlantic 30 Eastern Atlanta 42 Great Lakes 100 Midwest Chicago 51 Plains 140 Midwest Dallas 66 Pacific 270 Western San Francisco 84 Mountain 290 Western Denver }ZTKm4PBPBq,|_P1!“NjH(T”(CS)tk6p# m 12. T_P CS tk6pD ORG m4PDBq a0 1 a0 2 connect to SAMPLE connect to SAMPLE +c update org set deptnumb=5 where man- ager=160 select * from org where deptnumb >= 10 a0 1 P4d5D UPDATE TmPZ;P#V%bG}DP,+G,v1tCK"amd? DB2_SKIPDELETED 1,Eax}Q>}D 2 `w}|# CZvT4d5ekD!n DB2_SKIPINSERTED "amd?XFTZ9CNjH(T(CS)rAH(T(RS)t k6pDNjGqITvT4d5ek#DB2 }]b53ICBP==&m4d5e k: v DB2 }]b53ITH}1= INSERT BqjI(d5rXv),;s`&X&m }]#bG1!!n OFF# TB>}T>KW!1!!n OFF D5}: – Y(=v&CLr9C;vm4Z|G.d+]}],Z;v&CLr+}]e k=mP,Z~v&CLrSmPA!}]#Z~v&CLrXk4U}]Zm PDT>3r4&m}],g{Z;v&CLr}Zek*A!DB;P,G4 Z~v&CLrXkH}1=ek;d5*9#ZbVivB,&9C DB2_SKIPINSERTED D1!5# – Y(;v&CLr(}>}}];sek}]DB3q4^D}]#ZbViv B,*\b9C UPDATE od,&9C DB2_SKIPINSERTED D1!5# v DB2 }]b53ITvT4d5Dek,bZm`ivBITa_"PT#g{z# {byv,Xk+C"amd?8(* ON# \.,ON a9"PT|?,|Gs?V&CLrDW!hC#1tCC"amd? 1,4d5DekP;S*P4ekDP# x(`Mf]T Z;v&CLr105PT3vTsDx(,xm;v&CLrksT,;vTsD x(1,MavVx(f]TJb#1=Vx(==f]1,IT,bTCTsDZ ~vx(ks# g{ksDx(Dx(==kQRpDx(;f],G4;\,bx(ks#`4, ks*H=Z;v&CLrMEdx(,"RMEyPd{VP;f]x(*9# 170 w{}]bT\ BmT>PX3)ivDE",Zb)ivB,Zx(4,B,1m;vxLRpr }ZksT,;vJ4Dx(1,IT,bx(ks#q8>ks_XkH},1= yP;f]Dx(;d{xLME*9#"b,1ks_}H}x(1,I\vV, 1#G8>ZhCx(,}G|gDks_}ZH}CJ4# m 13. x(`Mf]T wb|,PX;,}]CJ=8DjK;,CJ=8D?v6pDj4xP3vX(6pDx(# ": 1. Z`,/:(MDC)73P,9+9C=SDx(6p BLOCK# Z 18 B &CLr"bBn 171 2. IT9C SELECT odDx(ksSd4T=|Dx(==# m 14. ;9C=JDm(hDx(== tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h |Br>} RR S/- U/- SIX/X X/- X/- RS IS/NS IX/U IX/X IX/X IX/X CS IS/NS IX/U IX/X IX/X IX/X UR IN/- IX/U IX/X IX/X IX/X m 15. 9C=JDm(hDx(== tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h |Br>} RR S/- U/- SIX/X U/- SIX/X RS IS/NS IX/U IX/X IX/U IX/X CS IS/NS IX/U IX/X IX/U IX/X UR IN/- IX/U IX/X IX/U IX/X ": Z UR tk6p,g{_P 1 `w}D IN x(,r_g{w}D|,PP_P =J,G4tk6p+}6* CS "Rx(+}6* IS mx(M NS Px(# m 16. ;9C=JD RID w}(hDx(== tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h |Br>} RR S/- IX/S IX/X X/- X/- RS IS/NS IX/U IX/X IX/X IX/X CS IS/NS IX/U IX/X IX/X IX/X UR IN/- IX/U IX/X IX/X IX/X m 17. 9C%vOqPD RID w}(hDx(== tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h |Br>} RR IS/S IX/U IX/X IX/X IX/X RS IS/NS IX/U IX/X IX/X IX/X CS IS/NS IX/U IX/X IX/X IX/X UR IN/- IX/U IX/X IX/X IX/X m 18. v9C Start M Stop =JD RID w}(hDx(== tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h |Br>} RR IS/S IX/S IX/X IX/X IX/X RS IS/NS IX/U IX/X IX/X IX/X CS IS/NS IX/U IX/X IX/X IX/X 172 w{}]bT\ m 18. v9C Start M Stop =JD RID w}(hDx(== (x) tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h |Br>} UR IN/- IX/U IX/X IX/X IX/X m 19. v9Cw}Md{=J(sargs M resids)D RID w}(hDx(== tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h |Br>} RR IS/S IX/S IX/X IX/S IX/X RS IS/NS IX/U IX/X IX/U IX/X CS IS/NS IX/U IX/X IX/U IX/X UR IN/- IX/U IX/X IX/U IX/X BfDmT>KZ3)ivBDx(==,Zb)ivB,53+SYA!}]3T Jm+PPm: v 9C`vw}x;=^( v ErTqC_'D$! m 20. SYD}]3CJyCDw}(hDx(==:;9C=JD RID w}(h tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h |Br>} RR IS/S IX/S X/- RS IN/- IN/- IN/- CS IN/- IN/- IN/- UR IN/- IN/- IN/- m 21. SYD}]3CJyCDw}(hDx(==:Z;9C=JD RID w}(hs tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h |Br>} RR IN/- IX/S IX/X X/- X/- RS IS/NS IX/U IX/X IX/X IX/X CS IS/NS IX/U IX/X IX/X IX/X UR IN/- IX/U IX/X IX/X IX/X m 22. SYD}]3CJyCDw}(hDx(==:9C=J(sargs M resids)D RID w }(h tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h |Br>} RR IS/S IX/S IX/S RS IN/- IN/- IN/- CS IN/- IN/- IN/- UR IN/- IN/- IN/- Z 18 B &CLr"bBn 173 m 23. SYD}]3CJyCDw}(hDx(==:v9C Start M Stop =JD RID w} (h tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h |Br>} RR IS/S IX/S IX/X RS IN/- IN/- IN/- CS IN/- IN/- IN/- UR IN/- IN/- IN/- m 24. SYD}]3CJyCDw}(hDx(==,Zv9C Start M Stop =JD RID w }(hs tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h |Br>} RR IN/- IX/S IX/X IX/X IX/X RS IS/NS IX/U IX/X IX/U IX/X CS IS/NS IX/U IX/X IX/U IX/X UR IS/- IX/U IX/X IX/U IX/X m 25. SYD}]3CJyCDw}(hDx(==,Z9C=JD RID w}(hs tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h |Br>} RR IN/- IX/S IX/X IX/S IX/X RS IS/NS IX/U IX/X IX/U IX/X CS IS/NS IX/U IX/X IX/U IX/X UR IN/- IX/U IX/X IX/U IX/X mDx(==M MDC mD RID w}(h Z`,/:(MDC)73P,9+9C=SDx(6p BLOCK#TBmP>K;,C J=8Zwv6pqCDx(`M#?vu?I}?ViI:mx("ix(MPx (#i_m>49C3vX(6pDx(# ":IT9C SELECT odDx(ksSd4T=|Dx(==# m 26. ;9C=JDm(hDx(== tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (hr>} |B RR S/-/- U/-/- SIX/IX/X X/-/- X/-/- RS IS/IS/NS IX/IX/U IX/IX/U IX/X/- IX/I/- CS IS/IS/NS IX/IX/U IX/IX/X IX/X/- IX/X/- UR IN/IN/- IX/IX/U IX/IX/X IX/X/- IX/X/- 174 w{}]bT\ m 27. v9C,POD=JDm(hDx(== tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (hr>} |B RR S/-/- U/-/- SIX/IX/X U/-/- SIX/X/- RS IS/IS/NS IX/IX/U IX/IX/X IX/U/- X/X/- CS IS/IS/NS IX/IX/U IX/IX/X IX/U/- X/X/- UR IN/IN/- IX/IX/U IX/IX/X IX/U/- X/X/- m 28. 9Cd{=J(sargs M resids)Dm(hDx(== tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (hr>} |B RR S/-/- U/-/- SIX/IX/X U/-/- SIX/IX/X RS IS/IS/NS IX/IX/U IX/IX/X IX/IX/U IX/IX/X CS IS/IS/NS IX/IX/U IX/IX/X IX/IX/U IX/IX/X UR IN/IN/- IX/IX/U IX/IX/X IX/IX/U IX/IX/X TB=vmT>K MDC mD RID w}Dx(==# m 29. ;9C=JD RID w}(hDx(== tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h>} |B RR S/-/- IX/IX/S IX/IX/X X/-/- X/-/- RS IS/IS/NS IX/IX/U IX/IX/X X/X/X X/X/X CS IS/IS/NS IX/IX/U IX/IX/X X/X/X X/X/X UR IN/IN/- IX/IX/U IX/IX/X X/X/X X/X/X m 30. 9C%vOqPD RID w}(hDx(== tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h>} |B RR IS/IS/S IX/IX/U IX/IX/X X/X/X X/X/X RS IS/IS/NS IX/IX/U IX/IX/X X/X/X X/X/X CS IS/IS/NS IX/IX/U IX/IX/X X/X/X X/X/X UR IN/IN/- IX/IX/U IX/IX/X X/X/X X/X/X m 31. v9C Start M Stop =JD RID w}(hDx(== tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h>} |B RR IS/IS/S IX/IX/S IX/IX/X IX/IX/X IX/IX/X RS IS/IS/NS IX/IX/U IX/IX/X IX/IX/X IX/IX/X CS IS/IS/NS IX/IX/U IX/IX/X IX/IX/X IX/IX/X UR IN/IN/- IX/IX/U IX/IX/X IX/IX/X IX/IX/X Z 18 B &CLr"bBn 175 m 32. v9Cw}=JD RID w}(hDx(== tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h>} |B RR IS/S/S IX/IX/S IX/IX/X IX/IX/S IX/IX/X RS IS/IS/NS IX/IX/U IX/IX/X IX/IX/U IX/IX/X CS IS/IS/NS IX/IX/U IX/IX/X IX/IX/U IX/IX/X UR IN/IN/- IX/IX/U IX/IX/X IX/IX/U IX/IX/X m 33. 9Cd{=J(sargs M resids)D RID w}(hDx(== tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h>} |B RR IS/S/S IX/IX/S IX/IX/X IX/IX/S IX/IX/X RS IS/IS/NS IX/IX/U IX/IX/X IX/IX/U IX/IX/X CS IS/IS/NS IX/IX/U IX/IX/X IX/IX/U IX/IX/X UR IN/IN/- IX/IX/U IX/IX/X IX/IX/U IX/IX/X ":ZBfDmP,T>KCZSYD}]3CJD RID w}(hDx(==,Z UR tk6p,g{_P 1 `w}D IN x(,r_g{Zw}D|,PP_P=J,G4 tk6p+}6A CS "Rx(+}6A IS mx("IS ix(M NS Px(# m 34. SYD}]3CJ9CD RID w}(hDx(==:;9C=JD RID w}(h tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h>} |B RR IS/S/S IX/IX/S X/-/- RS IN/IN/- IN/IN/- IN/IN/- CS IN/IN/- IN/IN/- IN/IN/- UR IN/IN/- IN/IN/- IN/IN/- m 35. SYD}]3CJ9CD RID w}(hDx(==:Z;9C=JD RID w}(hs SYD}]3CJ tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h>} |B RR IN/IN/- IX/IX/S IX/IX/X X/-/- X/-/- RS IS/IS/NS IX/IX/U IX/IX/X IX/IX/X IX/IX/X CS IS/IS/NS IX/IX/U IX/IX/X IX/IX/X IX/IX/X UR IN/IN/- IX/IX/U IX/IX/X IX/IX/X IX/IX/X m 36. SYD}]3CJ9CD RID w}(hDx(==:9C=J(sargs M resids)D RID w}(h tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h>} |B RR IS/S/- IX/IX/S IX/IX/S RS IN/IN/- IN/IN/- IN/IN/- 176 w{}]bT\ m 36. SYD}]3CJ9CD RID w}(hDx(==:9C=J(sargs M resids)D RID w}(h (x) tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h>} |B CS IN/IN/- IN/IN/- IN/IN/- UR IN/IN/- IN/IN/- IN/IN/- m 37. SYD}]3CJ9CD RID w}(hDx(==:Z9C=J(sargs M resids)D RID w}(hsSYD3}]CJ tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h>} |B RR IN/IN/- IX/IX/S IX/IX/X IX/IX/S IX/IX/X RS IS/IS/NS IX/IX/U IX/IX/X IX/IX/U IX/IX/X CS IS/IS/NS IX/IX/U IX/IX/X IX/IX/U IX/IX/X UR IN/IN/- IX/IX/U IX/IX/X IX/IX/U IX/IX/X m 38. SYD}]3CJ9CD RID w}(hDx(==:v9C Start M Stop =JD RID w}(h tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h>} |B RR IS/IS/S IX/IX/S IX/IX/X RS IN/IN/- IN/IN/- IN/IN/- CS IN/IN/- IN/IN/- IN/IN/- UR IN/IN/- IN/IN/- IN/IN/- m 39. SYD}]3CJ9CD RID w}(hDx(==:Zv9C Start M Stop =JD RID w}(hsSYD3}]CJ tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h>} |B RR IN/IN/- IX/IX/S IX/IX/X IX/IX/X IX/IX/X RS IS/IS/NS IX/IX/U IX/IX/X IX/IX/U IX/IX/X CS IS/IS/NS IX/IX/U IX/IX/X IX/IX/U IX/IX/X UR IS/-/- IX/IX/U IX/IX/X IX/IX/U IX/IX/X MDC mDiw}(hDx( TBmP>K;,CJ=8Zwv6pqCDx(`M#?vu?I}?ViI:m x("ix(MPx(#i_m>4xP3vX(6pDx(# Z 18 B &CLr"bBn 177 ":IT9C SELECT odDx(ksSd4T=|Dx(==# m 40. ;9C=JDw}(hDx(== tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h>} |B RR S/--/-- IX/IX/S IX/IX/X X/--/-- X/--/-- RS IS/IS/NS IX/IX/U IX/IX/X X/X/-- X/X/-- CS IS/IS/NS IX/IX/U IX/IX/X X/X/-- X/X/-- UR IN/IN/- IX/IX/U IX/IX/X X/X/-- X/X/-- m 41. v9C,=JDw}(hDx(== tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h>} |B RR IS/-/- IX/IX/S IX/IX/X X/-/- X/-/- RS IS/IS/NS IX/IX/U IX/IX/X IX/X/- IX/X/- CS IS/IS/NS IX/IX/U IX/IX/X IX/X/- IX/X/- UR IN/IN/- IX/IX/U IX/IX/X IX/X/- IX/X/- m 42. v9C Start M Stop =JDw}(hDx(== tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h>} |B RR IS/S/- IX/IX/S IX/IX/S IX/IX/S IX/IX/S RS IX/IX/S IX/IX/U IX/IX/X IX/IX/- IX/IX/- CS IX/IX/S IX/IX/U IX/IX/X IX/IX/- IX/IX/- UR IN/IN/- IX/IX/U IX/IX/X IX/IX/- IX/IX/- m 43. 9C=JDw}(hDx(== tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h>} |B RR IS/S/- IX/IX/S IX/IX/X IX/IX/S IX/IX/X RS IS/IS/NS IX/IX/U IX/IX/X IX/IX/U IX/IX/X CS IS/IS/NS IX/IX/U IX/IX/X IX/IX/U IX/IX/X UR IN/IN/- IX/IX/U IX/IX/X IX/IX/U IX/IX/X BmP>SYD}]3CJy9CDiw}(hDx(==: m 44. SYD}]3CJ9CDiw}(hDx(==:;9C=JDiw}(h tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h>} |B RR IS/S/-- IX/IX/S X/--/-- RS IN/IN/-- IN/IN/-- IN/IN/-- CS IN/IN/-- IN/IN/-- IN/IN/-- UR IN/IN/-- IN/IN/-- IN/IN/-- 178 w{}]bT\ m 45. SYD}]3CJ9CDiw}(hDx(==:Z;9C=JDiw}(hsSYD} ]3CJ tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h>} |B RR IN/IN/-- IX/IX/S IX/IX/X X/--/-- X/--/-- RS IS/IS/NS IX/IX/U IX/IX/X X/X/-- X/X/-- CS IS/IS/NS IX/IX/U IX/IX/X X/X/-- X/X/-- UR IN/IN/-- IX/IX/U IX/IX/X X/X/-- X/X/-- m 46. SYD}]3CJ9CDiw}(hDx(==:v9C,=JDiw}(h tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h>} |B RR IS/S/-- IX/IX/-- IX/S/-- RS IS/IS/NS IX/--/-- IX/--/-- CS IS/IS/NS IX/--/-- IX/--/-- UR IN/IN/-- IX/--/-- IX/--/-- m 47. SYD}]3CJ9CDiw}(hDx(==:Zv9C,=JDiw}(hsSYD }]3CJ tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h>} |B RR IN/IN/-- IX/IX/S IX/IX/X IX/S/-- IX/X/-- RS IS/IS/NS IX/IX/U IX/IX/X IX/U/-- IX/X/-- CS IS/IS/NS IX/IX/U IX/IX/X IX/U/-- IX/X/-- UR IN/IN/-- IX/IX/U IX/IX/X IX/U/-- IX/X/-- m 48. SYD}]3CJ9CDiw}(hDx(==:v9C Start M Stop =JDw}(h tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h>} |B RR IS/S/-- IX/IX/-- IX/X/-- RS IN/IN/-- IN/IN/-- IN/IN/-- CS IN/IN/-- IN/IN/-- IN/IN/-- UR IN/IN/-- IN/IN/-- IN/IN/-- m 49. SYD}]3CJ9CDiw}(hDx(==:Zv9C Start M Stop =JDiw} (hsSYD}]3CJ tk6p ;AM#}(h NjYw QwD|Br>} (h 10;C (h>} |B RR IN/IN/-- IX/IX/X IX/X/-- RS IS/IS/NS IN/IN/-- IN/IN/-- CS IS/IS/NS IN/IN/-- IN/IN/-- UR IS/--/-- IN/IN/-- IN/IN/-- Z 18 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byD!qod,|G>mG;AD,"_P;vT=D FOR READ ONLY Sd,r_G#}D(+Gi/`kwr* PREP r BIND |n8(K BLOCKING !nD5xY(G;AD)#K&m`M;*s“2m”x((S"NS r IS)# v |Dbr K`M|(_P FOR UPDATE Sd"_P USE AND KEEP UPDATE LOCKS S d"_P USE AND KEEP EXCLUSIVE LOCKS SdDyP SELECT od,r _i/`kwbMPgeDodTm>kxP|D#K`M9C“2m”M“|B”x ((TZP,* S"U 0 X;TZi,* IX"U"X M S;TZm,* IX"U M X)# v |D K`M|( UPDATE"INSERT 0 DELETE,+;|( UPDATE WHERE CUR- RENT OF r DELETE WHERE CURRENT OF#K`M*s“%b”x((X r IX)# v \XNj K`M|( UPDATE WHERE CURRENT OF M DELETE WHERE CURRENT OF# |2*s“%b”x((X r IX)# y]Si/odDa{Z?jmPxPek"|Br>}}]Dod4P=V`MD &m#;A&mfr7(TZS!qodP5XDmDx(#|D&mfr7(T? jmDx(# x(M}]CJ=( CJ=8GE/w!qTSX(mPlw}]D=(#CJ=8ITx(==_P\ s0l#}g,19Cw}(h4iRX(P1,E/w+I\*Cm!qP6px ((IS)#}g,g{ EMPLOYEE mP;vXZ01`E(EMPNO)Dw},(}w }CJITC4!q%v01DE",9C|,BP SELECT SdDod: 182 w{}]bT\ SELECT * FROM EMPLOYEE WHERE EMPNO = ’000310’; g{;9Cw},G4Xk43r(h{vm4R=y!DP,"RIrKq!%v m6x((S)#}g,g{ SEX PO;Pw},G4m(hITC4!qyPDPT 01,9C|,BP SELECT SdDod: SELECT * FROM EMPLOYEE WHERE SEX = ’M’; ": \XNj&m9Cy!Njx(==,1=&CLrR=*|Br*>}DP* 9#TZKV`MD&m,^[NjDx(==G24,\aq!%bx(T4P| Br>}# 6'/:mPDx(kj<|rB;v|x(D$w==T"Py;,#1CJ6' /:mPD;(6'DP1,C6'ZDyPP}x"zR+BD|5ekw}P#TZv0lw}D|,PD|B,IJ1 |B|x;"zB;|x(# Z RR (hZd,T S ==x(kzZ(h6')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CK TIMEOUT od8(,Kod|D CURRENT LOCK TIMEOUT (CDfwD5#CURRENT LOCK TIMEOUT (CD fw8(Z5X8>;\q!x(Dms.0H}x(Dk}# +3Dx(=(a}k SELECT odX*DNj# v g{!qDPPAYP;PG?}Da{m,g{}]b\mwITlw}]ix;G%bx(, G48( FOR READ ONLY I\aa_ FETCH YwDT\#;*TCZ(;D UPDATE r DELETE odDi/9C FOR READ ONLY Sd# IZ`,D?D,I+ DB2 CLI ,StT SQL_ATTR_ACCESS_MODE CZ CLI & CLr# OPTIMIZE FOR n ROWS Sd Z 18 B &CLr"bBn 185 OPTIMIZE FOR Sdyw|;klwa{D;vS/rEHlw08P#E/w;sI TEH!qQlw08PDl&1duAnLDCJ=8#mb,w*%vi"M= M'zDP}I OPTIMIZE FOR SdPD“n”54^F#rK,OPTIMIZE FOR Sd H0l~qwS}]blwOqPD==,V0l+OqP5X=M'zD==# }g,Yhz(Zi/01m,4iR_Pn_$JD01# SELECT LASTNAME,FIRSTNAME,EMPNO,SALARY FROM EMPLOYEE ORDER BY SALARY DESC z(eK;vyZ SALARY PD5rw}#+G,IZ01G401EErD,yT $Jw}I\\Q/:#*K!?\bm`fzD,= I/O,E/w+I\!q9CP m$!CJ=(,K=(h*TOqDyPPDPj6Er#Z+08vOqP5X A&CLr0,KErI\: SELECT LASTNAME,FIRSTNAME,EMPNO,SALARY FROM EMPLOYEE ORDER BY SALARY DESC OPTIMIZE FOR 20 ROWS ZKivB,E/wI\!q1S9C SALARY w},r*;lw_Pn_$JD~ .v01#;\IT+`YPVi,+;Q?~.PiID;vi5XAM'z# 9C OPTIMIZE FOR Sd,E/wEH!qIT\bs?YwrPOPw/(gEr) DCJ=8#9C OPTIMIZE FOR 1 ROW nPI\0lCJ76#9CKSdIT PBPwC: v kiOZ?mD,S3r;+I\,r*|Gh*;vY1m# v ,S=(IT|D#;v6W-7,SGG#I\D!q,r*|_PM*zI >,"R(#ZlwY?P1|P'J# v ;vk ORDER BY Sd%dDw}|I\,r*TZ ORDER BY ;h*Er# v Pm$!;+I\,r*KCJ=(h*Er# v 3r$!;+I\,r**@;h*Y?D8P# v Z;v,Si/P,Z ORDER BY SdP|,PDmI\!wb?m,0aGCb ?mOD;vw}a) ORDER BY SdyhDEr# d; OPTIMIZE FOR SdJCZyPE/6p,+|ZE/6p 3 M|_6pB$ wCnC,r*6p 3 TBD6p9C“07”,S6Y=(#K=(P1azz;v; \9|GT:\llw08PD`m,SDCJ=8# OPTIMIZE FOR Sd;h9zlw+?OqP#g{75*lw+?OqP,G4\D C1dI\ss_Zg{E/w*{vp8/xPE/yhD1d# g{Qr|D&CLr9CwC6SZ(DB2 CLI r ODBC),IZ db2cli.ini d CD~P9C OPTIMIZEFORNROWS X|V,C DB2 CLI T/+;v OPTIMIZE FOR Sd7SA?vi/odD)2# 1SGF!q}]1,a{I\f}]4'VD;,xd/#g{CGF}CD}] 4'V OPTIMIZE FOR SdR DB2 E/w+{vi/BFA}]4,G4+Z"M =}]4D6L SQL PzICSd#g{}]4;'VKSd,r_g{E/wv( Z>X4PnMI>=8,G4Z>X&C OPTIMIZE FOR Sd#ZbVivB,DB2 E/wEH!qQlw3i/08PDl&1dn!/DCJ=8,+I)E/wz I=8D!nT"\=^F,rKS OPTIMIZE FOR SdqCDT\DFI\G#!# 186 w{}]bT\ g{,18(K FETCH FIRST SdM OPTIMIZE FOR Sd,G4b=v5PO!D ;v0l(E:exs!#*Ko=nE/,+b=v54wG%;`XD# FETCH FIRST n ROWS ONLY Sd FETCH FIRST n ROWS ONLY SdhCIlwDnsP}#+a{m^F*;|, 08PIa_T\#^[a{/I\mb|,`YP,;lw n P# g{,18(K FETCH FIRST SdM OPTIMIZE FOR Sd,G4b=v5PO!D ;v0l(E:exs!#*Ko=E/?D,b=v5G%`@"D# DECLARE CURSOR WITH HOLD od 1C|( WITH HOLD SdD DECLARE CURSOR odywNj1,Zd5CBq 1NNr*DNjT;r*;"RMEyPx(,}#$r*D WITH HOLD NjD 10Nj;CDx(b# g{XvBq,G4XUyPr*DNjRMEyPx(T0ME LOB (;w# I+ DB2 CLI ,StT SQL_ATTR_CURSOR_HOLD CZ CLI &CLrT5V,y Da{#g{P9CwC6SZ(DB2 CLI r ODBC)DQr|D&CLr,G4Z db2cli.ini dCD~P9C CURSORHOLD X|V,C DB2 CLI T/*?vQyw NjYh WITH HOLD Sd# 8(PVi4uY*z 'VTyPodM}]`M(|( LOB }]`M)xPPVi#PVi(}Z%vY wPlwPi4uYNjD}]b\mw*z# ":8(DPiGZfPDm`3#|;G;v`,(MDC)mi,CiomO3d *ELOD;v)9}]i# PViI BIND r PREP |nDBPTd?8(: UNAMBIG T9C FOR READ ONLY Sd8(DNjxPVi# ;G9C FOR READ ONLY r FOR UPDATE SdywDNj+;h{,b )Nj;G#}Nj,2;G;ANj##}Nj;a;h{# ALL T9C FOR READ ONLY Sd8(DNjr_48(* FOR UPDATE DN jxPVi# NO ;TNNNjxPVi# PX;ANjM#}NjD(e,kND DECLARE CURSOR od# ":g{Z SELECT odP9C FETCH FIRST n ROWS ONLY Sdr OPTIMIZE FOR n ROWS Sd,G4?iDP}+GBPwnPDn!5: v Ov+=PFcD5 v FETCH FIRST SdP n D5 v OPTIMIZE FOR SdP n D5 Z 18 B &CLr"bBn 187 XkJ1hC=v}]b\mwdCN}#b=v5X&CLrD&CLr'VcQs!# v }]b\mwdCN} rqrioblk 8(}]b~qwO6L&CLr0d}]bzmL r.dD(E:exs!# ZT LOB }]`MDP}]tCVi.0,;(*KbbyvT53J4zzD0l# 15X LOB P1,~qwO+{D|`2mZf4f"T?v}]iPD LOB 5D }C#bV}CD}?+f}]bdCN} rqrioblk D5;,x;,# *vSVdxQDZf?,(}TB=(4^D}]bdCN} database_memory: v +KN}hC* AUTOMATIC af*}]b\mwT/X\m}]bZf# v g{KN}10hC*C'(eD}5,G4+C5vs 256 3# *a_}CK LOB 5DVP6k= SQL &CLrDT\,IT9C BIND |n4X Bs(C&CLr"R8( BLOCKING ALL Sdr BLOCKING UNAMBIGUOUS S d4ksVi#6k=&CLr+S~qwPlw LOB 5,;Nlw;P,1=S~ qwPlwK;5PP*9#5XsM LOB a{D UDF I\aX&CLr,9CBP+=: ?iP} = aslheapsz * 4096 / orl ?3DVZ}* 4096# v TZ6L&CLr,9CBP+=: ?iP} = rqrioblk / orl 2. *tCPVi,T PREP r BIND |nPD BLOCKING !n8(J1DTd?# g{;8( BLOCKING !n,G41!PVi`M* UNAMBIG#TZ|nP& mwMwC6SZ,1!PVi`M* ALL# i/w{4Pi/#DB2 JmzZ SQL M XQuery i/P4PP 'Iy,SxZ#t_+7HD,11Za_y]?53rxPsMi/DT\# n#{DIy&CLrCZ[/i/(}g,AVG"SUM M COUNT),dPIS} ]y>Pq![/DOm+7a{#9IT9CIy4q!mP5JPDfzS/T CZsF,r_CZa_}]ZrMVvNqDYH# DB2 a)=VIy=(:P6pIyMi6pIy# P6p Bernoulli Iy P6p Bernoulli Iy(}9CXF=J(||,y>PD?;PDEJ* P/100,E} y>PD?;PDEJ* 1 - P/100)4q!mPD P% Dy># P6p Bernoulli Iy,;\}]/:gN#+G,g{;P a)w},bVIyDT\a\M,bGr*Xklw?PRTd&CIy=J#g {;PNNw},G4Z4P;IyDi/1 I/O {Da\s#g{Pw}IC,G4 aa_9CbVIyDT\,bGr*Tw}6S3ZD RIDS &CKIy=J#;c Z 18 B &CLr"bBn 189 ivB,b*s?vy! RID ;v I/O,?vw}6S3;v I/O# 5336pIy 5336pIykP6pIy`F,+G|GT3Iyx;GTPIy#+;3|, Zy>PDEJ* P/100#g{|,K33,M|,KC3PDyPP# 5336pIyDT\\C,r*TZ|,Zy>PD?;3;h*4P;N I/O#k ;Iy`H,36pIyy]?53ra_T\#+G,36pIykP6pIyH p4,[/@FD<7TI\|n#1?viPm`P1,r_1i/P}CDPZ 3PT>O_D/:H1,M\I\zzbV<7TDnl# X(NqDnQIy=(+IC'D1d4Pi/,ITZ SQL odP9C table-reference SdD TABLESAMPLE Sd#*8(IyD=(,9CX|V BERNOULLI r SYSTEM# BERNOULLI X|V8(4PP6p Bernoulli Iy# SYSTEM X|V8(4P5336pIy,}GE/w7(4PP6p Bernoulli Iy 4x|P'# &CLrD"P&m DB2 w*ZTF`&mw(SMP)zwO'V"P73,+Z%&mwzwO2P^L HX'VK73#Z SMP zwP,`v&mwITCJ}]b,b9C+4S SQL k sD"P4PV=wv&mwO# *8(`k&CLr1*5VD"PH,I9C CURRENT DEGREE (CDfwr DEGREE s(!n#H8,14PD3vi/D?V}#Z&mw}?M*"PH!q D5.d;POqDX5#IT8(HzwO&mw}?`rYD}#uATZ%& mwzw,zIThCHT3)==a_T\D"PH_D"PH#+G,"b,? v"PHXZE/wy!qD"PHDE",9C“SQL 5w$_”4T>CJ=8#9C }]b53`Sw4T>XZKP15J9CD"PHDE"# G SMP 73PD"PT zIT8("PHx;X_P SMP zw#}g,Z;v%&mwzwOD\ I/O #1!qCJ=81,i/E/w a,|(CJ;,mUdPD}]yzzDNNI>np#E/w 9C SYSCAT.TABLESPACES 53?: – OVERHEAD,|a)]wyh1dD@F(TAkF),ZC1dsE+}] AkZf#K*zn/|(]wD I/O XFw*zT0ELH}1d,s_|(E L0@1d# I9CTB+=4oz@F*zI>: OVERHEAD = TAkFD=y0@1d +(0.5 * }*H}1d) dP: - 0.5 m>kv}*D=y*z - T?vj{D}*FcTAkFD}*H}1d,gBy>: (1 / RPM) * 60 * 1000 dP: v }T?VS}*N}4qC?v}*yhDVS} v KT 60 k/V v KT 1000 Ak/k }g,Y(EL?VS}* 7200 N#(}9C}*SY1d+=,b+zI: (1 / 7200) * 60 * 1000 = 8.328 Ak ;sIY(=y0@1d* 11 Ak,9CTOa{Fc OVERHEAD @F5: OVERHEAD = 11 + (0.5 * 8.328) = 15.164 Cvs< 15 AkD OVERHEAD @F5# – TRANSFERRATE,|a)+;3}]AkZfyhD1d@F(TAkF)# g{?vmUd]wG%vomEL,G4I9CTB+=4oz@F+MI> (TAk/3F): TRANSFERRATE = (1 / spec_rate) * 1000 / 1024000 * page_size dP: - spec_rate m>EL+MYJDE"aT`V==0lE/w,|(Gq9Cw}4C J}],T0*!q+DvmCZ,SPDZ?mMb?m# v $! 11,E/w2|D RESOURCE mUdXwDo(>}: ALTER TABLESPACE RESOURCE PREFETCHSIZE 64 OVERHEAD 19.3 TRANSFERRATE 0.9 1TmUdxPNN|D.s,4M*O~qwO}] I/O .VD`TYJD5#4P CREATE SERVER od1,+K}]mS=?# }ms!M}]VrtT5D?v%576: – K76ITS\D%5} – ns5 – n!5 – D>rtTZc} – |,D>rtTZcDD5} TZ8(DPi: v PiDyZ1dAGD{F v PiDy} vTZw}: v w}u?D}?(w}y}) v 6S3} v w}c} v Kw}Dm}]D/:H v k}]VxPXDw}|D/:H v ELO4w}|3rD6S3kw}}D3} v 3PjG*>}D RID },"G3PyP RID } g{ksw}Dj83FE",G49ITf"XZmTw}D/:HD|j8E" T0;,:exs!D3Cf@F# 9ITU/XZmMw}DBP8V3FE": v }]V<3FE" E/w9C}]V<3FE"4@FmM3FE"S}YwDN}4b?m|Bn/# 51U/3FE"IE/ SQL od.0CodDhs7(#byIT|01XU/| <7D3FE"#<7D3FE"ITzz|CDi/4PF."a_T\#Z4t C51U/3FE"&\1,+?t=v!14P;Nl=U/3FE"#**3) &CLra)<7D3FE",KU/5JI\;;_# ZtC51U/3FE"&\.s,T+?t=v!14P;Nl=U/3FE"l i#ZBPivB,51U/3FE"&\9+}p"vl=U/ks: Z 20 B 53?<3FE" 199 v mn/5JTZ,=U/45;;_,+TZl=U/45V+_ v IZm+s,rK,=U/3FE"9CKIy v zIK,=3FE" v IZ,}KU/1d,rK,,=U/3FE"'\ n`IT,1&m=vl=ks,+;\kT;,m#;vksI513FE"" p,m;vksIl=U/3FE"li"p# (}9CBf8V=(,IT9T/U/3FE"TT\D0l5=nM: v (}9CQwYD RUNSTATS 5CLr4Pl=U/3FE"#wY&\y]10 }]bn/4XF RUNSTATS 5CLr{DDJ4}?:fE}]bn/DvS, RUNSTATS 5CLrDKPYH+d},S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1,Zb)mP6qDNNz7G<G< *KbT}]b"zKD)3FE"U/n/,Z DB2 f> 9.5 P}kK3FE"U >#3FE"U>G<}]bDyP3FE"n/,|(T/MV/U/3FE"# 3FE"U>D1!{F* db2optstats.number.log#|;Z $DIAGPATH/events ?G}*U>#3FE"U>P*I DB2_OPTSTATS_LOG "amd?X F# IT1Si43FE"U>DZ],r_9C SYSPROC.PD_GET_DIAG_HIST m/} 4i/b)Z]# SYSPROC.PD_GET_DIAG_HIST m/}5X;(}?DP,b)P|,XZNNU>G 9|,);,U>G<&\9CD`tP#BmhvK3FE"U >gN9Cb)`tP# Z 20 B 53?<3FE" 203 m 53. 3FE"U>D~PD`tP P{ }]`M hv OBJTYPE VARCHAR(64) B~JCZDTs`M#TZ3FE"U>G<,bG* U/D3FE"D`M#Z3FE"U/s(xLt/r #91,|2IT8Cs(xL#|9IT8T/U/3 FE"4PDn/,gIybT"uG<# OBJNAME VARCHAR(255) B~JCZDTs{F(g{ICD0)#TZ3FE"U >,||,mrw}{#g{ OBJTYPE G STATS DAE- MON r EVALUATION,G4 OBJNAME G}]b{F, x OBJNAME_QUALIFIER G NULL# OBJNAME_QUALIFIER VARCHAR(255) TZ3FE"U>,||,mrw}#=# 204 w{}]bT\ m 53. 3FE"U>D~PD`tP (x) P{ }]`M hv EVENTTYPE VARCHAR(24) B~`MGkKB~X*DYwr/J#3FE"U>G G<# START 1513FE"s(xL(OBJTYPE = STATS DAEMON) r T / U / 3 F E " s 5 W N (OBJTYPE = EVALUATION)t/1,TKYw xPU>G<# STOP 1513FE"s(xL(OBJTYPE = STATS DAEMON) r T / U / 3 F E " s 5 W N (OBJTYPE = EVALUATION)#91,TKYw xPU>G<# ACCESS TG <# FIRST_EVENTQUALIFIERTYPE VARCHAR(64) Z;vB~^(JD`M#B~^(JCZhv\B~0 lDTs#TZ3FE"U>,Z;vB~^(JGB~ "z1D1dAG# TZZ;vB~^(J`M,5* AT# FIRST_EVENTQUALIFIER CLOB(16k) B~DZ;v^(J#TZ3FE"U>G<,Z;vB ~^(JG3FE"B~"z1D1dAG#3FE"B ~D1dAGI\k TIMESTAMP Pym>DU>GG<,5I T* BY r NULL#KVN;CZd{B~`M# Z 20 B 53?<3FE" 205 m 53. 3FE"U>D~PD`tP (x) P{ }]`M hv SECOND_EVENTQUALIFIER CLOB(16k) B~DZ~v^(J# TZ3FE"U>G<,|m>U/ COLLECT B~`MD 3FE"D==#I\D5|(: C' I DB2 C'9C RUNSTATS"LOAD"CREATE INDEX r REDISTRIBUTE |n4P3FE"U /# ,= I DB2 Z`k SQL od14P3FE"U/# 3FE"+f"Z3FE"_Y:fP,x;G 53?G<,5I T* DUE TO r NULL# 206 w{}]bT\ m 53. 3FE"U>D~PD`tP (x) P{ }]`M hv THIRD_EVENTQUALIFIER CLOB(16k) B~DZ}v^(J# TZ3FE"U>G<,|m>3FE"n/^(jID -r# I\D5|(: ,1 ,=U/3FE"Yw,}1d$c# ms IZ"zms,3FE"n/'\# RUNSTATS ms IZ"z RUNSTATS ms,,=U/3FE"' \# TZ3)ms,494\U/3FE",SQL od `kYw2I\I&jI#}g,Z;Pc;D Zf4U/3FE"1,+Lx`k SQL od# Ts;IC IZ^(CJ}]bTs,4\U/CTsD3 FE"#3)I\D-r|(: v TsT,6%b(Z)==;x( v TsyZDmUd;IC v h*XB4(mw} e; IZm;v&CLrQZU/,=3FE",y T4\4P,=3FE"U/# li FULLREC Pr db2diag.log TKbmsj8E"# EVENTSTATE VARCHAR(255) IZB~G<,|8>3FE"YwD4,# I\D5|(: v t/ v I& v '\ >} ZK>}P,i/(}wC PD_GET_DIAG_HIST 5Xn`101dAG0;jDB~ D3FE"U>G<# SELECT pid, tid, substr(eventtype, 1,10), substr(objtype,1,30) as objtype, substr(objname_qualifier,1,20) as objschema, substr(objname,1,10) as objname, substr(first_eventqualifier,1,26) as event1, substr(second_eventqualifiertype,1,2) as event2_type, substr(second_eventqualifier,1,20) event2, substr(third_eventqualifiertype,1,6) event3_type, substr(third_eventqualifier,1,15) event3, Z 20 B 53?<3FE" 207 substr(eventstate,1,20) as eventstate FROM TABLE( SYSPROC.PD_GET_DIAG_HIST ( ’optstats’, ’EX’, ’NONE’, CURRENT_TIMESTAMP - 1 year, CAST( NULL AS TIMESTAMP ))) as sl order by timestamp(varchar(substr(first_eventqualifier,1,26),26)) ; a{4 FIRST_EVENTQUALIFIER PPf"D1dAGxPEr,C1dAGm>3 FE"B~D1d# PID TID EVENTTYPE OBJTYPE OBJSCHEMA OBJNAME EVENT1 EVENT2_TYPE EVENT2 EVENT3_TYPE EVENT3 EVENTSTATE ----- -------------------- ---------- ------------------------------ -------------------- ---------- -------------------------- ----------- -------------------- ----------- --------------- -------------------- 28399 1082145120 START STATS DAEMON - PROD_DB 2007-07-09-18.37.40.398905 - - - - I& 28389 183182027104 COLLECT TABLE AND INDEX STATS DB2USER DISTRICT 2007-07-09-18.37.43.261222 BY ,= -- t/ 28389 183182027104 COLLECT TABLE AND INDEX STATS DB2USER DISTRICT 2007-07-09-18.37.43.407447 BY l= -- I& 28399 1082145120 COLLECT TABLE AND INDEX STATS DB2USER CUSTOMER 2007-07-09-18.37.43.471614 BY l= -- t/ 28399 1082145120 COLLECT TABLE AND INDEX STATS DB2USER CUSTOMER 2007-07-09-18.37.43.524496 BY l= -- I& 28399 1082145120 STOP STATS DAEMON - PROD_DB 2007-07-09-18.37.43.526212 - - - - I& 28389 183278496096 COLLECT TABLE STATS DB2USER ORDER_LINE 2007-07-09-18.37.48.676524 BY ,=Iy -- t/ 28389 183278496096 COLLECT TABLE STATS DB2USER ORDER_LINE 2007-07-09-18.37.53.677546 BY ,=Iy DUE TO ,1'\ 28389 1772561034 START EVALUATION - PROD_DB 2007-07-10-12.36.11.092739 - - - - I& 28389 8231991291 COLLECT TABLE AND INDEX STATS DB2USER DISTRICT 2007-07-10-12.36.30.737603 BY l= -- t/ 28389 8231991291 COLLECT TABLE AND INDEX STATS DB2USER DISTRICT 2007-07-10-12.36.34.029756 BY l= -- I& 28389 1772561034 STOP EVALUATION - PROD_DB 2007-07-10-12.36.39.685188 - - - - I& a_sM3FE"U>Di/T\ g{3FE"U>D~G#s,IT(}+U>G<4F=mP"4(w}"U/3 FE"4a_i/T\# }L 1. 4(;vmT#fU>GG<0k=CmP# load from c1 of cursor replace into db2user.stats_log; 4. ZmO4(w}"U/XZCmD3FE"# create index sl_ix1 on db2user.stats_log(eventtype, event1); create index sl_ix2 on db2user.stats_log(objtype, event1); create index sl_ix3 on db2user.stats_log(objname); runstats on table db2user.stats_log with distribution and sampled detailed indexes all; U/M|B3FE"D}MekQs?|Bm0dw}1#(K&y8D“s?”I\m >P 10% = 20% DmMw}}]\0l#) v Zs(T\G#X*D&CLr.0 v 1zk*HO10MH03FE"1#g{(Z|B3FE",G4IT0g"V T\Jb# v 1$!?|D1# v 19CK REDISTRIBUTE DATABASE PARTITION GROUP 5CLr1# ":ZH0f>D DB2 P,K|n9CK NODEGROUP X|V,x;G DATA- BASE PARTITION GROUP X|V# v 9C RUNSTATS 5CLr4U/XZ XML PD3FE"#9C RUNSTATS v U/ XML PD3FE"1,+#t LOAD rO;N4P RUNSTATS 5CLrQ U/DG XML PDVP3FE"#g{H0QU/XZ;) XML PD3FE", G4Z10|n4U/XZC XML PD3FE"1,+>}H0U/D XML PD 3FE";Z10|nU/KXZC XML PD3FE"1,+f;H0U/D XML PD3FE"# *a_ RUNSTATS T\"#fC4f"3FE"DELUd,mD}]bVx D3FE"# }"XB4(CJ6LmDGF,T9BD3FE"ICZE /w# 2. ZVx}]b73PU/mD3FE"1,RUNSTATS vU/4PC|nD}]b VxODmD3FE"#+K}]bVxD RUNSTATS a{Fc=d{}]bV x#g{4P RUNSTATS D}]bVx;|,X(mD;?V,G4+ks"M= }]bVxiP|,Cm;?VDZ;v}]bVx# U/3FE"SmD}]bV xD3FE"# Z 20 B 53?<3FE" 211 U/X(PDV<3FE" * K a _ RUNSTATS Msx i / = 8 V v D ' J , I T v U / i / Z WHERE"GROUP BY M`FSdP9CDPDV<3FE"#9ITU/XZPDi OiDy}3FE"#E/w9CbVE"4Z|*}CiPPDi/@F!qT1 lbP`X# ZBP=hP,Y(}]b* sales "|,m customers,xPw} custidx1 M custidx2# Xk,SA|,mMw}D}]b"_PBPdP;v(^6p: v sysadm v sysctrl v sysmaint v dbadm v TmD CONTROL X( ":RUNSTATS vU/4PC|nD}]bVxODmD3FE"#+K}]bVxD RUNSTATS a{Fc=d{}]bVx#g{4P RUNSTATS D}]bVx;|, mD;?V,G4+ks"M=}]bVxiPVPmDC?VDZ;v}]bV x# *U/X(PD3FE": 1. ,SA sales }]b# 2. !vZzDhs,Z DB2 |nP4PBPdP;v|n: v *U/P zip M ytdtotal DV<3FE": RUNSTATS ON TABLE sales.customers WITH DISTRIBUTION ON COLUMNS (zip, ytdtotal) v *U/`,PDV<3FE",+w{V<1!5: RUNSTATS ON TABLE sales.customers WITH DISTRIBUTION ON COLUMNS (zip, ytdtotal NUM_FREQVALUES 50 NUM_QUANTILES 75) v *U/w}* custidx1 M custidx2 DPDV<3FE": RUNSTATS ON TABLE sales.customer ON KEY COLUMNS v *vU/mPX(P zip M ytdtotal T0|, region M territory DPiD P3FE": RUNSTATS ON TABLE sales.customers ON COLUMNS (zip, (region, territory), ytdtotal) v Y(Q9Cx STATISTICS !nD LOAD |nU/KG XML PD3FE"# *C XML P miscinfo D3FE"9dG XML 3FE": RUNSTATS ON TABLE sales.customers ON COLUMNS (miscinfo) v *vU/mPG XML PDP3FE"(EXCLUDING XML COLUMNS !nE HZI\8( XML PDyPd{Sd): RUNSTATS ON TABLE sales.customers EXCLUDING XML COLUMNS 212 w{}]bT\ 9IT9C“XFPD”4U/V<3FE"# U/w}3FE" U/w}3FE"TJmE/w@@Gq&C9Cw}4bvi/# ZBP=hP,Y(}]b* sales "|,m customers,xPw} custidx1 M custidx2# Xk,SA|,mMw}D}]b"_PBPdP;v(^6p: v sysadm v sysctrl v sysmaint v dbadm v TmD CONTROL X( x SAMPLED DETAILED !n4P RUNSTATS h* 2MB 3FE"Q#+=SD 488 v 4K 3Vdx*K=SZfhshCD stat_heap_sz }]bdCN}#g{CQ4p 4+!,G4 RUNSTATS Z"TU/3FE".05X;ums# *U/w}Dj83FE": 1. ,SA sales }]b# 2. !vZzDhs,Z DB2 |nP4PBPdP;v|n: v *4( custidx1 M custidx2 Dj83FE": RUNSTATS ON TABLE sales.customers AND DETAILED INDEXES ALL v *4(=vw}Dj83FE",+9CIyx;T?vw}u?4Pj8F c: RUNSTATS ON TABLE sales.customers AND SAMPLED DETAILED INDEXES ALL v *4(w}ODj8Iy3FE"T0mDV<3FE",Tcw}Mm3FE ";B: RUNSTATS ON TABLE sales.customers WITH DISTRIBUTION ON KEY COLUMNS AND SAMPLED DETAILED INDEXES ALL 9IT9C“XFPD”4U/w}Mm3FE"# U/PXm}]Dy>D3FE" i/E/w9Cm3FE"4*x(DNNi/!qnQCJ=8,rK,93FE "=!,jI RUNSTATS DYHM=l# Sf> 8.2 *<,RUNSTATS |na)K(}9C TABLESAMPLE !n4U/mP D}]y>D3FE"D!n#K&\Ia_U/3FE"D'J,-rGIy;9 C;?V}]#"R,b)Iy=(I7#<7T|_# Z 20 B 53?<3FE" 213 ITIC=V=(48(*gNU/y>#BERNOULLI =(TP6pD}]xPI y#Z}]3D{vm(hZd,a@N;P5M,-rGZ{vm(h}LP+(h?vm3#+G,P6pIy9 GC=K\sDx(!\ I/O N};PuY),bGr*U/3FE"G\{D CPU D# Z}]5D/:LH\_DivB,P6pIy+H36pIya)|CDy>#k 3Iy`H,P6py>/I\+|CX43}],-rG|+|(?v}]3P P% DP}#Z36pIyP,P% D3}DyPP<+Zy>/P#g{b)PGfzV `,Dy>#Zk**_P# ?}]DmzIj+`,D3FE"DivB,C'a"VK&\G\PCD# 9C3FE"E*D~U/3FE" RUNSTATS 5CLra)K;v!n4"a"9C3FE"E*D~,CD~G;i! n,b)!n8(*TX(mU/D3FE",}g,m3FE""w}3FE"r V<3FE"# K&\?~r/K3FE"U/,|Jmzf"Z"v RUNSTATS |n18(D;) !n,Sx,ITTm44U/`,D3FE"x;XXBdk|n!n# ^[5JOGq}ZU/3FE",}TsD#Cf"} L# wC SYSINSTALLOBJECTS f"}L,gBy>: call SYSINSTALLOBJECTS ( toolname, action, tablespacename, schemaname) dP: toolname 8(*4(r>}dTsD$_D{F#ZK>}P*“ASP”r“AUTO STATS PROFILING”# action 8(*4PDYw:“C”m>4(,x“D”m>>}# tablespacename +4(4!VbmDmUdD{F#KdkN}GI!D#g{48(KN },G4+9C1!C'Ud# Z 20 B 53?<3FE" 215 schemaname 4(r>}Ts1y9CD#=D{F#1049CKN}# }g,*ZmUd“A”P4(4!Vb,dk:call SYSINSTALLOBJECTS (’ASP’, ’C’, ’A’, ’’) ?<3FE"m BPma)XZ|,?<3FE"D53?D`PV<3FE"#;\V/|Bb)3F E"# m 57. `PV<3FE"(SYSCAT.COLGROUPDIST M SYSSTAT.COLGROUPDIST) 3FE" hv RUNSTATS !n m w} TYPE F = 5J5 Q=V;}5 G q ORDINAL iPPDr}G q SEQNO rE n,|m>Z n v TYPE 5 G q COLVALUE w*V{DVD}]5rU 5 G q m 58. `PV<3FE" 2(SYSCAT.COLGROUPDISTCOUNTS M SYSSTAT.COLGROUPDISTCOUNTS) 3FE" hv RUNSTATS !n m w} TYPE F = 5J5 Q=V;}5 G q SEQNO rE n,|m>Z n v TYPE 5 G q VALCOUNT g{ TYPE = F,G4 VALCOUNT GI SEQNO j6DPiD COLVALUE D"zN}# g{ TYPE = Q,G4 VALCOUNT Gd5!Zr HZ_PK SEQNO DPi D COLVALUE DP}# G q DISTCOUNT g{ TYPE = Q,G4KP |,!ZrHZ_PK SEQNO PiD COLVALUE D%5}?# g{;IC,G4*U# G q m 59. w}3FE"(SYSCAT.INDEXES M SYSSTAT.INDEXES) 3FE" hv RUNSTATS !n m w} NLEAF w}6S3} q G NLEVELS w}c} q G CLUSTERRATIO m}]D/:H q G(" 2) CLUSTERFACTOR |+7D/:H q j8D(" 1 M 2) Z 20 B 53?<3FE" 217 m 59. w}3FE"(SYSCAT.INDEXES M SYSSTAT.INDEXES) (x) 3FE" hv RUNSTATS !n m w} DENSITY SEQUENTIAL_ PAGES kCw} }D 2 ` w}PDNN|5 q G PAGE_FETCH_PAIRS ;,:exs!D3Cf@F5 q j8D(" 1 M 2) AVGPARTITION_CLUSTERRATIO %v}]VxZ}]D/:H q G(" 2) AVGPARTITION_CLUSTERFACTOR %v}]VxZ/:HD|+7H ?# q j8D(" 1 M 2) AVGPARTITION_PAGE_FETCH_PAIRS y]%v}]VxzID;,:e xs!D3Cf@F5 q j8D(" 1 M 2) DATAPARTITION_CLUSTERFACTOR (hw}Zd}]Vx}CD}? q(" 6) G(" 6) SEQUENTIAL_PAGES 4w}|3r;ZELOD6S3 D}?,Zb)6S3.d\YP r;PsDdt q G AVERAGE_SEQUENCE_PAGES I43rCJD=yw}3}#b G$!LrITq43rDGyl bDw}3} q G AVERAGE_RANDOM_PAGES Z3r3CJPD=yfzw}3 } q G AVERAGE_SEQUENCE_GAP rP.dDdt q G AVERAGE_SEQUENCE_FETCH_PAGES I43rCJD=ym3}#bG $!LrZ9Cw}CfmP1I Tq43rDGylbDm3} q G(" 4) AVERAGE_RANDOM_FETCH_PAGES 19Cw}CfmP1Z3r3C J.dD=yfzm3} q G(" 4) AVERAGE_SEQUENCE_FETCH_GAP 19Cw}CfmP1rP.dD dt q G(" 4) NUMRIDS w}PDG}D RID# q G NUMRIDS_DELETED w}PjG*>}D RID D\}, dOyPG}D6 S3OD RID }b q G NUM_EMPTY_LEAFS w}PdOyPG }D6S3D\} q G INDCARD w}u?D}?(w}y}) q G 218 w{}]bT\ m 59. w}3FE"(SYSCAT.INDEXES M SYSSTAT.INDEXES) (x) 3FE" hv RUNSTATS !n m w} ": 1. (}Z RUNSTATS |nO8( DETAILED Sd4U/j8Dw}3FE"# 2. }GCm\s,qr,;9C DETAILED SdU/ CLUSTERFACTOR M PAGE_FETCH_PAIRS#g{Cm,} 25 3,G4U/ CLUSTERFACTOR M PAGE_FETCH_PAIRS 3FE"#ZbVivB,CLUSTERRATIO G -1(; U/)#g{CmG;v`1!Dm,G4 RUNSTATS ;n4 CLUSTERRATIO,x;n4 CLUSTERFACTOR M PAGE_FETCH_PAIRS#g{48( DETAILED Sd,G4;U/ CLUSTERRATIO 3FE"# 3. K3FE"b?Z|,tZCmDw}DD~P3}DYVH#TZ;(eK;vw}Dm,DENSITY (#&* 100# E/w9C DENSITY 4@Fg{$!Kw}3,G4=yI\Sd{w}A!`Yv;`XD3# 4. 1Km;Z DMS mUd1,;\Fcb)3FE"# 5. 49wC|n18(*U/3FE",Z LOAD r CREATE INDEX Zd2;aU/$!3FE"#g{XUK“3 rlbj>”dCN}(seqdetect),G42;U/$!3FE"# 6. g{mD RUNSTATS !n*“q”,m>U/m3FE"1;U/3FE",g{w}D RUNSTATS !n*“G”, m>9Cx INDEXES !nD RUNSTATS |n1U/3FE"# m 60. PV<3FE"(SYSCAT.COLDIST M SYSSTAT.COLDIST) 3FE" hv RUNSTATS !n m w} DISTCOUNT g{ TYPE G Q,G4G !ZrHZ COLVALUE 3 FE"D%5}? V<(" 2) q TYPE PXPGa)_559GV ;}3FE"D8>{ V< q SEQNO 45JEPDrE,Ioz (;j6CmPDP V< q COLVALUE *U/d5JrV;}3F E"D}]5 V< q VALCOUNT }]5ZPPvVD5J, TZV;},|G!ZrH Z}]5(COLVALUE)D 5D}? V< q ": 1. (}Z RUNSTATS |nO8( WITH DISTRIBUTION Sd4U/PV<3FE"#"b,}GP5OX;yH, qr,I\;U/V<3FE"# 2. vTw}PDZ;v|PU/ DISTCOUNT# V<3FE" ITU/=V}]V<3FE": v 5J3FE" b)3FE"a)XZ num_freqvalues }]bdCN}D5y8(6pD_Pn_X 4D}?MN_X45D}?HDPM}]5DE"#*{CU/_553FE ",+ num_freqvalues hC* 0# Z 20 B 53?<3FE" 219 9IT+ num_freqvalues hC*?vm"3FE"S5 V,AY K v5;ZC5rC5TB#IT(}4}rEr54F c K V;}#K V;}5GS6'DMKpZ K v;CPD5# *8(&C+P}]5ViID?V},+ num_quantiles }]bdCN}hC* 2 M 32,767 .dD3v5#1!5* 20,|7#TNN`Hr!ZrsZ=JDE/ w@Fsnns*}r: 2.5%,xTNN BETWEEN =JDnssn*}r: 5%#*{CV;}3FE"U/,+ num_quantiles hC* 0 r 1# ITT?vmr3FE"SDSdP,G44(V<3FE": WHERE C1 = KEY; WHERE C1 IN (KEY1, KEY2, KEY3); WHERE (C1 = KEY1) OR (C1 = KEY2) OR (C1 = KEY3); WHERE C1 <= KEY; WHERE C1 BETWEEN KEY1 AND KEY2; I\"z=V`MD;yH}]V<(I\;p"z): v I\4;vr`vSdt/:}],x;GyHXZn_MnM}]5.dV<# }Di/: SELECT C1, COUNT(*) AS OCCURRENCES FROM T1 GROUP BY C1 ORDER BY OCCURRENCES DESC; v X4}]5I\-#vV# r >=),G4V;}}?&|F* 50/P# }g,25 vV;}”=J r&* 2%#(#,AY8( 10 vV;}#TZ+K;yHD}]Eh* 50 vTO DV;}#g{;h*_553FE",G4+ num_quantiles hC* 0#g{+KN }hC*“1”,G4r*5D{v6'JO;vV;},rK;U/V;}3FE"# Z 20 B 53?<3FE" 221 E/wgN9CV<3FE" E/w9CV<3FE",Tc|CX@FwVI\DCJ=8DI>4zci/# g{z;4PxP WITH DISTRIBUTION SdD RUNSTATS,G4?<3FE"m v|,TBE":mr3FE"S}: E/wh*@F|,zcH=r6'=JDP5DP}T!qI>nMDCJ=8# @F=<7,E/w+!qnECJ=8DI\TM=s#}g,(#GlwPDI>,yTnCD= 8Gh*nYlwD=8#!qK=8h*@Fzc?v=JDP}# 1QTmr3FE"S<4P RUNSTATS +V<3FE"T;IC1,G4TE/w ;PPDTBE"IC:Z~vn_D}]5(HIGH2KEY)"Z~vnMD}]5 (LOW2KEY)"%5D}?(COLCARD)MP}#;sY(;PPD}]5D5J +?`H,xR}]5yHXV} *KbE/wITgN9CV<3FE",WH} 222 w{}]bT\ g{_553FE"GICD,E/wIT9Cb)3FE"4!qJ1DCJ= 8,gBy>: v g{ KEY G N vn_55DdP;v,G4E/w9Cf"ZC?},dPP 2 Pzc=J C1=1#Z;P_553FE"DivB,z c=JDP}@F* 10,msJ* 400%#zI9CTB+=4Fc@FmsJ(YV H): @FP} - 5JP} ----------------------------- X 100 5JP} 9C_553FE"(N=1),E/w+9CTOxvD+=(2)4@F|,K5D P},}g: (50 - 40) --------- = 3 (5-1) "Rms5MK;v}?6,gBy>: 3-2 ------- = 50% 2 V;}3FE">} V;}3FE"DBP5w9Cuo“K V;}”#;PD K V;} Gn!D}]5 V,4AYP“K”P_P!ZrHZ V D}]5#*Fc K V;},+CPPDyPP 4}]5]vD3r4Er;K V;}GQErDPPZ K PPD}]5# Z 20 B 53?<3FE" 223 g{V;}3FE"IC,G4E/wIT|CX@Fzc;v6'=JDP},g TB>}y>#: KKV;} 1 0.0 4 7.1 7 8.5 10 100.0 WH“8u`H”#K@FPDmsJ|F* -100%# g{V;}3FE"IC,G4E/w(}gB=(4@FzcK,;=J(C<=8.5) DP}:iRw*dP;vV;}Dn_5D 8.5,"(}9C K DT&5 7 4w* @FP}#ZKivB,msu!* 0# VZ};,,5 10 ;Gf"DdP;v K V;}#+G,E/wIT9CV ;}4@FzcC=JDP}* r_1 + r_2,dP,r_1 Gzc=J C<=8.5DP}, x r_2 Gzc=J C>8.5ANDC<=10DP}#ZTO>}P,r_1=7#*@F r_2,E/w9C_Te5: 10 - 8.5 r_2 *= ---------- x(_P5 > 8.5 M <= 100.0 DP}) 100 - 8.5 10 - 8.5 r_2 *= ---------- x (10 - 7) 100 - 8.5 224 w{}]bT\ 1.5 r_2 *= ---- x (3) 91.5 r_2 *= 0 nU@FG r_1 + r_2 *= 7,xmsJv* -12.5%# ZTO>}PV;}a_K@FD<7T,r*5}]5“/:”Z6' 5-10.d, +j<@F+=Y(}]5yHXV20ANDC<=30DP}#9C+ =(2),r_1 @FgB: 100-80 -------- = 5 7-3 9C_Te5,r_2 @FgB: Z 20 B 53?<3FE" 225 30-20 ------- x (# 5 >20R <= 40 DP) 40-20 30-20 = ------- x (25 - 5) 40-20 = 10, C=nU@F5 15,"9msJ5M=-4D}V.;# j8Dw}3FE" g{9C DETAILED SdTw}4P RUNSTATS,G4U/XZw}D3FE",b JmE/wy]wV:eXs!@F+h*`Y}]3Cf#K=SE"ozE/w wv(}w}CJmDI>D|C@F# ": 1U/j8w}3FE"1,RUNSTATS (QO$1d,"h*|`ZfM CPU &m#SAMPLED DETAILED !n(TZKE"vFc3FOPbeDu?})h* 2MB 3FE"Q#+=SD 488 v 4K 3Vdx*K=SZfhshCD stat_heap_sz }]bdCN}#g{Q4p4+!,G4 RUNSTATS Z"TU/3FE".05X ;ums# v 1 m P c ; D s ! ( s < 25 3 ) 1 , E U / DETAILED 3 F E " PAGE_FETCH_PAIRS M CLUSTERFACTOR#ZK>}P,CLUSTERFACTOR +G Z 0 M 1 .dD;v5;x CLUSTERRATIO +G -1(;U/)#TZYZ 25 3D m,49*CmODw}8(K DETAILED Sd,CLUSTERFACTOR T+G -1(; U/),x CLUSTERRATIO T+G 0 M 100 .dD;v5# DETAILED 3FE"a)XZZ;,D:exs!B4P;vj{Dw}(h1,CJ ;vmD}]3yh*Dom I/O D}?DrwE"#1 RUNSTATS (hCw}D3 1,|+*;,D:exs!("#M,"U/13JO"z5JD@F5#}g, g{;P;v:ex3IC,G4w}}CD?vB3D, 1nMD=(I\G, U / ; v w } D DETAILED 3 F E " " l i b ) 3 F E " # g { C=D PAGE_FETCH_PAIRS GG_TD,G4#tb)3FE"# 226 w{}]bT\ S*X3FE" g{|,IUqV*DSVNrS*XDP|,ZmP,"Ri/Z WHERE SdP} Cb)P,G4&CU/S*X3FE"T7#nCDCJ=8# }g,Yh}]b|,m DOCUMENTS,mP?Phv;vD5,"YhZ DOCU- MENTS PP;vF* KEYWORDS DP,CPP|,*KD>lw?DxkCD5P XDX|VDPm#Z KEYWORDS PD5I\gBy>: ’database simulation analytical business intelligence’ ’simulation model fruit fly reproduction temperature’ ’forestry spruce soil erosion rainfall’ ’forest temperature soil precipitation fire’ Z>>}P,?P5I 5 vS*X9I,dP?v3FE"# 14PxP LIKE STATISTICS SdD RUNSTATS 1,+T`M* CHAR M VARCHAR "R_P%VZV{/(SBCS)Dzk3tT FOR BIT DATA r UTF-8 DPU/BP3FE": SUB_COUNT S*XD=y}# SUB_DELIM_LENGTH Vt?vS*XD?v(g{D=y$H,dP,Z>OBDP,(g{G; vr`v,xDUWV{# Z KEYWORDS P>}P,SUB_COUNT G 5,x SUB_DELIM_LENGTH G 1,r *?v(g{G;v%;DUWV{# DB2_LIKE_VARCHAR "amd?0lE/w&mTBq==JD==: COLUMN LIKE ’%xxxxxx’ dP xxxxxx zmNNV{.;4,Qw5S % V{*1Ma9Cb)3F E"#RUNSTATS 5CLr;U/ UDF D3FE"#g{3FE";IC,G43 FE"PD5G -1,RE/w9C1!5,b)1!5Y(;vr%D UDF# Bma)PX3FPDE",zIT*CPa)@FTa_T\: m 61. /}3FE"(SYSCAT.ROUTINES M SYSSTAT.ROUTINES) 3FE" hv IOS_PER_INVOC ?N4P;v/}1y4PDA/4ksD@F }?# INSTS_PER_INVOC ?N4P;v/}1y4PDzw8nD@F }?# IOS_PER_ARGBYTE T?vdkTd?VZy4PDA/4ksD@ F}?# INSTS_PER_ARGBYTES T?vdkTd?VZy4PDzw8nD@ F}?# PERCENT_ARGBYTES C/}+5J&mDdkTd?VZD@F= yYVH# INITIAL_IOS vZZ;N/ns;NwC/}1y4PDA/ 4ksD@F}?# INITIAL_INSTS vZZ;N/ns;NwC/}1y4PDzw 8nD@F}?# CARDINALITY ;vm/}zID@FP}# }g,hC3FE"P: v INSTS_PER_INVOC:hC*4PBPYwyhDzw8nD@F}?: – wC EU_SHOE – u**;{vdkV{. v INITIAL_INSTS"IOS_PER_INVOC"IOS_PER_ARGBYTE M INITIAL_IOS:?v< hC* 0,r*K UDF ;4PFc# PERCENT_ARGBYTES +I;v;G# *qCPX;vC'(eD/}9CD I/O M8nDE",zIT9CzD`LoT` kwrICZzDYw53D`S$_ya)Ddv# CZ(#MYhivF.D?<3FE" IT|D53?X*}](;a|D}]4m3FE")#b)| Bv0lI DB2 E/wzID+VCJ_T# v C'(eD/}(UDF)DyP(# BfT>|B EMPLOYEE mDm3FE"D;v>}: UPDATE SYSSTAT.TABLES SET CARD = 10000, NPAGES = 1000, FPAGES = 1000, OVERFLOW = 2 WHERE TABSCHEMA = ’userid’ AND TABNAME = ’EMPLOYEE’ 1V/|B?<3FE"1,zXk!D#Nb|DITOXDdsxi/DT\# 49Z}CZbTr(#DGzz}]bP,zIT9CBPNN;V=(4"B& CZb)mD|B"93FE"&Z;B4,: v TQ|DD$w%*4P ROLLBACK(Y(P4d5C$w%*)# v 9C RUNSTATS 5CLr4XBFc""B?<3FE"# Z 20 B 53?<3FE" 229 v |B?<3FE",T8>4U/3FE"#(}g,+P NPAGES hC* -1,8 >4U/3}3FE"#) v +?<3FE"f;*|D0|Gy|,D}]#v1zZxPNN|D.09C K db2look $_46q3FE"DivB,E\9CK=(# Z3)ivB,E/wI\7(3vX(D3F5r3F5DiO^'#|+9C1 !5""v/f#+G,b`iv\Y,r*Ci$Ds?V$wGZ|B3FE" 14PD# CZTzz}]b(#D3FE" P1,zI\k*bT53|,zz53}]D;vS/#+G,*b`bT53! qDCJ=8;XkZzz53O&!qDG)CJ=8`,,}G|BCbT53 D?<3FE"MdCN}4%dzz53DG)N}# ITzz}]bKPzz$_ db2look,TzI9bT}]bD?<3FE"kzz}] bD?<3FE"%dyhD|Bod#IZ#b==(-m !n)B9C db2look 4 zIb)|Bod#ZbVivB,db2look +zI;v|n&mwE>,||,*#b zz}]bD?<3FE"yhDyPod#ZbT73P(} Visual Explain 4Vv SQL r XQuery od1,|a\PC# IT9C db2look -e 4a! DDL od,TXB4(}]b}]Ts,|(m"S<" w}M}]bPDd{Ts#ITTm;v}]bKPCK|n4(D|n&mwE >,4XB4(C}]b#ITZXB4(}]bMhC3FE"DE>P;p9C -e !nM -m !n# 1TbT53KP db2look zzD|Bods,I9CCbT534i$*ZzzPz IDCJ=8#r*E/w9CmUdD`MMdC4@F I/O I>,rKbT53X kP`,DmUd8Na9rPD”#2ISXFPDwH db2look |n#9C XFPDk9C db2look |nD;v;,.&G,Z%vwCP0_;\jI;vmV vxs_n`IjI}.vmDVv#9&*@XFPD;'V LaTex dvM DB2 }]b Linux f"UNIX fM Windows f3FE"P; “S390_x” m> DB2 OS/390 r z/OS f3FE"P# 1. mc3FE"# UDB_CARD = S390_CARDF UDB_NPAGES = S390_NPAGES ;P S390_FPAGES#+G,DB2 OS/390 r z/OS fPm;n{* PCTPAGES D 3FE",|m>|,mPDn/mUd3DYVH#rx,PI\y] S390_NPAGES M S390_PCTPAGES Fc UDB_FPAGES,gBy>: UDB_FPAGES=(S390_NPAGES * 100)/S390_PCTPAGES ;P S390_OVERFLOW 43dA UDB_OVERFLOW#rx,db2look 5CLr; G+ UDB_OVERFLOW hC*1!5: UDB_OVERFLOW=-1 2. Pc3FE"# UDB_COLCARD = S390_COLCARDF UDB_HIGH2KEY = S390_HIGH2KEY UDB_LOW2KEY = S390_LOW2KEY ;P S390_AVGCOLLEN 43dA UDB_AVGCOLLEN,rx,db2look 5CLr ;G+ UDB_AVGCOLLEN hC*1!5: UDB_AVGCOLLEN=-1 3. w}c3FE"# UDB_NLEAF = S390_NLEAF UDB_NLEVELS = S390_NLEVELS UDB_FIRSTKEYCARD= S390_FIRSTKEYCARD UDB_FULLKEYCARD = S390_FULLKEYCARD UDB_CLUSTERRATIO= S390_CLUSTERRATIO d{;P OS/390 r z/OS T&3FE"D3FE";GhC*1!5#2MG: UDB_FIRST2KEYCARD = -1 UDB_FIRST3KEYCARD = -1 UDB_FIRST4KEYCARD = -1 UDB_CLUSTERFACTOR = -1 UDB_SEQUENTIAL_PAGES = -1 UDB_DENSITY = -1 4. PV<3FE"# Z DB2 OS/390 r z/OS f SYSIBM.SYSCOLUMNS P,P=V`MD3FE"# `M“F”m>5J5,`M“C”m>y}#v`M*“F”Du?JCZ DB2 }]b Linux f"UNIX fM Windows f,b)MG+;YVHD}V3FE"(}g,SYSSTAT.INDEXES PD CLUSTERRATIO) XkZ 0 M 100 .d# ":TZP`M,SmDm6p3FE" NPAGES"FPAGES M OVERFLOW ;I| B# Z;N4(m1,53?<3FE"hC* -1 T8>Cm;P3FE"#DB2 +T SQL r XQuery od`kME/9C1!5,1=U/K3FE"*9#g{B5k1 !5;;B,G4|Bmrw}3FE"I\'\#rK(izZ4(m.s,Z" T|Bmrw}3FE".04P RUNSTATS# CZV/|BP3FE"Dfr 1z|B SYSSTAT.COLUMNS PD3FE"1,q-TBFc1^k}# 232 w{}]bT\ m 62. }]`MD HIGH2KEY M LOW2KEY 5 C'PPD}]`M C'}] ` & D HIGH2KEY M LOW2KEY 5 INTEGER -12 -12 CHAR abc ’abc’ CHAR ab’c ’ab’’c’ – ;*`&PP_P 3 vTOD%5,HIGH2KEY M&CsZ LOW2KEY# v PDy}(SYSSTAT.COLUMNS PD COLCARD 3FE");\sZdT&Dm r3FE"S,byMI\s< DB2 E/w#IS3FE"|B\fDiv|(Z3%vy >mO(eD6LS<,R4Z SELECT PmO&CNNP/}#4SDS# CZV/|Bw}3FE"Dfr 1z|B SYSSTAT.INDEXES PD3FE"1,q-BfhvDfr: 1. PAGE_FETCH_PAIRS(ZSYSSTAT.INDEXES P)XkqXBPfr: v PAGE_FETCH_PAIRS 3FE"PDvp5XkI;5PUW(g{V*# v PAGE_FETCH_PAIRS 3FE"PDvp5;\,} 10 ;,RXk!Zns{ }5(MAXINT = 2147483647)# v g{ CLUSTERFACTOR sZc,Xk 8.1 *<,SQL }LT“;\@$==”KP# © Copyright IBM Corp. 2006, 2008 237 2MG5,|Gk DB2 }fZ`,DX7UdPKP#rK,RGboy5DOBD *X;GYw536pDj{OBD*X,xG8 DB2 ZcDd/#uY51wCD }L(g OLTP &CLrPD}L)r&ms?PD}L(g4P}]emD}L)P DOBD*X}ITT\zzTx0l# |, SQL PL D SQL }LG(}+dwv SQL i/`k=Lr|DwZP5VD, xZ* SQL PL /},K{},C}LI\CDfz*;* SQL /}T ns/T\D}L: CREATE PROCEDURE GetPrice (IN Vendor CHAR&(20&), IN Pid INT, OUT price DECIMAL(10,3)) LANGUAGE SQL BEGIN IF Vendor eq; ssq;Vendor 1ssq; THEN SET price eq; (SELECT ProdPrice FROM V1Table WHERE Id = Pid); ELSE IF Vendor eq; ssq;Vendor 2ssq; THEN SET price eq; (SELECT Price FROM V2Table WHERE Pid eq; GetPrice.Pid); END IF; END TBGX4D SQL /}: CREATE FUNCTION GetPrice (Vendor CHAR(20), Pid INT) RETURNS DECIMAL(10,3) LANGUAGE SQL BEGIN DECLARE price DECIMAL(10,3); IF Vendor = ’Vendor 1’ THEN SET price = (SELECT ProdPrice FROM V1Table WHERE Id = Pid); ELSE IF Vendor = ’Vendor 2’ THEN SET price = (SELECT Price FROM V2Table WHERE Pid = GetPrice.Pid); END IF; RETURN price; END kG!,wC/}kwC}L;,#*wC/},I9C VALUES odrwC|,P 'mo=D/},gZ SELECT r SET odP#TBGwCB/}DP'=(: 238 w{}]bT\ VALUES (GetPrice(’IBM’, 324)) SELECT VName FROM Vendors WHERE GetPrice(Vname, Pid) < 10 SET price = GetPrice(Vname, Pid) 1 SQL PL }LP9C;vodMQc;1,&\b9C`vod d;(#&`4r`D SQL,+5JYw1\]W|Gb;c#}g,BP SQL o d: INSERT INTO tab_comp VALUES (item1, price1, qty1); INSERT INTO tab_comp VALUES (item2, price2, qty2); INSERT INTO tab_comp VALUES (item3, price3, qty3); ITX4*%vod: INSERT INTO tab_comp VALUES (item1, price1, qty1), (item2, price2, qty2), (item3, price3, qty3); 4P`PekyhD1ds4oe# +`v SQL oduY*%v SQL mo= kd{`LoT;y,SQL oTa)=V`MDu~a9:}L(IF M CASE od) T0/}(CASE mo=)#Zs`}ivB,9CN;`MyIm>Fc,K19CD V`M;G0_Jb#+G,9C CASE mo=`4D_-;v|tU,xRH9C CASE r IF od`4D_-'J|_# k*|, CASE mo=D%v INSERT od: INSERT INTO tab_comp(Id, Val) VALUES(Oid, CASE WHEN (Price <= MaxPrice) THEN Price ELSE MaxPrice END); 5C"bDG,ITZZ{j?5DNNOBDP9C CASE mo=#XpG,|GI TCZ35odDR_#}g: IF (Name IS NOT NULL) THEN SET ProdName = Name; ELSEIF (NameStr IS NOT NULL) THEN SET ProdName = NameStr; ELSE SET ProdName = DefaultName; END IF; ITX4*: SET ProdName = (CASE WHEN (Name IS NOT NULL) THEN Name WHEN (NameStr IS NOT NULL) THEN NameStr ELSE DefaultName END); B5O,KX(>}P;V|CDbv=8: SET ProdName = COALESCE(Name, NameStr, DefaultName); ;*M@(;)1dVv"v9C SQL DML odI\^(m>D Fc#+1RGITfb9C}Lod1,PI\5JOv9C SQL DML odM\m >VPFc1,RG49C}Lod#}g0fya0DGy,}LFcDT\I\ H9C DML odm>DH[FcDT\*nC8vH6#k 100 DO IF (v1 > 20) THEN INSERT INTO tab_sel VALUES (20, v2); ELSE INSERT INTO tab_sel VALUES (v1, v2); END IF; FETCH cur1 INTO v1, v2; END WHILE; WH,IT(}&Cns;Z“+`v SQL oduY*%v SQL mo=”PV[Dd ;4DF-7we: DECLARE cur1 CURSOR FOR SELECT col1, col2 FROM tab_comp; OPEN cur1; FETCH cur1 INTO v1, v2; WHILE SQLCODE <> 100 DO 240 w{}]bT\ INSERT INTO tab_sel VALUES (CASE WHEN v1 > 20 THEN 20 ELSE v1 END, v2); FETCH cur1 INTO v1, v2; END WHILE; +(}|P8X[l,IT+{vzki`4*xPSi/D INSERT od: INSERT INTO tab_sel (SELECT (CASE WHEN col1 > 20 THEN 20 ELSE col1 END), col2 FROM tab_comp); Z-<+=P,TZ SELECT odPD?P,}LcM}]wc.d;POBD*X,"RE/wIT+VE/{vFc# m;=f,g{?v INSERT od: DECLARE cur1 CURSOR FOR SELECT col1, col2 FROM tab_comp; OPEN cur1; FETCH cur1 INTO v1, v2; WHILE SQLCODE <> 100 DO IF (v1 > 20) THEN INSERT INTO tab_default VALUES (20, v2); ELSE INSERT INTO tab_sel VALUES (v1, v2); END IF; FETCH cur1 INTO v1, v2; END WHILE; +G,K&2IT{C SQL D;N&m;v/ODTJ: INSERT INTO tab_sel (SELECT col1, col2 FROM tab_comp WHERE col1 <= 20); INSERT INTO tab_default (SELECT col1, col2 FROM tab_comp WHERE col1 > 20); [lVP}L_-DT\GgNa_D1,a"V{}Nj-7yCDNN1d 8.1 Pa)D REBIND_ROUTINE_PACKAGE ZC}L#}g,I9 CTB|nXBs(}L MYSCHEMA.MYPROC DLr|: CALL SYSPROC.REBIND_ROUTINE_PACKAGE(’P’, ’MYSCHEMA.MYPROC’, ’ANY’) Z 21 B }L 241 dP“P”8>k}L`T&DLr|,x“ANY”8>Zbv/}M`M1+ZB< P"Z"+|f"Zi/<#MP# 2. lioe `kw7#ZodDwv?VP;P;;B#w*oeliD;vr%>},`k wi$* YEAR j?/}8(DPD}]`MGUZ1d}]`M# `kw2+P*oemSACi/<#M,|(}C,E/w9CPXm"w}"PM/}D 3FE"#;s,|!q_Pn!@F4PI>D=8#E/w9Ci/<#M4 Vvi/oe,"q!PXwVrXDE",|(w}"y>m"IzDm"Si /"X*M]i# E/w9I}|(zk3*;Mwd?D9C# *T_Pwd?"(CDfwrN}jGD2,M/, SQL M XQuery odtC i/(XB)E/,&+Lr|k REOPT s(!nxPs(#g{9CKn,+9 Cwd?"N}jGr(CDfwD5x;GI`kw!qD1!@F54E/t ZCLr|"R|,b)d?D SQL r XQuery odDCJ76#15IC1, 4Pi/1MaxPKE/# PX2, SQL M XQuery odCJ=8DE"f"Z53?} ZX4i/WN,i/`kw+ SQL M XQuery odd;*|WZE/Dq=,"r KDFI\DCJ76#X4i/TZG#4SDi/(|(_Pm`Si/rm` ,SDi/)XpX*#i/zIw$_(#a4(b)\4SDi/# *0l&CZ SQL r XQuery odDi/X4frD}?,|DE/6p#*i4i /X4D;)a{,9C5w$_r Visual Explain# ITBP}Vw*==PDNN;VX4i/: v YwO" *9li/Tc|_PnYDYw}(HdG SELECT Yw),SQL M XQuery ` kwX4i/4O"i/Yw#TB>}Y}5wIO"D;)Yw: – >} - S} - Si/A,SDd; g{3v SELECT od|,Si/,G4IT^FmD3r&mD!q# – >} - {}_`,S 246 w{}]bT\ Zi/X4Zd,I}%_`,S4r/ SELECT od# – >} - 2m[/ 1i/9C;,D/}1,X4IuYh*4PDFc}# v YwF/ *9l_PnY}?DYwM=JDi/,`kwX4i/TF/i/Yw#TB >}Y}5wIF/D;)Yw: – >} - {} DISTINCT Zi/X4Zd,E/wIF/4P DISTINCT YwD;C,TuYKYwDI >#Za)D)9>}P,+?}%K DISTINCT Yw# – >} - ;c=JBF Zi/X4Zd,E/wI|D&C=JD3r,Tc+!qT|?D=J!g X&CZCi/# – >} - b}`X ZVx}]b73P,Z}]bVx.dF/a{/DI>\_#u!Xkc% Ad{}]bVxDE"Ds!M/ruYc%N},Gi/X4D?j# v =J*; SQL M XQuery `kwX4i/,TcQX(i/DVP=J*;*|ED=J# TB>}Y}5wI*;D;)=J: – >} - mS~,=J Zi/X4Zd,IT+=JmSAi/,TJmE/wZ!qCi/DnQC J=81} - OR A IN Dd; Zi/X4Zd,IT+;v OR =J*;*;v IN =J,Tq!|P'DC J=8#SQL M XQuery `kw2I+;v IN =J*;*;v OR =J,+0 aGKd;+4(;V|P'DCJ=8# `kwX4>}:S\}_HL}D01,m ;vS$J,} $35,000 D01: CREATE VIEW EMP_EDUCATION (EMPNO, FIRSTNME, LASTNAME, EDLEVEL) AS SELECT EMPNO, FIRSTNME, LASTNAME, EDLEVEL FROM EMPLOYEE WHERE EDLEVEL > 17 CREATE VIEW EMP_SALARIES (EMPNO, FIRSTNAME, LASTNAME, SALARY) AS SELECT EMPNO, FIRSTNME, LASTNAME, SALARY FROM EMPLOYEE WHERE SALARY > 35000 VZ,Y(z4PTBi/,4P>H\}_HL}xR$JV,} $35,000 D01: SELECT E1.EMPNO, E1.FIRSTNME, E1.LASTNAME, E1.EDLEVEL, E2.SALARY FROM EMP_EDUCATION E1, EMP_SALARIES E2 WHERE E1.EMPNO = E2.EMPNO Zi/X4Zd,IO"b=vS<44(TBi/: Z 22 B i/CJ=8 247 SELECT E1.EMPNO, E1.FIRSTNME, E1.LASTNAME, E1.EDLEVEL, E2.SALARY FROM EMPLOYEE E1, EMPLOYEE E2 WHERE E1.EMPNO = E2.EMPNO AND E1.EDLEVEL > 17 AND E2.SALARY > 35000 (}9CC'`4D SELECT od4O"b=vSm, 9I4Pd{X4# >} - Si/A,SDd; SQL M XQuery `kw+4P;v|,Si/Di/,g: SELECT EMPNO, FIRSTNME, LASTNAME, PHONENO FROM EMPLOYEE WHERE WORKDEPT IN (SELECT DEPTNO FROM DEPARTMENT WHERE DEPTNAME = ’OPERATIONS’) "+|*;*gBN=D,Si/: SELECT DISTINCT EMPNO, FIRSTNME, LASTNAME, PHONENO FROM EMPLOYEE EMP, DEPARTMENT DEPT WHERE EMP.WORKDEPT = DEPT.DEPTNO AND DEPT.DEPTNAME = ’OPERATIONS’ ;civB,,SD4P'JHSi/_\`# >} - {}_`,S P1`4rzIDi/I\,P;h*D,S#Zi/X4WNZd,2I\zz` FTBDi/# SELECT E1.EMPNO, E1.FIRSTNME, E1.LASTNAME, E1.EDLEVEL, E2.SALARY FROM EMPLOYEE E1, EMPLOYEE E2 WHERE E1.EMPNO = E2.EMPNO AND E1.EDLEVEL > 17 AND E2.SALARY > 35000 ZKi/P,SQL M XQuery `kwI{},S"+i/r/*: SELECT EMPNO, FIRSTNME, LASTNAME, EDLEVEL, SALARY FROM EMPLOYEE WHERE EDLEVEL > 17 AND SALARY > 35000 m;v>}Yh_PC?EED EMPLOYEE M DEPARTMENT y>m.dfZ}C DS<_PCJ(#rK,XkZ }]b\mwZ4PbV`MDE/# ZBPivB,}Cj{T,SP\I\fZ_`: v S} - 2m[/ Z;vi/P9C`v/}IzI8NFc,ba}:{} DISTINCT g{ EMPNO P;(e* EMPLOYEE mDw|,G4TBi/: SELECT DISTINCT EMPNO, FIRSTNME, LASTNAME FROM EMPLOYEE +(}}% DISTINCT Sd4X4: SELECT EMPNO, FIRSTNME, LASTNAME FROM EMPLOYEE ZTO>}P,IZ!qKw|,rK SQL M XQuery `kw*@5XD?;PQ- G(;D#ZbVivB,DISTINCT X|VG``D#g{4X4Ci/,G4E/ w+h*(}X*D&m(}g,Er)49(;v=8,T7#b)PG`lD# >} - ;c=JBF Dd=J(#&CD6pIDFT\#}g,Y(TBS<,|a)?E“D11”PyP 01DPm: CREATE VIEW D11_EMPLOYEE (EMPNO, FIRSTNME, LASTNAME, PHONENO, SALARY, BONUS, COMM) AS SELECT EMPNO, FIRSTNME, LASTNAME, PHONENO, SALARY, BONUS, COMM FROM EMPLOYEE WHERE WORKDEPT = ’D11’ Z 22 B i/CJ=8 249 "Y(TBi/: SELECT FIRSTNME, PHONENO FROM D11_EMPLOYEE WHERE LASTNAME = ’BROWN’ C`kwDi/X4WN+Q=J LASTNAME = ’BROWN’ BF=S< D11_EMPLOYEE P#b9CIT|l"I\|P'X&CC=J#ZK>}PI\4PD5Ji/ *: SELECT FIRSTNME, PHONENO FROM EMPLOYEE WHERE LASTNAME = ’BROWN’ AND WORKDEPT = ’D11’ =JDBF";^ZS<#ITBF=JDd{iv|( UNION"GROUP BY MIz Dm(6Wmmo=r+2mmo=)# >} - b}`X ZVx}]b73P,SQL M XQuery `kwIX4TBi/: iR}ZSBLrhFn?";Y6$JDyP01# SELECT P.PROJNO, E.EMPNO, E.LASTNAME, E.FIRSTNAME, E.SALARY+E.BONUS+E.COMM AS COMPENSATION FROM EMPLOYEE E, PROJECT P WHERE P.EMPNO = E.EMPNO AND P.PROJNAME LIKE ’%PROGRAMMING%’ AND E.SALARY+E.BONUS+E.COMM < (SELECT AVG(E1.SALARY+E1.BONUS+E1.COMM) FROM EMPLOYEE E1, PROJECT P1 WHERE P1.PROJNAME LIKE ’%PROGRAMMING%’ AND P1.PROJNO = A.PROJNO AND E1.EMPNO = P1.EMPNO) r*Ki/G`XD,xRr* PROJECT M EMPLOYEE ;I\y] PROJNO 4V x,rK+?vn?c%A?v}]bVxGI\D#Kb,Si/+;C;s5` N# SQL M XQuery `kwI4gBy>X4i/: v 7(SBLrhFn?D01D%5Pm,"+dF* DIST_PROJS#|XkG`l D,E\7#;T?vn?4P;N[/: WITH DIST_PROJS(PROJNO, EMPNO) AS (SELECT DISTINCT PROJNO, EMPNO FROM PROJECT P1 WHERE P1.PROJNAME LIKE ’%PROGRAMMING%’) v 9CSBLrhFn?D01D%5Pm,+CPmk01m,S,TqC?vn ?D=yb%n AVG_PER_PROJ: AVG_PER_PROJ(PROJNO, AVG_COMP) AS (SELECT P2.PROJNO, AVG(E1.SALARY+E1.BONUS+E1.COMM) FROM EMPLOYEE E1, DIST_PROJS P2 WHERE E1.EMPNO = P2.EMPNO GROUP BY P2.PROJNO) v ZG,Bi/+d*: SELECT P.PROJNO, E.EMPNO, E.LASTNAME, E.FIRSTNAME, E.SALARY+E.BONUS+E.COMM AS COMPENSATION FROM PROJECT P, EMPLOYEE E, AVG_PER_PROG A WHERE P.EMPNO = E.EMPNO 250 w{}]bT\ AND P.PROJNAME LIKE ’%PROGRAMMING%’ AND P.PROJNO = A.PROJNO AND E.SALARY+E.BONUS+E.COMM < A.AVG_COMP X4Di/Fc?vn?D AVG_COMP(AVG_PRE_PROJ),;s+a{c%A|, EMPLOYEE mDyP}]bVx# `kwX4>}:~,=J TBi/zz;vd?EGr“E01”(fD-mDPm,T0G)-my:pDn?D Pm: SELECT DEPT.DEPTNAME DEPT.MGRNO, EMP.LASTNAME, PROJ.PROJNAME FROM DEPARTMENT DEPT, EMPLOYEE EMP, PROJECT PROJ WHERE DEPT.ADMRDEPT = ’E01’ AND DEPT.MGRNO = EMP.EMPNO AND EMP.EMPNO = PROJ.RESPEMP Ci/X4mSTB~,D=J: DEPT.MGRNO = PROJ.RESPEMP w*KX4Da{,E/wZ"T!qCi/DnQCJ=81ITX= J#}g,TBi/+P>d?EEsZ“E00”D?EMZb)?E$wD01D{ F# SELECT EMPNO, LASTNAME, FIRSTNAME, DEPTNO, DEPTNAME FROM EMPLOYEE EMP, DEPARTMENT DEPT WHERE EMP.WORKDEPT = DEPT.DEPTNO AND DEPT.DEPTNO > ’E00’ TZKi/,CX4WNmSTB~,D=J: EMP.WORKDEPT > ’E00’ w*KX4Da{,E/wauY*,SDP}# >} - OR A IN Dd; Y(;v OR Sdy],;P+=vr|`vr%DH==J`,,gTB>}y>: SELECT * FROM EMPLOYEE WHERE DEPTNO = ’D11’ OR DEPTNO = ’D21’ OR DEPTNO = ’E21’ g{ DEPTNO PO;Pw},+ OR Sd*;*TB IN =JJm|P'X&mCi /: SELECT * FROM EMPLOYEE WHERE DEPTNO IN (’D11’, ’D21’, ’E21’) ":Z3)ivB,}]b\mwIT+;v IN =J*;*;i OR Sd,TcI4 Pw} OR Kc# Z 22 B i/CJ=8 251 =J`MMCJ=8 C'&CLr9Ci/odS}]bks;iP,Ci/od8(*w*a{/5X DX(PD^(J#b)^({(#vVZi/D WHERE Sd#bV^({F*= J#IT+=JVi*DV`p,4gNZs5}LP9CC=JT0N19C|4 7(b)`p#b)`pP>gB,4nQT\=nnT\D3rEP: 1. 6'(g=J 2. w}XF=J 3. }]XF=J 4. Pt=J# ":SARGable G8ICwQwTd?Duo# Bm\a=J`p#sxwZ|j8Xhv?v`p# m 63. =J`MXwD\a Xw =J`M 6'(g w}XF }]XF Pt uYw} I/O G qqq uY}]3 I/O GGqq uYZ?+MD P} GGGq uYOqPD} ? GGGG 6'(gMw}XF=J 6'(g=J^Fw}(hD6'#|Ga)w}QwD* :hv5 0=v=J(NAME = :hv1 M DEPT = :hv2)G6'(g=J,x YEARS > :hv5 G w}XF=J# E/wZTb)=Js519Cw}}]x;GA!y>m#b)w}XF=Ju! h*SmPA!DP/,+|G;0lCJDw}3}# XSCAN }]Kc{(h2'V XMLEXISTS M XMLTABLE mo=PvVD XML }]OD=J#w}6'(h2'Vb)=JPD;?V=J# }]XF=J 252 w{}]bT\ w}\mw;\s5+}]\m~qITs5D=JF*}]XF=J#b)=J( #h*CJmPD%@P#g{h*,“}]\m~q”lwTC=Js5h*DPT 0NNd{PTzc SELECT PmP;\SCw}q!DP# }g,#|GI_PBPXw: v 9C`XSi/ v 9C?/Si/,b)Si/|, ANY"ALL"SOME r IN Sd v A! LONG VARCHAR r LOB }],C}]f"ZkmV*DD~P bV=JI“X5}]~q”4s5# P1,1CJ}]31,XkXB&Cv&CZw}D=J#}g,1CJ}]3 1,9Cw} OR Kcrw} AND KcDCJ=8X?X x;Z}]4T!q=Js5D'{#bVs5I\*s DB2 S6L}]4lw{v m,;sZ>XTC=JxP}K#xgX[/ 6L}]2a*s DB2 S6L}]4lw{vm# }g,YhGF N1 }C DB2 OS/390® r z/OS f}]4PD}]4m EMPLOYEE# ,1YhCmP 10,000 P,dP;P|,01DU,;P|,$J# ’B’ AND SALARY > 50000 GROUP BY LASTNAME; !vZ DB2 M DB2 OS/390 r z/OS fOD{m3rGq`,,X4PG)Yw|P '#TZTOi/,C=JM GROUP BY YwIZ}]4P4P# v g{{m3r;,,G4;\Z}]4T{v=Js5#+G,E/wI\v(B F=JD SALARY > 50000 ?V#T;XkZ DB2 xP6'HO# v g{{m3r`,,RE/w*@>X DB2 ~qwG#l,G4E/wI\v(Z DB2 P>X4P GROUP BY YwGnC(I>nM)D=(#Z}]4PTC=Js 5#bGBFVvaO+VE/D>}# (#,?jG7#E/wZ}]4&T/}MKc{s5#m`rX0lGqZ6L }]4T/}r SQL Kc{s5#+*@@DrXV`*BP}i: v ~qwXw v GFXw v i/Xw 0lBFzaD~qwXw 3)X(Z}]4DrXa0lBFza#;civB,IZ DB2 'Va;D SQL = T,rKfZb)rX#ki/CJD~qwy'VD SQL oT`H,KoTIa) |`D&\#DB2 IV9}]~qwP/}D;c,+byvI\*sZ DB2 P4P Yw# SQL \&:?v}]4<'V;,D SQL oTM;,6pD&\#}g,X4P GROUP BY Yw# SQL XTK/} s5# SQL ^F:!\ DB2 I\Jm9CH|D6L}]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I\z Im;vN=H'D=JTCZ"M=}]4D6L SQL od#C'I\a4=@? }]4s5Dm;v=J,+nUa{&GH'D# 9C numeric_string !n48>CPPD5Gq\G;xa2UWD}5# Bmhvb)!n# m 64. P!n0dhC !n P'hC 1!hC numeric_string “Y” G,KP;|,}V}].#*c:g{P;|,}V.Rsf xa2UW,;*8(“Y”# “N” q,KP;^Z}V}].# g{+PD numeric_string hC*“Y”,G4+f*E/wKP;|,I\ IEP}]ErDUq#1}]4D{m3rk DB2 D;,1,K!n\ PC#CK!njGDG)P;ar*{m3r;,xS>X(}]4) s5PE}# “N” varchar_no_trailing_blanks 8(K}]4Gq9CGUqndD VARCHAR HOoe#TZ;|,a 2UWDd$V{.,3) DBMS DGUqndHOoe5Xk DB2 D HOoe`,Da{#g{7OZ;v}]4PDyP VARCHAR m/S< P<;|,a2UW,DZ]P# g{BFi/,&a4= RETURN Kc{#RETURN Kc{GjXKc{ k6LKc{xV*4#C SELECT odG9C}]4'VD SQL oTzID# |I|,C}]4DNNP'Di/# g{ITj++ INSERT"DELETE r UPDATE i/BFA6L}]b,G4 SHIP odI\;avVZCJ=8P#aT RETURN Kc{T>yPT6L==4PD INSERT"UPDATE M DELETE od#+G,g{;\j+BFi/,SHIP Kc{ aT>D)YwGT6L==4PD# 256 w{}]bT\ v SQL 5w#C db2expln r dynexpln |nt/#IC|4i4D>q=DCJ= 8_T# Kb*24Z}]4r DB2 PTi/s5 Z0svSBFzaD=(1,kX&m|Z!I># v *24;T GROUP BY Kc{xP6Ls5? P8v=fIli: – T GROUP BY Kc{DdkxP6Ls5p?g{XpGq(D,G4lid k# – }]4TKKc{PNN^Fp?}g: - GROUP BY DP^n} - iOD GROUP BY nDP^VZF} - PfqvfZZ GROUP BY PmO – }]4'VK SQL Kc{p? – +VE/#E/wI\Q-v(>X&m|Z!I># – GROUP BY Kc{Sd|,V{mo=p?g{|,,i$6L}]4Gqk DB2 ;yxVs!4# v *24;T/OKc{xP6Ls5? P8v=fIli: – |D=vYw}j+Z,;6L}]4Ps5p?p8&CGO(D,g{; G,li?vYw}# – }]4TK/OKc{PNN^Fp?}g,sTsr${}VNGqGKX( /OKc{DP'dk? v *24;T ORDER BY YwxP6Ls5? X==9GZ}]4T6L==T ?vYwxPs5#|y]dI>#MDdvwvv(,Cdv;+|(TYwxP s5DI>,9|(Z DB2 M}]4.d+M}]r{"DI># d;?jGzzE/i/,+TBw*rX0l+VE/Ddv,rx2a0li/ T\# v ~qwXw v GFXw 0l+VE/D~qwXwM!n TB}]4~qwrXI\0l+VE/: v CPU YHD`THJ 9C cpu_ratio ~qw!n48(k DB2 CPU `H,}]4 CPU YHDl}#M HJ8>}]4Fcz CPU H DB2 Fcz CPU l#g{HJOM,G4 DB2 E /w\I\ak DB2 53`H,}]453 I/O YHl`Yr }`Y#MHJ8>}]4$w> I/O YHH DB2 $w> I/O YHl#g{HJ OM,G4 DB2 E/wxg]?#MYJ(|8> DB2 M}]4.dD xg(EO})Y9 DB2 E/wuYrK}]4"MrSK}]4SUD{"}# g{+CYJhC* 0,E/w+4(h*n!xgw?DCJ=8# v }]4{m3r 9C collating_sequence ~qw!n48(}]4{m3rGqk>X DB2 }]b {m3r%d#g{4+K!nhC*“Y”,G4E/w+O*SK}]4lwD} ]G4ErD# v 6L=8a> 9C plan_hints ~qw!n48(&Z}]4zIr9C=8a>#1!ivB,DB2 ;+NN=8a>"MA}]4# =8a>G*}]4E/wa)nbE"DodVN#TZ3)i/,KE"IT a_T\#=8a>Ioz}]4E/wv(Gq9Cw}"9CDvw}r9C DVm,S3r# g{tC=8a>,G4"M=}]4Di/+|,d{DE"#}g,x=8a >"M= Oracle E/wDodI\gBy>: 258 w{}]bT\ SELECT /*+ INDEX (table1, t1index)*/ col1 FROM table1 C=8a>GV{. /*+ INDEX (table1, t1index)*/# v DB2 E/w*6bPDE" DB2 P;v|,>X}]4}]DE/w*6b#DB2 E/w;azIX( DBMS ^(zID6LCJ=8#;d05,DB2 \bzI6L}]4DE/w;\mbr S\D=8# 0l+VE/DGFXw TBX(ZGFDrXa0l+VE/# w}"bBn:DB2 IT9C}]4PDw}E"4E/i/#IZK-r,DB2 I CDw}E"&GnBD,bc\X*#GFDw}E"nuGZ4(GF1q! D#;U/SXmO4(w}Do (`F# ZBPivXyZGF4(k}]4mODw}%d Dw}ITxDFi/T\#+G,g{GZ>XT"GIr%D!qodiIDS <(}g,(},S=vm4(DS<)4(w},I\ap&i/T\#}g,T (}=vmD,S9IDS<4(w},E/wI\a!qCS}10GF"XB4(#g{a9 E"Q|D,G49CK=(# v V/|B SYSSTAT.TABLES S+VCJ=8: v Visual Explain#S“XFPD”t/|,r4P db2cc |n,C|nt/“XFPD”# 9C Visual Explain 4i4i/CJ=8<#?vKc{D4P;C<|(ZCKc {j8T>DZ]P#y]i/`M,9IZ SHIP r RETURN Kc{PR=*? v}]4zID6L SQL od#(}li?vKc{Dj8E",ITi4 DB2 E /ww*?vKc{DdkMdvy@FDP}#9IKb4P?vKc{D@F I>,|((EI>ZZ# v SQL 5w#C db2expln r dynexpln |nt/#IC SQL 5w4i4D>q=D CJ=8_T#d; SQL 5w;Pa)I>E",zT;ITqC6LE/w*6 L5w&\y'VDG)}]4zIDCJ=8# Kb DB2 E/P( XTK GROUP BY s 5|P'#xR,b=v}5Pbep?g{XpGq(D,G4DE/#49BFVv8>?vKc{@F4zI+VE/=8#P\`rXITC=8zz0 l#}g,496L}]4I&m-# y]|D@F,E/w!qE/CJ=8#CJ=88(bv;u SQL r XQuery o dyhDYw3r#1s(;v&CLr1,a4(;vLr|#KLr||,C& CLrPyP2, SQL M XQuery odDCJ=8#/, SQL M XQuery odDC J=8Z4P&CLr14(# P=V=(4CJmPD}]: v 3r(h{vm v (}WHCJmODw}4(;X(mP *zzi/ksDa{,y]=JDun!qP,(#Z WHERE SdP5wb)u n#,SCJmP!qDP4zza{/,"IT(}VirErdv4x;=&m a{/# (}w}(hD}]CJ Z}]b\mwrBPNN;v-rCJ;vw}1,4Pw}(h: v ZCJy>m0,u!OqPD/O((}(hCw}X(6'ZDP)#w}(h 6'((hDpcMUc)IHOw}PDi/PD57(# v Erdv# v 1SlwksDP}]#g{yPksD}];ZCw}P,G4;h*CJw} m#bMF*?w}CJ# g{9C ALLOW REVERSE SCANS !n4(w},G42IT4k(eD=r`4 D=r44P(h# ":g{44(J1Dw}rg{w}(hDI>+|_,G4E/w!qmw}# 1m;s"w}/:HJMri/kss`}mP1,w}(hDI>I\|_#* iwCJ=89Cm(h9Gw}(h,9C5w$_# (g6'Dw}(h *7(w}GqITCZX(i/,E/wSw}Z;P*r~,HOKc#ZBPivB,I9C=J4(gw}(h6' D: Z 22 B i/CJ=8 261 v bTGqHZ;v#}"wd?"5*#}Dmo=rX|V v bT“*U”9G“;*U” v bTGqHZy>Si/(|G;|, ANY"ALL r SOME DSi/),RCS i/;P`XP}Cd1S8i/i(4,KSi/GdS!qD SELECT)# v bTOqM`];H=# TB>}Y}5ww}N1ITC4^F3v6': v }9CKwd?,+d{d?(}g,N}jG"mo=r#})+aP`, D'{# v : CREATE INDEX iname ON tname (cname DESC) ALLOW REVERSE SCANS ZbVivB,y] cname PD5r549(w}(iname)#Jm4r(hs,!\ PPDw};(e*45r(h,+2IT4}rxP(h#5JGqT=v=r 9Cw};GIzXFD,xGIE/wZ4(M)M!Z(<)# 262 w{}]bT\ ;}P, NAME M DEPT POD=JICZ(gC6',+;\9C MGR POD=J# WHERE NAME = :hv1 AND DEPT > :hv2 AND DEPT < :hv3 AND MGR < :hv4 v `];H==J TBGICw6'(g=JD`];H=Kc{: –>=M <= – BETWEEN – LIKE *(gw}(hD6',+}P,y P=J= :hv2 AND DEPT <= :hv3 AND MGR <= :hv4 *x;=5wK>},Y( :hv2 = 404":hv3 = 406 M :hv4 = 12345#}]b\ mw+9CCw}(h?E 404 M 405 D+?,+1|(h=01E(MGR P) sZ 12345 DZ;v-m1|+#9(h?E 406# Er}]w}(h g{i/*s4Er3rdv,xR,g{ErPSZ;vw}|P*<,xvVZ Cw}P,G4I9Cw}4T}]Er#7(3rrErII`FgBDYwz z:ORDER BY"DISTINCT"GROUP BY"“= ANY”Si/"“> ALL”Si/"“< ALL”Si/"INTERSECT"EXCEPT r UNION#;v}bG1HOw}|PGqH Z“#}5”1,C#}5G5*#}DNNmo=#ZbVivB,ErP;\GZ ;vw}|P# km,MIzcTBi/: SELECT NAME, DEPT, MGR, SALARY FROM EMPLOYEE WHERE NAME = ’SMITH’ +G,-#h*4vVZCw}PDP#*q!b)PD}],XkA!mP#*J mE/w!q?w}CJ,4(_P|,PD(;w}#}g,GqOm# g{\Y4P(}vA!bVw}MITzcDi/,G4I>I\;Om# `vw}CJ E/wIT!q(h,;mOD`vw}4zc WHERE SdD=J#}g,= :hv3) (hw} IX2 zzzc DEPT = :hv1 =JDPj6(RID)DPm#(hw} IX3 z zzc JOB = :hv2 AND YEARS >= :hv3 =JD RID DPm#ZCJCm.0,iO RID Db=vPm,"}%X45#bF*w} OR Kc# w} OR Kc2ICZ IN SdP8(D=J,gB>}Py>: WHERE DEPT IN (:hv1, :hv2, :hv3) 264 w{}]bT\ !\w} OR KcD?DG{%X4D RID,+G,w} AND KcD?jGiR+ 2 RID#IZ{OBPu~D&CLrZ4Pw} AND Kc:Z,;vmZDT&P O4(`vw},RTCmKP9C`v AND =JD;vi/#Zb`i/PT_P w}D?;P4P`w}(h,+zz;"PT4(;}P,(hw} IX4 zz;vzc SALARY BETWEEN 20000 AND 30000 =JD ;<#(h IX5 M=b IX4 D;}P,6'ZDZ;v|5GmPDZ;P,6'ZDZ~v5G mPDZ~P,@K`F# E/w9CmD6'/:tT4y]nQ/:w}(|D(;I>MGFc6'/: /})4zICJ=8##$KmPDPD/:,bGr*6'/:m#tK|GD -<|5Er# w}CJM/:HJ 1|!qCJ=81,E/w@F+yh*D3SELCfA:eXyh*D I/O N }#K@F|($b:eXD9Civ,r*;h*d{ I/O 4A!QZ:eXZ;3 PDP# TZw}(h,53?#|9C SYSCAT.INDEXES mPTBPPDE": v CLUSTERRATIO E"8>m}]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{C,S9C_H/:Dw}4CJZ?m,Rg{ b?mQEr,G4I+CJDw}3D}?uAn!# mb,g{E/wZ{C,S+4P;vI>|_D"|BDEr,G4E/w2I !qZ,S04PEr#*'V GROUP BY"DISTINCT"ORDER BY rO",S, I\Xh|BDEr# O",S O",S(P1F*O"(h,SrErO",S)h*gBq=D;v=J table1.column = table2.column#bF*H=,S=J#O",Sh*,SPDQErd k,bvdkI(}w}CJr(}Er4qC#g{,SPG LONG VNPrsT s(LOB)P,G4;\9CO",S# ZO",SP,,1(hQ,SDm#O",SDb?m;(h;N#}Gb?mP vVX4D5,qr,Z?m2;(h;N#g{PX4D5vV,G4I\YN( hZ?mPD;iP#}g,g{m T1 M T2 PDP A PBP5: b?m T1:P A Z?m T2:P A 21 32 32 3 3 *4PO",S,}]b\mw4PBP=h: 1. S T1 PA!Z;P#A D5G“2”# 2. (h T2,1="V%dn,;s,Sb=P# 3. ,x(h T2,1P%d1,,SG)P# 4. 1A! T2 PD“3”1,5XA T1 "A!B;P# 5. T1 PDB;v5G“3”,|k T2 %d,rK,SG)P# 6. ,x(h T2,1P%d1,,SG)P# 7. =o T2 a2# 268 w{}]bT\ 8. 5XA T1 TA!B;P - "b T1 PDB;v5k T1 PDO;v5`,,r KS T2 PDZ;v“3”*# 1+E/w6phC* 9 1rZGM#=DXbivB,"zvPD}biv#GM# =|,;vF*B5mDPkm,xd{mF*,m#+?,mvP;v%;,S, C,S+b),mkB5m,S,x;\i/G24#?v,m|,9*PXB5m PX(PDE"Dd{5#dMDi/I`v}C,mPD5D>X=JiI,"| ,+,mkB5m,SD,S=J#TZb)i/,ZCJsDB5m.0,T`v !,mFcQ({K}I\PC&#K,G4E/w!qC=8# TOV[DGM#=,S_TYh,SP9CKw|w}#m;v=8f0=b|w }#g{B5mPDb|PG%Pw},RZyP,mPP`1_D!qT,I9C TBGM,SmP# 6. +B5mkd?v,mXB,S,CJ SELECT Sdyh*D,mPDP# 7. XB&CPt=J# K30000 TZ?V{5,RG;h*7(|QzzDdP;vMED[[Gq,}K 30000 @ *#;h*+;V{5k|QzzD[[,} 30000 @*DyPME<,Sp4T#$ i/a{D}7T# 1T GROUP BY mS MIN r MAX [//}1,2ITxP$dv,S#}g, = 1.1 GROUP BY DAILYSTOCKDATA.SYMBOL CRG+“OqD/O”(e* DAILYSTOCKDATA mPzcUZM[q*sD;vP /,"k SP500 mPDX(I1zkxP,S#TZ SP500 mPD?vI1zkP, g{T DAILYSTOCKDATA mPDOq/O4 DATE xP5rEP,G4;h*T ?vI1zk5XOq/OPDZ;P,r*Z;PMGCX(I1Dn|UZ#T Z#$i/D}7T45,";h*Oq/OPDd{P# iOm 1;TmD,Sa{G;vF*iOmDBm1,Km(#I*_Pm;vZ?mD m;v,SDb?m#bF*“iOb,S”#Z3)ivB,XpGZ9C07,S 6Y}#wBPY(: Z 22 B i/CJ=8 271 v SALES mZ`VxmUd REGIONTABLESPACE P,RZ REGION POVn# v EMPLOYEE M DEPARTMENT mZ%;Vx}]bVxiP# y] EMPLOYEE mPDE"4(4FD_e/i/m# CREATE TABLE R_EMPLOYEE AS ( SELECT EMPNO, FIRSTNME, MIDINIT, LASTNAME, WORKDEPT FROM EMPLOYEE ) DATA INITIALLY DEFERRED REFRESH IMMEDIATE IN REGIONTABLESPACE REPLICATED; *|BX4D_e/i/mDZ],KPBPod: REFRESH TABLE R_EMPLOYEE; ":9C REFRESH od.s,z&CZ4FmOKP RUNSTATS,}gzZNNd {mO*KPD;y# TB>}Fc01Dz[n"?E\z[nM\F: SELECT d.mgrno, e.empno, SUM(s.sales) FROM department AS d, employee AS e, sales AS s WHERE s.sales_person = e.lastname AND e.workdept = d.deptno GROUP BY ROLLUP(d.mgrno, e.empno) ORDER BY d.mgrno, e.empno; g{;9CvZ;v}]bVxOD EMPLOYEE m,G4}]b\mw9C R_EMPLOYEE m,CmZf" SALES mD?v}]bVxOyP4F#byT\+ av?,r*01E";X(}xg+M=?v}]bVx4FcC,S# "C,SPDX4_e/i/m X4D_e/i/m2IT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rZ?m,S 9C(rZ?m,S_T,y]b?mDVntT,+Z?mD?;P"MAb,S mD;v}]bVx#C,SZK}]bVxOxP#TB}# < 27. c%Z?m,S>} Z 22 B i/CJ=8 279 ErMViD'{ 1E/w!q;vCJ=81,|a} 280 w{}]bT\ # VxZ"P,S_T SzmLrIT"P4P,SYw#"P,S_TI}]wDXw7(# (}Z,SDZ?Mb?mOVxM/r4F}]w,I+,S"P/#}g,g{r *"P(hQ+;v6W-7,SDb?wVx,xRZ?wI?vSzmLr%@ XBs5,G4I+C,S"P/#g{;vO",SDZ?Mb?wr*VxEr }P# }: SELECT * FROM SALES WHERE MONTH=’March’ AND REGION=’SE’ TZKi/,E/wIT4P,iw}iR40RvVZB]*}BRXx* SE D i#;sCi/ITvlY(hmDa{i4Cfa{/# Z 22 B i/CJ=8 283 *v>} 1zcJm9C*vTxP>}Du~1,Ma9C>} MDC mPDPD|P'= (#b)u~G: v Qwx;G(; DELETE od(4,;9C“WHERE CURRENT OF”Sd)# v ;P WHERE Sd(+>}yPP)r WHERE SdPvPDu~GkT,D# v 49C DATA CAPTURE CHANGES Sd4(em# v mZ}Cj{TX5P;G8m# v m;P(e“>}1”%"w# v 4ZNN"4"BD MQT P9Cm# v g{6*>}YwDb|GdmD,PDS/,G4|I\JOZ*v# v Z%"I CREATE TRIGGER odOD OLD TABLE AS Sd8(D SQL Yw. 0,DELETE od;\vVZTCZj6\0lP/DY1m4PD SELECT od P# TZ*v>},;aG<;>}DG<#xGa(}XBq=/3D3)?V49| ,b)Gm# "4e}*vb;1!P*MGZ>}1Me} RID w}#9IT(}+"amd? DB2_MDC_ROLLOUT hC* IMMEDIATE,r_(}T SET CURRENT MDC ROLLOUT MODE od8( IMMEDIATE 48(K==#kj<>}`H,w}|BD U>G<;Pd/,rK,T\a_!vZP`Yv RID w}#RID w}=Y,T\ M=C,b?=(G\1dkU>UdDYVH# IT(}TB+=4@FU>P#`DUd?,dP N GQ>}DG<},S GQ>} DG{M varchar $HD*z),P G|,Q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f"Ts(F*}]Vxr6')P#y] CREATE TABLE odD PAR- TITION BY SdP8(DZ],x(mD}];.V=`vf"TsP#b)f"T sITZ;,DmUdP,2ITZ`,mUdP# TB>}]>K}]Vx{}yzzDT\=fDC&#g{"vTBod: CREATE TABLE custlist(subsdate DATE, Province CHAR(2), AccountID INT) PARTITION BY RANGE(subsdate) (STARTING FROM ’1/1/1990’ IN ts1, STARTING FROM ’1/1/1991’ IN ts1, STARTING FROM ’1/1/1992’ IN ts1, STARTING FROM ’1/1/1993’ IN ts2, STARTING FROM ’1/1/1994’ IN ts2, STARTING FROM ’1/1/1995’ IN ts2, STARTING FROM ’1/1/1996’ IN ts3, STARTING FROM ’1/1/1997’ IN ts3, STARTING FROM ’1/1/1998’ IN ts3, STARTING FROM ’1/1/1999’ IN ts4, STARTING FROM ’1/1/2000’ IN ts4, STARTING FROM ’1/1/2001’ ENDING ’12/31/2001’ IN ts4); Y(zT 2000 jDM'E"PK$#g{"vTBi/: SELECT * FROM custlist WHERE subsdate BETWEEN ’1/1/2000’ AND ’12/31/2000’; }gZ 286 3D< 29yT>DGy,}]b~qw7(;h*CJmUd 4(ts4)PD ;v}]VxMITbvKi/# Z 22 B i/CJ=8 285 <<30 PT>Dm;v}]Vx{}>}Gw}(h,|f0=vw}"y]TB= 8xP(h: CREATE TABLE multi (sale_date date, region char(2)) PARTITION BY (sale_date) (STARTING ’01/01/2005’ ENDING ’12/31/2005’ EVERY 1 MONTH); CREATE INDEX sx ON multi(sale_date); CREATE INDEX rx ON multi(region); g{"vTBi/: SELECT * FROM multi WHERE sale_date BETWEEN ’6/1/2005’ AND ’7/31/2005’ AND REGION = ’NW’; < 29. VxmO}]Vx{}yzzDT\=fDC& < 30. mVxMw}“k”(AND)DE/wv_76 286 w{}]bT\ Z;9CmVx1,;VI\D=8Gw}“k”(AND)#w}“k”(AND)4PBP Nq: v A!?vw}PDyP`Xw}u? v #f=iPj6(RID) v %d RID T7(D) RID ,1vVZb=vw}P v 9C RID 4CfP gZ 286 3D< 30 Py>,Z9CmVxDivB,A!w}TiR region M sale_date D%dn,SxJmlYlw%dP# DB2 Explain 9IT9C DB2 5w47( DB2 E/w!qDVx{}#DP Elim Predicates E "T>(hKD)}]Vx4bvTBi/: SELECT * FROM custlist WHERE subsdate BETWEEN ’12/31/1999’ AND ’1/1/2001’ Arguments: --------- DPESTFLG: (Number of data partitions accessed are Estimated) FALSE DPLSTPRT: (List of data partitions accessed) 9-11 DPNUMPRT: (Number of data partitions accessed) 3 DP Elim Predicates: ------------------ Range 1) Stop Predicate: (Q1.A <= ’01/01/2001’) Start Predicate: (’12/31/1999’ <= Q1.A) Objects Used in Access Plan: --------------------------- Schema: MRSRINI Name: CUSTLIST Type: Data Partitioned Table Time of creation: 2005-11-30-14.21.33.857039 Last statistics update: 2005-11-30-14.21.34.339392 Number of columns: 3 Number of rows: 100000 Width of rows: 19 Number of buffer pool pages: 1200 Number of data partitions: 12 Distinct row values: No Tablespace name: `P'V Z9C`vPw*mVx|DivB,}]Vx{}+pwC# }g,g{"vTBod: CREATE TABLE sales (year INT, month INT) PARTITION BY RANGE(year, month) (STARTING FROM (2001, 1) ENDING AT(2001,3) IN ts1, ENDING AT(2001,6) IN ts2, ENDING AT(2001,9) IN ts3, Z 22 B i/CJ=8 287 ENDING AT(2001,12) IN ts4, ENDING AT(2002,3) IN ts5, ENDING AT(2002,6) IN ts6, ENDING AT(2002,9) IN ts7, ENDING AT(2002,12) IN ts8) SE,"vTBi/: SELECT * FROM sales WHERE year = 2001 AND month < 8 i/E/wFO;h*CJ ts1"ts2 M ts3 PD}]VxMITbvKi/# ":Z`vPiImVx|DivB,;P15PiO|D0}P4(Dm,4PBPi/: SELECT * FROM sales WHERE (year = 2001 AND month <= 3) OR (year = 2002 and month >= 10) }]b~qw;CJ 2001 jDZ;>HM 2002 jDns;v>HD}]# zIP IT+zIPCwmVx|# }g,IT"vTBod: CREATE TABLE sales(a INT, b INT GENERATED ALWAYS AS (a / 5)) IN ts1,ts2,ts3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QT DE"# r* MQT DP*Zm`=f`FZ;cm,yTPX9CmUd(e4E/}]C J"4(w}T0"v RUNSTATS D}5wK`,Vvi/T0|gN{C MQT# ZK>}P,Y(by;v}]bVb:||,;iM'M;iEC(J'#VbG <9CEC(xPD;W/#?n;W<|,;z;p:rDo7#K#=V`*` GM#=,r*P=vsm,;v|,;WL7,m;vj6:r;W# }vcNa9,hv;n;W:z7";CM1d#z7cNa9f"Z=vVpm >z7iMz7PDjM'DJ' E"MM'E"# 9CTBcNa9D?;6pDz[\nMz[~}44( MQT: v z7 v ;C v 1d,Ij"BMUiI# SKf"D[/}]ITzcm`i/#TB>}T>gN4(;v MQT,C MQT 4 U product group M product line ,"4U city"state M country ,T04U Time , 4Fcz[pnMz[~}#Z|D GROUP BY SdP,9|(8vd{DP# CREATE TABLE dba.PG_SALESSUM AS ( SELECT l.id AS prodline, pg.id AS pgroup, loc.country, loc.state, loc.city, l.name AS linename, pg.name AS pgname, YEAR(pdate) AS year, MONTH(pdate) AS month, t.status, SUM(ti.amount) AS amount, COUNT(*) AS count FROM cube.transitem AS ti, cube.trans AS t, cube.loc AS loc, cube.pgroup AS pg, cube.prodline AS l WHERE ti.transid = t.id AND ti.pgid = pg.id AND pg.lineid = l.id AND t.locid = loc.id AND YEAR(pdate) > 1990 GROUP BY l.id, pg.id, loc.country, loc.state, loc.city, year(pdate), month(pdate), t.status, l.name, pg.name ) DATA INITIALLY DEFERRED REFRESH DEFERRED; REFRESH TABLE dba.SALESCUBE; I{Cb`$HFcD\nDi/|(TB8V: v 4BMz7iDz[n v 1990 jT4D\z[n v 1995 jr 1996 jDz[n 290 w{}]bT\ v z7irz7_Dz[\n v X(z7irz7_Z 1995"1996 jDz[\n v X(zRrXxDz[\n# 1 MQT 4|(TONN;vi/D<7p81,9C MQT Fcp8DI>I\wT X!Z9CsMy>mDI>,r*Kp8D;?VQFcv4#MQT ITuYy>} ]DI>_:D,S"ErM[/# BPy>i/+qCwTDT\a_,r*|GIT9C>} MQT PQ-FcvDa {# Z;v>}5X 1995 M 1996 jDz[\n: SET CURRENT REFRESH AGE=ANY SELECT YEAR(pdate) AS year, SUM(ti.amount) AS amount FROM cube.transitem AS ti, cube.trans AS t, cube.loc AS loc, cube.pgroup AS pg, cube.prodline AS l WHERE ti.transid = t.id AND ti.pgid = pg.id AND pg.lineid = l.id AND t.locid = loc.id AND YEAR(pdate) IN (1995, 1996) GROUP BY year(pdate); Z~v>}5X 1995 M 1996 jz7iDz[\n: SET CURRENT REFRESH AGE=ANY SELECT pg.id AS "PRODUCT GROUP", SUM(ti.amount) AS amount FROM cube.transitem AS ti, cube.trans AS t, cube.loc AS loc, cube.pgroup AS pg, cube.prodline AS l WHERE ti.transid = t.id AND ti.pgid = pg.id AND pg.lineid = l.id AND t.locid = loc.id AND YEAR(pdate) IN (1995, 1996) GROUP BY pg.id; y>m=s,Zl&1dPDDxIT=s,r* MQT Dv$Hy>mDv$}C `#MQT IT(}Z9(M"B MQT 14P;NFc,"Tm`i/X49C MQT DZ]ITP'X{%i/.dDX~$w# 5w$_ SQL r XQuery `kwI6qPXCJ=8T02,r/, SQL M XQuery od7 3DE"#y6qDE"ozzKb%v SQL r XQuery odGgN4PD,Tcz ITw{odM}]b\mwdC4a_T\# r*BP-r,U/M9C5w}]: v Kb}]b\mwgNCJmMw}4zci/ v @@T\w{Yw |D}]b\mw"SQL r XQuery odT0}]bD3v=f1,&li5w} ]4KbYwgN|DKT\# Z 22 B i/CJ=8 291 6qDE"|(: v &mi/DYw3r v I>E" v =JM?v=JD!qT@F v TZ6q5w1 SQL r XQuery odP}CDyPTsD3FE" v 9Cwd?"N}jGr(CDfwD54XBE/ SQL r XQuery od# ZIT6q5wE".0,&4(E/w+5wE"f"ZdPDX5m,"hC7 (6qDV`MD5wE"D(CDfw# *T>5wE",IT9C|nP$_r Visual Explain#9CD$_7(zgNhC (CDfw,b)"amd?7(U/D)5w}]#}g,g{zZ{v9C Visual Explain,G4h*v6qlUE"#g{zk*9CdP;v|nP5CLrr9C (F SQL r XQuery odT5wm4Pj8Vv,G4&6qyP5wE"# 9C5wE"D;Y+;vw}CwCJ76D;?V#9C Visual Explain PD?<3FE",zI\"b=w}c}(NLEVELS P)VZss _Z1Ci/WNk}]bs(1Dw}c}#ZG,zIT!q4PBPdP;n Yw: v XiCw} v U/zDmMw}DB3FE" v 1XBs(zDi/1U/5wE" 4PdP;nYw.s,YNliCJ=8#g{YN9Cw},i/DT\I\; YG;vJb#g{T49Cw}rg{T\TG;vJb,G44PZ~Yw"l ia{#X4b)=h,1=bvJb*9# 292 w{}]bT\ T\w{$wD@@ ITI!8vYw4oza_i/T\,gw{dCN}"mS]wT0U/BD? <3FE"H# 1ZdPNN;vxrPxP|Ds,zI9C5w$_47(C|DTy!CJ= 8D0l(g{PD0)#}g,g{zy]w}1,+<7b?; vi/DT\a_D(;=(G9Cymq!PX5wlUE"Z]Dd{E"#KE"|(XZ}]Ts M}]Kc{DE"# 1`k SQL r XQuery od"Qks5w}]1,a6q5wlU}],gBy>: v 2,rv?s( SQL M XQuery od: 1Z BIND r PREP |nO8(K EXPLSNAP ALL r EXPLSNAP YES Sd1, r14Lr|,9C FOR SNAPSHOT r WITH SNAPSHOT SdD2, EXPLAIN od1,+6q5wlU# v /, SQL M XQuery od: ZBPNN;VivB6q5wlU: – "vxP FOR SNAPSHOT r WITH SNAPSHOT SdD EXPLAIN od#T Z FOR SNAPSHOT Sd,v6q5wlUE"#TZ WITH SNAPSHOT Sd, }lUE"b,26qyP5wE"# – + CURRENT EXPLAIN SNAPSHOT (CDfwhC*: - YES:i/`kw6qlU5w}]"4PC SQL r XQuery od# - EXPLAIN:i/`kw6qlU5w}],+;4PC SQL r XQuery od# – Z BIND r PREP |nO8( EXPLAIN ALL !n#i/`kwZKP16q lU5w}],49 CURRENT EXPLAIN SNAPSHOT (CDfwDhC* NO 2GgK#|9+4P SQL r XQuery od# Vv5wE"DGVvi/odDCJ76#Pm`=(C4Vv5w}],T ozzw{i/M73#X=J – GROUP BY Sd – ORDER BY Sd – WHERE XMLEXISTS Sd – !qPm 2I9C5w$_4@@GqI9Cm;vw}4zfVPDw},ry>;9C w}#14(Bw}s,9C RUNSTATS |n4U/Cw}D3FE""XB`k Ci/#-};N1d,zI\(}5w}]a"b=VZ}Z9Cm(h,x; Gw}(h#bI\Gm}]D/:"zDdyYw-r;,,E/wT<+ {vi/DJ4{Du!=nMLH,x;;G08v}]A;# }g,g{5wdvmwZCJ=8P9CKO"(h,SMErKc{,G4 Z+NNP5XA&CLr.0+Z;vY1mP5V{vp8/#ZbViv B,zIT"TZ SELECT odO9C OPTIMIZE FOR Sd4|DCJ=8# g{z8(K!n,E/wI"T!q;vCJ=8,C=8Z+0f8P5X A&CLr0,;ZY1mPzz{vp8/# v ,S=( g{;vi/,SK=vm,liyCD,SD`M#f0`vPD,S,gZv _'Vi/PDG),S,9C"P,SrO",S(#aKPC|l#;f0Y }PD,S,g OLTP i/,(#9C6WD-7,SaKPC|l#+G,ZNN ;VivBX=Jrw},IT|Db)d M,S$wD==# Z 22 B i/CJ=8 295 9CCJ=84ToO REFRESH TABLE M SET INTEGRITY odDT\Jb EXPLAIN for REFRESH TABLE M SET INTEGRITY odJmzzIIC4ToO b)odDT\JbDCJ=8#b+ozz|CX,$_e/i/m(MQT)# *q! REFRESH TABLE r SET INTEGRITY odDCJ=8,k9CBPN;V =(: v Z EXPLAIN odP9C EXPLAIN PLAN FOR REFRESH TABLE r EXPLAIN PLAN FOR SET INTEGRITY !n v Z"v REFRESH TABLE r SET INTEGRITY od0+ CURRENT EXPLAIN MODE (CDfwhC* EXPLAIN,"Z"vCods+ CURRENT EXPLAIN MODE (CDfwhC* NO# ^F: v REFRESH TABLE M SET INTEGRITY od;JOxPXBE/,rK, REOPT 5w==(r5wlU);JCZb=vod# v EXPLAIN odD WITH REOPT ONCE Sd28>+XBE/8(DI5 wod,|;JCZ REFRESH TABLE M SET INTEGRITY od# =8 K=85wgNS EXPLAIN M REFRESH TABLE odzICJ=8"9CC=84 ToOT\JbD-r# Z;= 4("ndm#}g, CREATE TABLE T (i1 INT NOT NULL, i2 INT NOT NULL, PRIMARY KEY (i1)); INSERT INTO T VALUES (1,1), (2,1), (3,2), (4,2); CREATE TABLE MQT AS (SELECT i2, COUNT(*) AS CNT FROM T GROUP BY i2) DATA INITIALLY DEFERRED REFRESH DEFERRED; Z~= "v EXPLAIN M REFRESH TABLE od,gBy>: EXPLAIN PLAN FOR REFRESH TABLE MQT; ":K=hIf;*Z SET CURRENT EXPLAIN MODE (CDfwPhC EXPLAIN ==,gBy>: SET CURRENT EXPLAIN MODE EXPLAIN; REFRESH TABLE MQT; SET CURRENT EXPLAIN MODE NO; Z}= 9C db2exfmt |n4q=/5wmDZ]"q!CJ=8#K$_;Z5} sqllib ? -o refresh.exp -1 ZD= VvCJ=8T7(T\JbD-r#}g,(}VvOfodPD=8,g { T GsMm,G4TCm4Pm(hYwDI>+G#_#4(w}ITa _i/DT\# 296 w{}]bT\ 5w$_ DB2 a)K;V+fD5w$_,C$_a)PXE/w* SQL r XQuery od!q DCJ=8Dj8E"#f"5w}]DmIZyP\'VD=(OxPCJ,|| ,2,M/, SQL M XQuery odDE"#8V$_r=(9zIinX6q"T> MVv5wE"# j8DE/wE"JmTCJ=8xPnkDVv,CE"f"Z5wmP,@"Z 5JDCJ=8>m#9CBPdP;vr`v=(,S5wmq!E": v 9C Visual Explain 4i45wlUE"# S“XFPD”wC Visual Explain 4i4i/CJ=8D#ITVv2, SQL M XQuery odT0/, SQL M XQuery od# Visual Explain Jmzi4Zm;v=(O6qrq!DlU#}g,WindowsM'z I+Z DB2 HP-UX f~qwOzIDlUfI$q=/dvPD5wE" v 9C db2expln M dynexpln $_# *i42, SQL r XQuery odD;vr`vLr|ICDCJ=8,S|nP9 C db2expln $_#db2expln T>y!CJ=8D5J5V#|;T>E/wE"# dynexpln $_ZT:Z?9C db2expln,C$_a);VlY=(45w;|,N} jGD/, SQL r XQuery od#(}+dk SQL r XQuery od*;*1Lr |PD2,od,IS dynexpln Z?9C db2expln#14PKYw1,CE"I\ ;Gdv GGG “lYM`D”2, SQL M XQuery Vv G 'VD2, SQL M XQuery GGGG 'VD/, SQL M XQuery GGGGG* 'VD CLI &CLr GGG ICZ DRDA® &CLrksw G Z 22 B i/CJ=8 297 m 65. 5wh)$_ (x) Z{DXw Visual Explain 5wm db2exfmt db2expln dynexpln j8DE/wE" GGG JOT`vodDVv GGGG IS&CLrZCJDE" G ": * dS9C db2expln;fZ;)V^T# T>Z5w1P'D?<3FE" 5w$_6qZ5wod1P'D3FE"#b)3FE"I\k53??<3FE"#Visual Explain T/ T>lUP|,DyP3FE"# SQL M XQuery 5w$_ db2expln $_hv* SQL M XQuery od!qDCJ=8#146q=5w}]1, |IC4q!y!CJ=8DlY5w#TZ2, SQL M XQuery od,db2expln l if"Z53?D#{{": v 4T db2expln DyPms{"# IZ dynexpln wC db2expln,yTi4 db2expln Ds`}ms{"GI\D# v k}]b,S1vm# g{Zk}]b,S1"zms,G4advK{"#2+T>;v CLI ms{", 8>C,S4\jID-r#|}msD-r,YNKP dynexpln# v Z dynexpln KP.0,Xk}%D~“”# g{KP dynexpln 1,x(DD~fZ,G4aT>K{"#}%CD~,r|D DYNEXPLN_PACKAGE 73d?D5,T|D+4(DD~{,;sYNKP dynexpln# v Z dynexpln KP.0,Xk>}Lr|“.”# g{ZKP dynexpln 1,x(DD~fZ,G4aT>K{"#>}CLr|,Y KP;r|D DYNEXPLN_PACKAGE 73d?D5,T|D+4(DLr|D{ F,;sYNKP dynexpln# v 4kD~“”1vm# g{;\4kx(DD~,G4aT>K{"#7# dynexpln ITZ10?”1vm# g{;\A!C -f !nxvDD~,G4aT>K{"#7#CD~fZ"R dynexpln ITA!CD~#;sYNKP dynexpln# 73d?:IT+=v;,D73d?k dynexpln ;p9C: v DYNEXPLN_OPTIONS G*od9(Lr|19CD SQL M XQuery$`kw! n#9Ck(} CLP "v PREP |n1+*CD`,Do(d?# }g:DYNEXPLN_OPTIONS="OPTLEVEL 5 BLOCKING ALL" v DYNEXPLN_PACKAGE GZ}]bP4(DLr|D{F#*hvDod;ZKL r|P#g{4(eKd?,G43hCLr|1!5 DYNEXPLN#(;9CK73 d?PC{FD0KvV{#) C{F2CZ4( dynexpln 9CDPdD~D{F# Z 22 B i/CJ=8 299 db2expln M dynexpln dvDhv ZCdvP,?vLr|D5wE"T>ZBP=v?V: v Lr|E",gs(UZM`XDs(!n v sz*5wD SQL r XQuery odDZE",}g,ZE#ZE"Bf,T>* SQL r XQuery od!qDCJ=8D5wdv# ;vCJ=8rZD=hT}]b\mw4P|GD3rT>#?vw*=hT>* ;vrsTkDjb,PXC=hDE"TuxN=T>ZCjbB#uxuvVZ CCJ=8D5wdvDs3_`P#b)u2jGYwDwCr#Z5X=uxD H06p.0,Z,;YwP&m|M6pDux(|6kR_)DYw# kG!,!qDCJ=8GyZdvPT>D-< SQL r XQuery odDv?f># }g,-DCJ=8I\kT-< SQL r XQuery odZ{DCJ=8j+;,#5 w$_(|(5wm"SET CURRENT EXPLAIN ==M Visual Explain)T>CZE /D5J SQL r XQuery od,dq=* SQL r XQuery gqDod,|G(}f r*;i/DZ?m>x4(D# 1+ db2expln r dynexpln Ddvk5w$_DdvHO1,Kc{j6!n (-opids)G#PC#?N db2expln r dynexpln *<&m5w$_PDBKc{1, Ma+CBKc{j6Er!Z5w=8Ds_#Kc{j6ITCZkwVq=D CJ=8PD=h%d#"b,Z5w$_dvPDKc{k db2expln M dynexpln T >DYw.d;a ZmCJod.B#I\Dod|(: v P} v iCJ v "P(h v (h18n v PCJ=( v x(br v =J v d{od P} TBod8>CmD?;PPyCDP}: #Columns = n iCJ TBod8>m_P;vr`vZdO(eD,iw}: Clustered by Dimension for Block Index Access g{4T>KD>,G449C DIMENSION Sd4(Cm# "P(h TBod8>}]b\mw+9C8vSzmLr4"PA!Cm: Parallel Scan g{4T>KD>,G4Cm;\I;vzmLr(rSzmLr)A!# (h=r TBod8>}]b\mw+49rA!P: Scan Direction = Reverse g{4T>KD>,G4(h=r*}r,bG1!5# Z 22 B i/CJ=8 301 PCJ=( +T>BPod.;,8>gNCJmPD^(P: v X5(hod8>43r(hCm,TiR^(P# – TBod8>+;4P}]D$!: Relation Scan | Prefetch: None – TBod8>E/wQ$H7(K+$!D3}: Relation Scan | Prefetch: n Pages – TBod8>&C$!}]: Relation Scan | Prefetch: Eligible – TBod8>}Z(}w}j6MCJ^(P: Index Scan: Name = schema.name ID = xx | Index type | Index Columns: dP: - schema.name G}Z(hDw}Dj<{F - ID G SYSCAT.INDEXES ?w}PD? ;P: n: column_name (Ascending) n: column_name (Descending) n: column_name (Include Column) a)TBod,T5ww}(hD`M: - (}TBnT>w}D6'(g=J: #Key Columns = n | Start Key: xxxxx | Stop Key: xxxxx dP xxxxx GBPdP;n: v w}*< v w}ax v |(D5:rE}D5: +aZCw}(hP|(Z,D|5#;aZ(hP|(E}D|5#BP dP;P+T|D?;?VxvC|D5: n: ’string’ n: nnn n: yyyy-mm-dd 302 w{}]bT\ n: hh:mm:ss n: yyyy-mm-dd hh:mm:ss.uuuuuu n: NULL n: ? g{vVDV.,G4vT>0f 20 vV{#g{CDV.$HsZ 20 v V{,G4ZCDV.DnsT> ...#;)|;PZ4PC?V.sE\7 (#rKaT> ? w*d5# - ?w}CJ g{ITSw}|qCyPh*DP,+vVKod,R;aCJNNm} ]# - TBod8>+;4Pw}3D$!: Index Prefetch: None - TBod8>&C$!w}3: Index Prefetch: Eligible - TBod8>+;4P}]3D$!: Data Prefetch: None - TBod8>&C$!}]3: Data Prefetch: Eligible - g{fZIT+MA“w}\mw”Toz^(w}u?D=J,G4TBod CZT>=J}: Sargable Index Predicate(s) | #Predicates = n – g{}Z(}9CZCJ=8PH0<8DPj6(RID)4CJ^(P,+C BPod8>|: Fetch Direct Using Row IDs g{m_P*|(eD;vr`viw},G4irPj6: Fetch Direct Using Block or Row IOs x(br TZ?vmCJ,+ZmMP6pq!Dx(`M: Lock Intents | Table: xxxx | Row : xxxx mx(DI\5P: v %b v br%b v ^NNbr v br2m v 2m v 2mbr%b v ,%b Z 22 B i/CJ=8 303 v |B Px(DI\D5P: v %b v B;|%b(;Z db2expln dvPT>) v ^ v 2m v B;|2m v |B v B;|u%b v u%b =J P=vod,|Ga)PXZCJ=8P9CD=JDE": 1. TBod8>+TSViw}PlwD?v}]isvD=J}# Block Predicates(s) | #Predicates = n 2. TBod8>1}ZCJ}]1+svD=J}#=JDF};|(BFYw,} g,[/rEr# Sargable Predicate(s) | #Predicates = n 3. TBod8>;)5X}],+svD=J}: Residual Predicate(s) | #Predicates = n ZOvodPT>D=J}2m4\43Zi/odPa)D=J},r*=JI T: v Z,;vi/P&C`N v Zi/E/}LP,(}mS~==J4d;M)9 v Zi/E/}LP,;d;M9uI|YD=J# d{mod v TBod8>+;CJ;P: Single Record v 1KmCJy9CDtk6pkCodyCD;,1,MavVTBod: Isolation Level: xxxx IZm`-r,I\9C;,Dtk6p,|(: – ;vLr|GC“IX4A!”s(D,b0lK}Cj{T}D mCJa;}6*“NjH(T”# v gBod8>g{Pc;DErQZfIC,SY1mA!D?Vr+?P+_Y :f=:eXb: 304 w{}]bT\ Keep Rows In Private Memory v g{Cm_PWdDy}tT/,G4a(}TBE"8v: Volatile Cardinality Y1mE": CJ=8Z2,rY1$wmP4PYwZd,|9CY1m4f"} ]#v14PCJ=81,KmEfZ#(#,1ZCJ=8Ph*a0TSi/s 51,r1Pda{;JOICZf1,a9CY1m# g{h*4(Y1m,G4avV=vI\DodPD;v#b)od8>+4(; vY1m,"+PekdP#Cj6G}CY1m1*=cp{xI db2expln 8(D j6#Kj6TV8“t”*0:,T8>CmGY1m# v TBod8>+4(;vU(DY1m: Insert Into Temp Table ID = tn v TBod8>`vSzmLr+"P4(;vU(DY1m: Insert Into Shared Temp Table ID = tn v TBod8>+4(;vQErDY1m: Insert Into Sorted Temp Table ID = tn v TBod8>`vSzmLr+"P4(;vQErDY1m: Insert Into Sorted Shared Temp Table ID = tn v TBod8>+4(;vQyw+VY1m: Insert Into Global Temp Table ID = ts,tn v TBod8>`vSzmLr+"P4(;vQyw+VY1m: Insert Into Shared Global Temp Table ID = ts,tn v TBod8>+4(;vQErQyw+VY1m: Insert Into Sorted Global Temp Table ID = ts,tn v TBod8>`vSzmLr+"P4(;vQErQyw+VY1m: Insert Into Sorted Shared Global Temp Table ID = ts,tn Ov?vod<+szBPZ]: #Columns = n |8>*ekY1mPD?;PP`YP# QErDY1m QErDY1mITI`FgBDYwzz: v ORDER BY v DISTINCT v GROUP BY v Merge Join v ’= ANY’ subquery v ’<> ALL’ subquery v INTERSECT r EXCEPT v UNION(;x ALL X|V) Z 22 B i/CJ=8 305 ZQErDY1mD-<4(ods,Izm`=Sod: v TBod8>ZErP9CD|P}: #Sort Key Columns = n TZEr|PD?;P,+aT>BPdP;P: Key n: column_name (Ascending) Key n: column_name (Descending) Key n: (Ascending) Key n: (Descending) v TBoda)TP}MPs!D@F,TcZKP1ITVdnEDErQ# Sortheap Allocation Parameters: | #Rows = n | Row Width = n v g{;h*Era{D08P,G4aT>BPZ]: Sort Limited To Estimated Row Count v TZZ“TF`&mw”(SMP)73PDEr,*4PDErD`MIBPod. ;8>: Use Partitioned Sort Use Shared Sort Use Replicated Sort Use Round-Robin Sort v TBod8>ErzzDa{GqtZErQP: Piped x Not Piped g{8>\@Er,G4}]b\mwa+ErDdv#tZZfP,x;G+E ra{CZm;vY1mP# v TBod8>ZErZd+}%X4D5: Duplicate Elimination v g{}ZErP4P[/,G4BPdP;voda8>|: Partial Aggregation Intermediate Aggregation Buffered Partial Aggregation Buffered Intermediate Aggregation Y1mjI Z|,CZ4(Y1mDBFYwDmCJ.s(4,4(Y1mYwGZmCJ6 'Z"zD),P;v“jI”od,|(}CY1m<8rsxDY1mCJa) P,4&mD~a2#+T>BPdP;P: Temp Table Completion ID = tn Shared Temp Table Completion ID = tn Sorted Temp Table Completion ID = tn Sorted Shared Temp Table Completion ID = tn m/} m/}GC'(eD/}(UDF),|+}]TmDN=5XAod#m/}ITB od8>: 306 w{}]bT\ Access User Defined Table Function | Name = schema.funcname | Specific Name = specificname | SQL Access Level = accesslevel | Language = lang | Parameter Style = parmstyle | Fenced Not Deterministic | Called on NULL Input Disallow Parallel | Not Federated Not Threadsafe X({F(;j6wCDm/}#d`Pj8hv/}DtT# ,SE": P}V`MD,S: v "P,S v O",S v 6W-7,S# 1Z;ZP4P=*4P,S1,aT>BPdP;vod: Hash Join Merge Join Nested Loop Join 4Psb,SGI\D#sb,SIBPdP;vod8>: Left Outer Hash Join Left Outer Merge Join Left Outer Nested Loop Join TZO"M6W-7,S,,SDb?m+GZdvPT>DH0CJody}CD m#,SDZ?m+GZ,Sod6'Z|,DCJody}CDm#TZ"P, S,+CJod4r,+b?m|,Z,S6'.Z,xZ?mvVZ,S.0# TZ"PrO",S,I\vVBP=Sod: v Z3)73P,,S;h*7(Z?mPDNNPGqkb?mPD10P%d# |G(}BPod48>D: Early Out: Single Match Per Outer Row v Z,SjI.s,&C=JGI\D#+8>&CD=J},gBy>: Residual Predicate(s) | #Predicates = n TZ"P,S,I\vVBP=Sod: v Qy]Z?m9(K"Pm#g{ZxPZ?mCJ1+"PmD9(9k;v= JP,G4ZCJZ?m1CTBod8>C9(: Process Hash Table For Join v 1CJb?m1,IT9(;v=bm4a_,SDT\#ZCJb?m1CTB od8>=bmD9(: Process Probe Table For Hash Join v 9("PmyhD@FVZ}ITBnm>: Estimated Build Size: n v 9(=bmyhD@FVZ}ITBnm>: Estimated Probe Size: n Z 22 B i/CJ=8 307 TZ6W-7,S,tSZ,Sod.sI\avVTB=Sod: Piped Inner Kod8>,SDZ?mGm;5PDYwDa{#b2F*iOZ,S# g{;v,Sf0=vTODm,G4&S7=2A!5w=h#}g,Yh5wd v_PBP}]w: Access ..... W Join | Access ..... X Join | Access ..... Y Join | Access ..... Z 4PD=h+G: 1. a! W POqDP# 2. + W PDPk X PD(B;)P,S,"wCa{ P1(m>`E 1 D?V,S a{)# 3. + P1 k Y PD(B;)P,S,T4( P2# 4. + P2 k Z PD(B;)P,S,Tq!;vj{Da{P# 5. g{ Z PfZd{P,G4*A=h 4# 6. g{ Y PfZd{P,G4*A=h 3# 7. g{ X PfZd{P,G4*A=h 2# 8. g{ W PfZd{P,G4*A=h 1# }]wE": Z;vCJ=8Z,-#h*XF}]D4(T0}]S;5PYw= m;5PYwDw/#}]wDEnJm+;vCJ=8ZD;iYw1w;v%* 4XF#}]wD*: Data Stream n dP,n GI db2expln *=c}Cx8(D(;j6#}]wDaxITBod8>: End of Data Stream n b)od.dDyPYw;O*G,;v}]wD;?V# ;v}]wPm`Xw,Zu<}]wod.sIz;vr`vod,4hvb)X w: v g{}]wDYw@5ZCJ=8PgHzID5,G4}]wjG*: Correlated v `FZQErDY1m,BPod8>}]wDa{Gq+#tZZfP: Piped x Not Piped ,Y1mDiv;y,g{4P1;Pc;DZf,G4I\+\@}]w4kE L#CCJ=8+a)b=VI\T# v TBod8>K}]w;h*%vG<: Single Record 308 w{}]bT\ 1CJ;v}]w1,+advTBod: Access Data Stream n ek"|BM>}E": b) SQL odD5wD>GTR5wD#b) SQL Yw DodD>I\*: Insert: Table Name = schema.name ID = ts,n Update: Table Name = schema.name ID = ts,n Delete: Table Name = schema.name ID = ts,n Insert: Hierarchy Table Name = schema.name ID = ts,n Update: Hierarchy Table Name = schema.name ID = ts,n Delete: Hierarchy Table Name = schema.name ID = ts,n Insert: Materialized Query Table = schema.name ID = ts,n Update: Materialized Query Table = schema.name ID = ts,n Delete: Materialized Query Table = schema.name ID = ts,n Insert: Global Temporary Table ID = ts, tn Update: Global Temporary Table ID = ts, tn Delete: Global Temporary Table ID = ts, tn iMPj6<8E": TZ3)CJ=8,g{T^(PMij6(j6)Er"} %KX4Dj6(g{Gw} OR Kc),r_Z4P5JDmCJ.0,9C;V< u4j6ZyP}ZCJDw}PvVDj6(g{Gw} AND Kc),G4a|P '#}g5wody8>,j6<8PBP}Vw*C>: v TBod8>“w} OR Kc”CZ<8^(j6DPm: Index ORing Preparation Block Index ORing Preparation w} OR KcG8("`vw}CJ,"iOa{T|(ZCJDNNw}PvVD ;,j6D;VG<8ZPm$!Zd*9CDdk}],gBPN;ny 8>: List Prefetch Preparation Block List Prefetch RID Preparation v w} AND KcG8("`vw}CJ,"iOa{T|(ZCJDyPw}PvV Dj6D;VC@F5: Optimizer Estimate of Set Size: n w} AND Kc}KwYw&mj6,"9C;}Kw}Z*w} AND Kc&mj6: Index ANDing Bitmap Build Using Row IDs Index ANDing Bitmap Probe Using Row IDs Index ANDing Bitmap Build and Probe Using Row IDs Block Index ANDing Bitmap Build Using Block IDs Block Index ANDing Bitmap Build and Probe Using Block IDs Block Index ANDing Bitmap Build and Probe Using Row IDs Block Index ANDing Bitmap Probe Using Block IDs and Build Using Row IDs Block Index ANDing Bitmap Probe Using Block IDs Block Index ANDing Bitmap Probe Using Row IDs g{E/wQ@FK;v;C@F5: Z 22 B i/CJ=8 309 Optimizer Estimate of Set Size: n TZNN`MDj6<8,g{IT4PPm$!,G4+CTBod8>|: Prefetch: Enabled [/E": Tzc8(jZ5JCJ}]1,+[/Yw9k*;v=J4&m# ZOvNN;V[/od.B+G*4PD[//}D`M8>: Group By Column Function(s) Single Record ISuBPdP;P: Aggregation Completion Partial Aggregation Completion Intermediate Aggregation Completion Final Aggregation Completion "P&mE": "P4P SQL od(9CVxZrVxd"PT)h*;)XbD Yw#TBhvCZ"P=8DYw# v 1KPVxZ"P=81,+9C8vSzmLr,14PC=8Dwv?V#b )SzmLrD4(IBPod8>: Process Using n Subagents v 1KPVxd"P=81,CZ;V*8v!Z#?v!Z;"MA;vr`vZ c,TcKP#;vX*D!ZG-wLr!Z#-wLr!ZG?v=8PDZ ;v!Z#|WHqCXF(,":pV"d{!Z,;s+a{5XAwC&C Lr# !ZDV"ITBod8>: Distribute Subsection #n ICKV==DdP;V47(SU!ZDZc: – TB>}8>+y]P5Q!Z"MA}]bVxiZD;vZc# Directed by Hash | #Columns = n | Partition Map ID = n, Nodegroup = ngname, #Nodes = n – TB>}8>+Q!Z"MA;v$(DZc#(1Cod9C NODENUMBER() /}1,a##4=bViv#) 310 w{}]bT\ Directed by Node Number – TB>}8>+Q!Z"MAkx(}]bVxiP$(}]bVxET&DZ c#(1Cod9C PARTITION() /}1,a##4=bViv#) Directed by Partition Number | Partition Map ID = n, Nodegroup = ngname, #Nodes = n – TB>}8>+Q!Z"MA*&CLrDNja)10PDZc# Directed by Position – TB>}8>;P`kCod17(D;vZcaSUC!Z# Directed to Single Node | Node Number = n – TB>}.;8>+Z-wLrZcO4P!Z# Directed to Application Coordinator Node Directed to Local Coordinator Node – TB>}8>+Q!Z"M=QP>DyPZc# Broadcast to Node List | Nodes = n1, n2, n3, ... – TB>}8>;P4PCod17(D;vZcaSUC!Z# Directed to Any Node v mSPCZZ;vVx}]b73PD!Z.dr;vTF`&mw(SMP)73 PDSzmLr.dF/}]#TmSPDhv*gBy>: – TBod8>}Z+}]ek;vmSP: Insert Into Synchronous Table Queue ID = qn Insert Into Asynchronous Table Queue ID = qn Insert Into Synchronous Local Table Queue ID = qn Insert Into Asynchronous Local Table Queue ID = qn – TZ}]bVxmSP,ekmSPPDPD?DXIBP;vodhv: +yPP"MA-wLrZc: Broadcast to Coordinator Node +yPDP"MAx(!ZKPyZD?v}]bVx: Broadcast to All Nodes of Subsection n y]PPD5,+?;P"MA;v}]bVx: Hash to Specific Node +?;P"MA4PCod1y7(D}]bVx: Send to Specific Node +?;P"M=fz7(DZc: Send to Random Node – Z3)ivP,;v}]bVxmSP;C;Y1+3)PgvAY1m#bV I\TIBPodj6: Rows Can Overflow to Temporary Table – Z|,+Pek;vmSPDBFYwDmCJ.s,+P;v“jI”od,| &m4\"4"MDP#T>BPdP;P: Z 22 B i/CJ=8 311 Insert Into Synchronous Table Queue Completion ID = qn Insert Into Asynchronous Table Queue Completion ID = qn Insert Into Synchronous Local Table Queue Completion ID = qn Insert Into Asynchronous Local Table Queue Completion ID = qn – TBod8>}ZS;vmSPPlw}]: Access Table Queue ID = qn Access Local Table Queue ID = qn b){".s# #Columns = n – g{mSPZSUKTPEr,G4mSPCJ2+aPBP;u{": Output Sorted Output Sorted and Unique b){".sGPXCZErYwD|}D8># #Key Columns = n TZEr|PD?;P,T>BPdP;n: Key n: (Ascending) Key n: (Descending) – g{(}mSPDSUK+=J&CZP,G4aT>BP{": Residual Predicate(s) | #Predicates = n v ;vVx}]b73PD3)!Zw7X-7XAC!ZD*<&,bITBod 8>: Jump Back to Start of Subsection *Oi/E": Z*O}]bP4P SQL odh*PTd{}]44P?VodD \&# TBod8>+*A!}]4: Ship Distributed Subquery #n | #Columns = n PI\TV<=Si/5XD}]&C=J#+8>&CD=J},gBy>: Residual Predicate(s) | #Predicates = n "zZ}]4Dek"|Br>}Yw+IJ1D{"8>: Ship Distributed Insert #n Ship Distributed Update #n Ship Distributed Delete #n g{Z}]4T=x(Km,+CTBod8>|: Ship Distributed Lock Table #n kT}]4D DDL odVnI=?V#Z}]4OwCD?VITB8>: Ship Distributed DDL Statement #n g{*O~qwGVx}]b,G4 DDL odD?VXkZ?: Distributed DDL Statement #n Completion 312 w{}]bT\ %@a)?vV<=SodDj8E"#TBhvKCZV<=odD!n: v Si/D}]4(}BPdP;nT>: Server: server_name (type, version) Server: server_name (type) Server: server_name v g{}]4GX5=D,G4SodD SQL T>*: SQL Statement: statement GX5}]4CBPn8>: Non-Relational Data Source v SodP}CDGFP>gB: Nicknames Referenced: schema.nickname ID = n g{}]4GX5=D,GFDy>mT>*: Base = baseschema.basetable g{}]4GGX5}]4,G4GFD4D~T>*: Source File = filename v Z4PSod.0,g{+5S*O~qw+MA}]4,G45D}?+IBf b;nT>: #Input Columns: n v Z4PSod.s,g{+5S}]4+MA*O~qw,G45D}?+IBf b;nT>: #Output Columns: n d{5wE": v }](eoTodDZ+ZdvPCBPod8>: DDL Statement ;T DDL oda)d{5wdv# v CZI|BD(CDfwD SET od(g CURRENT EXPLAIN SNAPSHOT)D Z+ZdvPCTBod8>: SET Statement ;T SET oda)d{5wdv# v g{ SQL od|, DISTINCT Sd,G4dvPI\vVBPD>: Distinct Filter #Columns = n dP,n GNkq!;,PDP}#*lw;,PD5,XkTPEr,TcITx }X4DP#g{}]b\mw;Xw7{%X4P,gBPiv,G4;T>K od: – fZ(;Dw},Rw}|PDyPPm9l/}dkB;P1,+vVTBod: Access Table Constructor v g{fZ;ZX(ivBE&mDYw,+vVBPod: Conditional Evaluation | Condition #n: | #Predicates = n | Action #n: u~P(CZ5Vq SQL CASE odbyDn/,rq}Cj{TNNYw,G41Cu~*f1,;&m}]&mY w# v g{ZCCJ=8P}Z&m ALL"ANY r EXISTS Si/,G4+T>BPdP ;vod: – ANY/ALL Si/ – EXISTS Si/ – EXISTS SINGLE Si/ v ZX(D UPDATE M DELETE Yw.0,h*("mZX(PD;C#bIBP od8>: Establish Row Position v TZ`,/:mO{O*vE/D>}+vVTBE": CELL DELETE with deferred cleanup r_ CELL DELETE with immediate cleanup v g{P*5XAC&CLrDP,+aT>TBod: Return Data to Application | #Columns = n g{CYw;BFAmCJP,|+h*;vjIWN#KWN*gBy>: Return Data Completion v g{}ZwCf"}L,G4+vVBPE": 314 w{}]bT\ Call Stored Procedure | Name = schema.funcname | Specific Name = specificname | SQL Access Level = accesslevel | Language = lang | Parameter Style = parmstyle | Expected Result Sets = n | Fenced Not Deterministic | Called on NULL Input Disallow Parallel | Not Federated Not Threadsafe v g{}ZME;vr`v LOB (;w,G4+vVBPE": Free LOB Locators db2expln M dynexpln dvD>} TBT>D>}ITozzKb db2expln M dynexpln DdvD }GT DB2 Pa)D SAMPLE }]bKPD(}GT>;,)#?v>}}.dDw*xpCVeT># >};:^"PT: >>};ks;vPm,||,yP01DU{"0q"?E{ FM;C,T0{GySBDn?D{F#KCJ=8D5JG9C"P,S+?v 8(DmPD`X}],SZ;p#r*;Pw}IC,JCJ=8Z,S?vm1 T|GxPX5(h# ******************** PACKAGE *************************************** Package Name = "DOOLE"."EXAMPLE" Version = "" Prep Date = 2002/01/04 Prep Time = 14:05:00 Bind Timestamp = 2002-01-04-14.05.00.415403 Isolation Level = Cursor Stability Blocking = Block Unambiguous Cursors Query Optimization Class = 5 Partition Parallel = No Intra-Partition Parallel = No SQL Path = "SYSIBM", "SYSFUN", "SYSPROC", "DOOLE" -------------------- SECTION --------------------------------------- Section = 1 SQL Statement: DECLARE EMPCUR CURSOR FOR SELECT e.lastname, e.job, d.deptname, d.location, p.projname FROM employee AS e, department AS d, project AS p WHERE e.workdept = d.deptno AND e.workdept = p.deptno Estimated Cost = 120.518692 Estimated Cardinality = 221.535980 ( 6) Access Table Name = DOOLE.EMPLOYEE ID = 2,5 | #Columns = 3 | Relation Scan | | Prefetch: Eligible | Lock Intents | | Table: Intent Share | | Row : Next Key Share ( 6) | Process Build Table for Hash Join Z 22 B i/CJ=8 315 ( 2) Hash Join | Estimated Build Size: 7111 | Estimated Probe Size: 9457 ( 5) | Access Table Name = DOOLE.PROJECT ID = 2,7 | | #Columns = 2 | | Relation Scan | | | Prefetch: Eligible | | Lock Intents | | | Table: Intent Share | | | Row : Next Key Share ( 5) | | Process Build Table for Hash Join ( 3) | Hash Join | | Estimated Build Size: 5737 | | Estimated Probe Size: 6421 ( 4) | | Access Table Name = DOOLE.DEPARTMENT ID = 2,4 | | | #Columns = 3 | | | Relation Scan ||||Prefetch: Eligible | | | Lock Intents ||||Table: Intent Share ||||Row:Next Key Share ( 4) | | | Process Probe Table for Hash Join ( 1) Return Data to Application | #Columns = 5 End of section Optimizer Plan: RETURN (1) | HSJOIN (2) /\ HSJOIN TBSCAN (3) (6) /\ | TBSCAN TBSCAN Table: ( 4) ( 5) DOOLE | | EMPLOYEE Table: Table: DOOLE DOOLE DEPARTMENT PROJECT C=8DZ;?VCJ DEPARTMENT M PROJECT m,"C"P,S4,Sb)m# K,SDa{;,S= EMPLOYEE m#a{P5XA&CLr# >}~:_PVxZ"PTD%;Vx=8: >>}T>kZ;v>}`,D SQL o d,+GKi/G*;v 4 7 SMP zw`kD# ******************** PACKAGE *************************************** Package Name = "DOOLE"."EXAMPLE" Version = "" Prep Date = 2002/01/04 Prep Time = 14:12:38 Bind Timestamp = 2002-01-04-14.12.38.732627 Isolation Level = Cursor Stability Blocking = Block Unambiguous Cursors Query Optimization Class = 5 Partition Parallel = No Intra-Partition Parallel = Yes (Bind Degree = 4) 316 w{}]bT\ SQL Path = "SYSIBM", "SYSFUN", "SYSPROC", "DOOLE" -------------------- SECTION --------------------------------------- Section = 1 SQL Statement: DECLARE EMPCUR CURSOR FOR SELECT e.lastname, e.job, d.deptname, d.location, p.projname FROM employee AS e, department AS d, project AS p WHERE e.workdept = d.deptno AND e.workdept = p.deptno Intra-Partition Parallelism Degree = 4 Estimated Cost = 133.934692 Estimated Cardinality = 221.535980 ( 2) Process Using 4 Subagents ( 7) | Access Table Name = DOOLE.EMPLOYEE ID = 2,5 | | #Columns = 3 | | Parallel Scan | | Relation Scan | | | Prefetch: Eligible | | Lock Intents | | | Table: Intent Share | | | Row : Next Key Share ( 7) | | Process Build Table for Hash Join ( 3) | Hash Join | | Estimated Build Size: 7111 | | Estimated Probe Size: 9457 ( 6) | | Access Table Name = DOOLE.PROJECT ID = 2,7 | | | #Columns = 2 | | | Parallel Scan | | | Relation Scan ||||Prefetch: Eligible | | | Lock Intents ||||Table: Intent Share ||||Row:Next Key Share ( 6) | | | Process Build Table for Hash Join ( 4) | | Hash Join | | | Estimated Build Size: 5737 | | | Estimated Probe Size: 6421 ( 5) | | | Access Table Name = DOOLE.DEPARTMENT ID = 2,4 ||||#Columns = 3 ||||Parallel Scan ||||Relation Scan |||||Prefetch: Eligible ||||Lock Intents |||||Table: Intent Share |||||Row:Next Key Share ( 5)||||Process Probe Table for Hash Join ( 2) | Insert Into Asynchronous Local Table Queue ID = q1 ( 2) Access Local Table Queue ID = q1 #Columns = 5 ( 1) Return Data to Application | #Columns = 5 End of section Optimizer Plan: RETURN (1) | LTQ Z 22 B i/CJ=8 317 (2) | HSJOIN (3) /\ HSJOIN TBSCAN (4) (7) /\ | TBSCAN TBSCAN Table: ( 5) ( 6) DOOLE | | EMPLOYEE Table: Table: DOOLE DOOLE DEPARTMENT PROJECT K=88ukZ;v>}PD=8j+;y#w*xpG1C=8Z;Nt/1*4 (DvSzmLr,xZC=8ax1mSP*U/?vSzmLrD$wa{,; s+b)a{5XA&CLr# >}}:_PVxd"PTD`Vx=8: >>}T>kZ;v>}`,D SQL o d,+Ki/QZI}v}]bVxiIDVx}]bOxPK`k# ******************** PACKAGE *************************************** Package Name = "DOOLE"."EXAMPLE" Version = "" Prep Date = 2002/01/04 Prep Time = 14:54:57 Bind Timestamp = 2002-01-04-14.54.57.033666 Isolation Level = Cursor Stability Blocking = Block Unambiguous Cursors Query Optimization Class = 5 Partition Parallel = Yes Intra-Partition Parallel = No SQL Path = "SYSIBM", "SYSFUN", "SYSPROC", "DOOLE" -------------------- SECTION --------------------------------------- Section = 1 SQL Statement: DECLARE EMPCUR CURSOR FOR SELECT e.lastname, e.job, d.deptname, d.location, p.projname FROM employee AS e, department AS d, project AS p WHERE e.workdept = d.deptno AND e.workdept = p.deptno Estimated Cost = 118.483406 Estimated Cardinality = 474.720032 Coordinator Subsection:(-----) Distribute Subsection #2 | Broadcast to Node List | | Nodes = 10, 33, 55 (-----) Distribute Subsection #3 | Broadcast to Node List | | Nodes = 10, 33, 55 (-----) Distribute Subsection #1 | Broadcast to Node List | | Nodes = 10, 33, 55 ( 2) Access Table Queue ID = q1 #Columns = 5 ( 1) Return Data to Application | #Columns = 5 318 w{}]bT\ Subsection #1:( 8) Access Table Queue ID = q2 #Columns = 2 ( 3) Hash Join | Estimated Build Size: 5737 | Estimated Probe Size: 8015 ( 6) | Access Table Queue ID = q3 #Columns = 3 ( 4) | Hash Join | | Estimated Build Size: 5333 | | Estimated Probe Size: 6421 ( 5) | | Access Table Name = DOOLE.DEPARTMENT ID = 2,4 | | | #Columns = 3 | | | Relation Scan ||||Prefetch: Eligible | | | Lock Intents ||||Table: Intent Share ||||Row:Next Key Share ( 5) | | | Process Probe Table for Hash Join ( 2) Insert Into Asynchronous Table Queue ID = q1 | Broadcast to Coordinator Node | Rows Can Overflow to Temporary Table Subsection #2: ( 9) Access Table Name = DOOLE.PROJECT ID = 2,7 | #Columns = 2 | Relation Scan | | Prefetch: Eligible | Lock Intents | | Table: Intent Share | | Row : Next Key Share ( 9) | Insert Into Asynchronous Table Queue ID = q2 | | Hash to Specific Node | | Rows Can Overflow to Temporary Tables ( 8) Insert Into Asynchronous Table Queue Completion ID = q2 Subsection #3: ( 7) Access Table Name = DOOLE.EMPLOYEE ID = 2,5 | #Columns = 3 | Relation Scan | | Prefetch: Eligible | Lock Intents | | Table: Intent Share | | Row : Next Key Share ( 7) | Insert Into Asynchronous Table Queue ID = q3 | | Hash to Specific Node | | Rows Can Overflow to Temporary Tables ( 6) Insert Into Asynchronous Table Queue Completion ID = q3 End of section Optimizer Plan: RETURN (1) | BTQ ( 2) | HSJOIN (3) /\ HSJOIN DTQ (4) (8) /\ | TBSCAN DTQ TBSCAN (5) (6)(9) ||| Table: TBSCAN Table: Z 22 B i/CJ=8 319 DOOLE ( 7) DOOLE DEPARTMENT | PROJECT Table: DOOLE EMPLOYEE K=8kZ;v>}PD=8Pj+`,D8Z,+GCZVIDv!Z#b)!Z _PBPNq: v -wLr!Z#K!Z-wd{!Z#ZK=8P,|}D:_PVxd"PTMVxZ"PTD`Vx=8: >>}T>kZ;v>} `,D SQL od,+Ki/QZI}v}]bVxiIDVx}]bOxPK`k, b)}]bVxD?;v}PD=8`F,;,DG`vSzmLr4P?v!Z#mb, Z?v!Zax1,Z+OqPek*"P=X(ZcDZ~vmSP.0,>Xm SP+U/yPSzmLrDa{# >}e:*O}]b=8: >>}T>kZ;v>}`,D SQL od,+QZ;v *O}]bO`kKi/,Zbv*O}]bP,m DEPARTMENT M PROJECT Z }]4O,xm EMPLOYEE Z*O~qwO# ******************** PACKAGE *************************************** Package Name = "DOOLE"."EXAMPLE" Version = "" Prep Date = 2002/01/11 Prep Time = 13:52:48 Bind Timestamp = 2002-01-11-13.52.48.325413 Isolation Level = Cursor Stability Blocking = Block Unambiguous Cursors Query Optimization Class = 5 Partition Parallel = No Intra-Partition Parallel = No SQL Path = "SYSIBM", "SYSFUN", "SYSPROC", "DOOLE" -------------------- SECTION --------------------------------------- Section = 1 SQL Statement: DECLARE EMPCUR CURSOR FOR SELECT e.lastname, e.job, d.deptname, d.location, p.projname FROM employee AS e, department AS d, project AS p WHERE e.workdept = d.deptno AND e.workdept = p.deptno Estimated Cost = 1804.625000 322 w{}]bT\ Estimated Cardinality = 112000.000000 ( 7) Ship Distributed Subquery #2 | #Columns = 2 ( 2) Hash Join | Estimated Build Size: 48444 | Estimated Probe Size: 232571 ( 6) | Access Table Name = DOOLE.EMPLOYEE ID = 2,5 | | #Columns = 3 | | Relation Scan | | | Prefetch: Eligible | | Lock Intents | | | Table: Intent Share | | | Row : Next Key Share ( 6) | | Process Build Table for Hash Join ( 3) | Hash Join | | Estimated Build Size: 7111 | | Estimated Probe Size: 64606 ( 4) | | Ship Distributed Subquery #1 | | | #Columns = 3 ( 1) Return Data to Application | #Columns = 5 Distributed Substatement #1: ( 4) Server: REMOTE (DB2/UDB 8.1) SQL Statement: SELECT A0."DEPTNO", A0."DEPTNAME", A0."LOCATION" FROM "DOOLE"."DEPARTMENT" A0 Nicknames Referenced: DOOLE.DEPARTMENT ID = 32768 Base = DOOLE.DEPARTMENT #Output Columns = 3 Distributed Substatement #2: ( 7) Server: REMOTE (DB2/UDB 8.1) SQL Statement: SELECT A0."DEPTNO", A0."PROJNAME" FROM "DOOLE"."PROJECT" A0 Nicknames Referenced: DOOLE.PROJECT ID = 32769 Base = DOOLE.PROJECT #Output Columns = 2 End of section Optimizer Plan: RETURN (1) | HSJOIN (2) /\ HSJOIN SHIP (3) (7) /\ | SHIP TBSCAN Nickname: (4) (6)DOOLE ||PROJECT Nickname: Table: DOOLE DOOLE DEPARTMENT EMPLOYEE K=8kZ;v>}PD=8Pj+`,Di,+P=vmD}]4T}]4#b= vmG(}V<=Si/CJD,Z>8}P,b)V<=Si/;GSG)mP! qyPP#Z+}]5XA*O~qw.s,|ck4T>XmD}],S=;p# Z 22 B i/CJ=8 323 >} 6:XANDOR M XISCAN Kc{: K>}T>K XANDOR Kc{gN+T ,;vm XISCANTABLE (eD=v@"yZ XML }]Dw}(IDX1 M IDX2)D XISCAN (hO"Z;p# IBM DB2 Database SQL Explain Tool ******************** DYNAMIC *************************************** ==================== STATEMENT ========================================== Isolation Level = Cursor Stability Blocking = Block Unambiguous Cursors Query Optimization Class = 5 Partition Parallel = No Intra-Partition Parallel = No SQL Path = "SYSIBM", "SYSFUN", "SYSPROC", "ATTALURI" Query Statement: xquery for $c in db2-fn:xmlcolumn("XISCANTABLE.XMLCOL ")/a[@x="1" ]/b[@y= "2" ] return $c Section Code Page = 819 Estimated Cost = 192.266113 Estimated Cardinality = 1.800000 ( 6) Index ANDing and ORing over XML | Xpath is | | /child::element(a)[./child::element(b) | | /attribute::attribute(y)(:Index Search over XML 1:) | | and ./attribute::attribute(x)(:Index Search over XML 2:) ||] | Index Search over XML 1 | | Access Table Name = ATTALURI.XISCANTABLE | | | Index Scan over XML: Name = ATTALURI.IDX1 ID = 6 ||||Physical Index over XML ||||Index Columns: |||||1:XMLCOL (Ascending) | | | #Key Columns = 4 ||||Start Key: Inclusive Value ||||||1:? ||||||2:? ||||||3:? ||||||4:? ||||Stop Key: Inclusive Value ||||||1:? ||||||2:? | | | Index-Only Access | | | Index Prefetch: None | | | Isolation Level: Uncommitted Read | | | Lock Intents ||||Table: Intent None ||||Row:None | | | StopKey = StartKey | | | Value Start Key = ? | Index Search over XML 2 | | Access Table Name = ATTALURI.XISCANTABLE | | | Index Scan over XML: Name = ATTALURI.IDX2 ID = 4 ||||Physical Index over XML ||||Index Columns: |||||1:XMLCOL (Ascending) | | | #Key Columns = 4 ||||Start Key: Inclusive Value ||||||1:? ||||||2:? 324 w{}]bT\ ||||||3:? ||||||4:? ||||Stop Key: Inclusive Value ||||||1:? ||||||2:? | | | Index-Only Access | | | Index Prefetch: None | | | Isolation Level: Uncommitted Read | | | Lock Intents ||||Table: Intent None ||||Row:None | | | StopKey = StartKey | | | Value Start Key = ? ( 5) Insert Into Sorted Temp Table ID = t1 | #Columns = 1 | #Sort Key Columns = 1 | | Key 1: (Ascending) | Sortheap Allocation Parameters: | | #Rows = 2 | | Row Width = 16 | Piped | Duplicate Elimination ( 4) List Prefetch Preparation ( 4) | Access Table Name = ATTALURI.XISCANTABLE ID = 2,16 | | #Columns = 1 | | Fetch Using Prefetched List | | | Prefetch: Eligible | | Lock Intents | | | Table: Intent Share | | | Row : Next Key Share ( 2) Nested Loop Join | Piped Inner ( 9) | XML Doc Navigation | | Navigator is | | | /fn:root($CONTEXT_NODE$())/child::element(a)(:#Xpath Predicates = 1:) | | | [./child::element(b)(:Output nodeSeqRef :) | | | (:#Xpath Predicates = 1:) | | | /attribute::attribute(y) and | | | ./attribute::attribute(x)] ( 1) Iterate over XML sequence for Xquery bindout ( 1) Return Data to Application | #Columns = 1 End of section Optimizer Plan: RETURN (1) | NLJOIN (2) /\ FETCH XSCAN (----) ( 9) /\ RIDSCN Table: ( 4) ATTALURI | XISCANTABLE SORT (5) | XANDOR (6) /---------/ \--------\ XISCAN XISCAN (6) (6) /\ /\ Z 22 B i/CJ=8 325 Index: Table: Index: Table: ATTALURI ATTALURI ATTALURI ATTALURI IDX1 XISCANTABLE IDX2 XISCANTABLE >} 7:XSCAN Kc{: K>}T>K XSCAN Kc{gNvVZCJ=8P#K Kc{&mI6k-7,SKc{(NLJOIN)+]DZc}C#|ZCJ=8P;C 1Sdkm># IBM DB2 Database SQL Explain Tool ******************** DYNAMIC *************************************** ==================== STATEMENT ========================================== Isolation Level = Cursor Stability Blocking = Block Unambiguous Cursors Query Optimization Class = 5 Partition Parallel = No Intra-Partition Parallel = No SQL Path = "SYSIBM", "SYSFUN", "SYSPROC", "ATTALURI" Query Statement: xquery for $b in db2-fn:xmlcolumn("XISCANTABLE.XMLCOL" )//book[position()<= 2] return $b Section Code Page = 819 Estimated Cost = 779592.625000 Estimated Cardinality = 540000000.000000 ( 4) Access Table Name = ATTALURI.XISCANTABLE ID = 2,16 | #Columns = 1 | Relation Scan | | Prefetch: Eligible | Lock Intents | | Table: Intent Share | | Row : Next Key Share ( 3) Nested Loop Join | Piped Inner ( 6) | XML Doc Navigation | | Navigator is | | | /fn:root($CONTEXT_NODE$())/descendant-or-self::node()(:Output nodeSeqRef :) ||| ( 5) | Nested Loop Join | | Piped Inner ( 11) | | XML Doc Navigation | | | Navigator is ||||/fn:root($CONTEXT_NODE$())/child::element(book)(:Output nodeSeqRef :) |||| ( 10) | | Aggregation | | | Column Function(s) ( 9) | | Nested Loop Join | | | Piped Inner ( 12) | | | Unnest input XML sequence into stream of items with item number ( 8) | | Nested Loop Join | | | Piped Inner ( 14) | | | Table Constructor ||||1-Row(s) ( 2) Nested Loop Join | Piped Inner ( 16) | Unnest input XML sequence into stream of items ( 1) Iterate over XML sequence for Xquery bindout ( 1) Return Data to Application 326 w{}]bT\ | #Columns = 1 End of section Optimizer Plan: RETURN (1) | NLJOIN (2) /-/ \-----\ NLJOIN * (3) * /\ | TBSCAN NLJOIN TBSCAN ( 4) ( 5) ( 16) |/\| Table: XSCAN * TFunc: ATTALURI ( 6) * SYSIBM XISCANTABLE | GENROW NLJOIN (8) /\ NLJOIN FILTER ( 9) ( 13) /\ | GRPBY TBSCAN TBSCAN ( 10) ( 12) ( 14) ||| XSCAN TFunc: TFunc: ( 11) SYSIBM SYSIBM GENROW GENROW >} 8:XISCAN Kc{: K>}T>K XISCAN Kc{gN(hTm XISCANTABLE (eD XML }]w} IDX1# IBM DB2 Database SQL Explain Tool ******************** DYNAMIC *************************************** ==================== STATEMENT ========================================== Isolation Level = Cursor Stability Blocking = Block Unambiguous Cursors Query Optimization Class = 5 Partition Parallel = No Intra-Partition Parallel = No SQL Path = "SYSIBM", "SYSFUN", "SYSPROC", "ATTALURI" Query Statement: xquery for $c in db2-fn:xmlcolumn("XISCANTABLE.XMLCOL ")/a[@x="1" ] return $c Section Code Page = 819 Estimated Cost = 1666.833862 Estimated Cardinality = 18.000000 ( 6) Access Table Name = ATTALURI.XISCANTABLE | Index Scan over XML: Name = ATTALURI.IDX1 ID = 4 | | Physical Index over XML Z 22 B i/CJ=8 327 | | Index Columns: |||1:XMLCOL (Ascending) | #Key Columns = 2 | | Start Key: Inclusive Value ||||1:? ||||2:? | | Stop Key: Inclusive Value ||||1:? ||||2:? | Index-Only Access | Index Prefetch: None | Isolation Level: Uncommitted Read | Lock Intents | | Table: Intent None | | Row : None | StopKey = StartKey | Value Start Key = ? | Xpath is | | /child::element(a)/attribute::attribute(x) ( 5) Insert Into Sorted Temp Table ID = t1 | #Columns = 1 | #Sort Key Columns = 1 | | Key 1: (Ascending) | Sortheap Allocation Parameters: | | #Rows = 18 | | Row Width = 16 | Piped | Duplicate Elimination ( 4) List Prefetch Preparation ( 4) | Access Table Name = ATTALURI.XISCANTABLE ID = 2,16 | | #Columns = 1 | | Fetch Using Prefetched List | | | Prefetch: Eligible | | Lock Intents | | | Table: Intent Share | | | Row : Next Key Share ( 2) Nested Loop Join | Piped Inner ( 7) | XML Doc Navigation | | Navigator is | | | /fn:root($CONTEXT_NODE$())/child::element(a) (:Output nodeSeqRef :) | | | (:#Xpath Predicates = 1:) | | | /attribute::attribute(x) ( 1) Iterate over XML sequence for Xquery bindout ( 1) Return Data to Application | #Columns = 1 End of section Optimizer Plan: RETURN (1) | NLJOIN (2) /\ FETCH XSCAN (----) ( 7) /\ RIDSCN Table: ( 4) ATTALURI | XISCANTABLE SORT (5) 328 w{}]bT\ | XISCAN (6) /\ Index: Table: ATTALURI ATTALURI IDX1 XISCANTABLE 5wE"D5wmMi/ yP5wE"b)m.dDX 5# 5wE"f"ZBPmP: m 66. f"5w}]DX5m m{hv EXPLAIN_ARGUMENT |,PX?vvpKc{D(;XwDE"(g{fZD0)# EXPLAIN_INSTANCE yP5wE"DwXFm#5wmPD?;P}]E"#f ZKmP# EXPLAIN_OBJECT j6G)zIC4zc SQL r XQuery odDCJ=8yhD}]Ts# EXPLAIN_OPERATOR |,i/`kw*zc SQL r XQuery odyhDyPKc{# EXPLAIN_PREDICATE j6X(DKc{y&CD=J# EXPLAIN_STATEMENT |,TZ;,6pD5wE"xfZD SQL r XQuery odDD>#C'd kD-< SQL r XQuery odkE/wCZ!qCJ=8Df>;pf"Z KmP# 1ks5wlU1,aG%vKc{k}]Ts.dDdkMdv}]w#Z EXPLAIN_OBJECT mPm>}]Ts>m#Z EXPLAIN_OPERATOR mPm>}]wPf0D Kc{# Z 22 B i/CJ=8 329 m 66. f"5w}]DX5m (x) m{hv EXPLAIN_DIAGNOSTIC |,;vu?m>* EXPLAIN_STATEMENT mPD5wodDX(5}zI D?uoO{"# EXPLAIN_DIAGNOSTIC_DATA |,Z EXPLAIN_DIAGNOSTIC mPG# ?0,Z DB2 V9.5 P,z\;(}9C SYSPROC.SYSINSTALLOBJECTS }L44 ("OzMi$5wm#K}LJmZX(#=MmUdP4(5wm#ITZ EXPLAIN.DLL D~PR=`&D>}# 5wmI\T`vC'G+2D#+G,IT*;vC'(e5wm,;sIT9C `,{F48rQ(eDm4*?v=SC'(ep{#r_,IZ SYSTOOLS #= B(e5wm#g{Z/, SQL r XQuery odDC'a0j6r2, SQL r XQuery odDZ(j6BR;=d{5wmrp{,G45w$_+1!* SYSTOOLS #=#2m+C5wmD?vC'XkTG)mPekmI(#+C5wm DAmI((#2&^ZVv5wE"DC'# }]TsD5wE" %vCJ=8I9C;vr`v}]Ts4zc SQL r XQuery od# Ts3FE":5w$_G v Ts(vmrw}Ts)PDP} v Ts(vmrw}Ts)PD@FP} v TsCJ=8P9CDKc{MPX?vKc{DE"b,5wE"9T>CJ= 8D[F'{# @FI>E":ITT>TB@FDKc{[FI>#b)I>Gy!CJ=8DI >,|(6qdE"DKc{DI># v \FI>(T timeron F) v 3 I/O } v CPU 8n} v q!Z;PDI>(T timeron F),|(XhDNNu<*z v (EI>(T!F) timeron G"wD`TF?%;#Timeron IE/wyZZ9C}]b1a|DDZ?5 (g3FE")7(#rK,;\#$T SQL r XQuery odD timeron @bZ?N 7(T timeron FD@FI>1 v GqU/KlUE" 73hC:6qPXi/`kwE/i/yZD}]b\mw73DE"#73E" |(BPwn: v DB2 6pDf>EM"PfE v `kCi/D"PH CURRENT DEGREE (CDfw"DEGREE s(!n"SET RUNTIME DEGREE API M dft_degree dCN}7(`kX(i/D"PH# v Ci/odG/,D9G2,D v CZ`kCi/Di/E/6p v 1`ki/18(DNjPViD`M v Ci/KPDtk6p v `kCi/1wVdCN}D5#1q!5wlU1,G 6vpDi/od: v odD`M:SELECT"DELETE"INSERT"UPDATE"(;D DELETE"(;D UPDATE M SET INTEGRITY v Lr|P"vi/odDodEMZE,|GG@F:TZ?v5wod,E/wG<4Py!CJ=8D`XI>@F5#K I>4"wDF* timeron D`TF?%;4Bv#IZBP-r,;a)DC1d@ F5: v i/E/w;@FDC1d,x;@FJ4{D# 332 w{}]bT\ v E/w"G+I0lDC1dDyPrX<T0M'zM~qw.dD(E1 d# odD>:TZ?v5wDod,GD=vf>#;vf>Gi/` kwS&CLrSUDzk#m;vf>GSi/DZ?`kwm>4r*;D#! \K*;4O%`FZd{i/od,+|H;Xq-}7Di/oTo(,2;X S{eO43Z?m>D5JZ]#a)K*;,;G*KCzKb SQL M XQuery E /w!qCJ=8yZDOBD#*Kb SQL M XQuery `kwgNXB`4i/T q!|CDE/,+C'`4DodD>ki/odDZ?m>vHO#XB`4D od2T>C73P0lzDodDd{*X,g%"wM9 CD;)X|V|(: $Cn IzDPD{F,dP,n m>{}5# $CONSTRAINT$ ;vjG,CZ8>Z`kZdmSA-{}5# $INTERNAL_FUNC$ KjG8> SQL M XQuery `kw9CD/}GqfZ,C/}CZ5wD i/,+;I(C# $INTERNAL_PRED$ KjG8>Z`k5wDi/Zd,SQL M XQuery `kwmSD=JGqf Z,+;I(C#C`kw9C;vZ?=J4zcIZ%"wM;vZ?m/},C/}+%vx"MDdk XPath #=w*N},"5 XP;Pr`Pk%dC#=Dm# $RID$ ;vjG,CZj6X(PD“Pj6”(RID)P# $TRIGGER$ ;vjG,CZ8>Z`kZdmSA-*< &#K0:.sT>0li/odD`kMbvDNN%"wrzxk# -1 9C1!5 -e%-n%-s%-v%-w-1-#0 g{4a)5w#=,G473d? $USER r $USERNAME DZ]+Cw 1!5#g{R;=Kd?,G4aa>C'a)5w#=# -d dbname |,Lr|D}]bD{F# -e schema 5wm SQL #=# -f q=/j>#ZK"PfP,(;'VD5G O(Kc{\a)# -g # F Z# I Z# C Z(1!5 %) -h T>ozE"#18(KK!n1,d{yPD!no zE"# 9C5w } -h M -l !nb,+a>zdkNN4a)r4j{8(DN}5# g{4a)5wm SQL #=,G473d? USER D5+Cw1!5#g{R;=K d?,G4aa>C'a)5wmD SQL #=# 4{"4 SQL #=M5w1dAGIC LIKE =Jq=a),|Jm+YVE(%) MB._(_)w*#=%dV{,T(};vwC!q`v4#TZnBD5wo d,I+5w1d8(* -1# g{8( -o x;xD~{,R48( -t,G4aa>C'a)D~{(1!D~{* db2exfmt.out)#g{H48( -o 248( -t,G4aa>C'a)D~{(1!!n GUKdv)#g{,18( -o M -t,G4+dv(r=UK# g{5wlUIC,db2exfmt |n+T>ClUPD3FE"#qr,db2exfmt ;vT >f"Z EXPLAIN_OBJECT mPD3FE",9T>1SS53?}# db2 explain plan with snapshot for query db2exfmt r_, db2 set current explain mode yes db2 set current explain snapshot yes run the query db2exfmt Z 22 B i/CJ=8 335 E/i/CJ=8 E/6p 1`k SQL r XQuery i/1,IT8(E/6pT7(E/wgN!qCi/Dn P'CJ=8#I9Ci/`kPDi/X4fr# v "z07*O6Y# v vJm9C6W-7,S0w}(hCJ=(# v ZzIDCJ=(P;9CPm$!# v ; TxMZ6p 3 0|_6p#KE/6p_PBPXw: v {CKyPICD3FE",|(5JMV;}GyHV<3FE"# v };Z+YivBEJCDFc\/Mfrb,+&CyPd{i/X4f r,|(7IT_e/i/mDi/# v 9CK07*O6Y# v %d#KE/6p_PBPXw: v 9CGyHV<3FE"(g{ICD0),C3FE"zY51vVD 5# v &Cs?Vi/X4fr,|(Si/A,SDd;# v /,f.,S6Y,gBy>: – iOZ?mDP^9C – f0iRmDGM#=DQ({K}DP^9C v : – iOZ?mDP^9C – f0iRmDGM#=DQ({K}DP^9C v }G*zBq&m(OLTP)Bq# v TZKP1dO$(sZ 30 k)Di/,9C_E/6p(3"5 r 7)# v 6p 3 M|_D6p9C“/,`L”,S6Yc(#k6p 0"1 M 2 `H,K c(?N`ki/od1,Z{i/od4PDN}# ":Zu<`k.s,173|D*s/, SQL M XQuery od1,+XB` kb)/, SQL M XQuery od#g{+i/od_Y:f.s73;|D, G4;h*YN`k,r*s4D PREPARE od+4C_Y:fDod# v TZ2, SQL M XQuery od,HOodKP1d# !\zI\T2, SQL M XQuery odD`k1d2PK$,+CodD\F `kkKP1dZNNPbeDOBDP<\Q@F#HO\1d;\6pby ;vB5,4?N+2,i/ods(1,|ITKP`N,xZKP1,;c ;+|s(# 2. gBy>8(E/6p: v /, SQL M XQuery od9C CURRENT QUERY OPTIMIZATION (CDf w8(DE/6p,CDfwGC SQL od SET hCD#}g,BPod+E /6phC* 1: SET CURRENT QUERY OPTIMIZATION = 1 *7#/, SQL r XQuery odDE/w.;#+G,Z+YivB,KE/w I\a!q;GnQD4PF.#1 DBA l$}]b1,zIT9Cng db2advis"RUNSTATS M db2expln .`D$_ME/6phC4ozzw{E/w, TqC|CD}]bT\#g{Z9CKyPw{!ns4qCZ{Da{,G4I T* DB2 E/wa)T=E/Mw7j6;v SQL odyhDd{`XE"("?v SQL odkdX*DE/ KgN9CE/E*D~+E/ SELECT S.S_NAME, S.S_ADDRESS, S.S_PHONE, S.S_COMMENT FROM PARTS P, SUPPLIERS S, PARTSUPP PS WHERE P_PARTKEY = PS.PS_PARTKEY AND S.S_SUPPKEY = PS.PS_SUPPKEY AND P.P_SIZE = 39 AND P.P_TYPE = ’BRASS’ AND S.S_NATION = ’MOROCCO’ AND S.S_NATION IN (’MOROCCO’, ’SPAIN’) AND PS.PS_SUPPLYCOST = (SELECT MIN(PS1.PS_SUPPLYCOST) FROM PARTSUPP PS1, SUPPLIERS S1 WHERE P.P_PARTKEY = PS1.PS_PARTKEY AND S1.S_SUPPKEY = PS1.PS_SUPPKEY AND S1.S_NATION = S.S_NATION)) < 31. 9CE/E*D~4+]D=(4!qd{I\DCJ=8#TX(m}C*?jDE/@FnMD 8C=847(QE/odDnQCJ=(",S=(M,S3r# Zb=vE/WNZd# =8E/DE/WN&C=8E/D==7(# P=V`pD=8E/D5Zsv3P9CDuom}C8DG SQL odrS< (ePDNNm"S<"mmo=rp{# E/ {r9CkQE/odPDm}C`X*D(;`X{4j6m}C#)9{F(4 T>{DrP)IC4oz(;Xj6S{r)9{Z{vodDOBDP;G(;D,G4O*b)E/{r)9{FZE/ }LPT;fZ,ZbVivB,+vTyPTm}C*?jD{4j6m}C m}CG9CdT>{j6D#8(T>{D==kZ SQL odP^(mD==`,# CZ8( SQL j6DfrJCZ TABLE tT5# +E/{xPHO#ZK"PfD DB2 P, ;Jm%v%dn#g{ TABLE tT5G#=^(D,G4|kNNH[DT>^( m{%d#g{ TABLE tT54^(,G4|kNNH[D`X{rT>m{%d (rK,O* TABLE tT5IodDP'1!#=~=^()#Z 343 3D< 32PD 342 w{}]bT\ >}od5wKb)En#Y(9C1!#=“Tpcd”E/od# }7j6odPDm}CD TABLE tT5|(“″Tpcd″.PARTS”"“PARTS”M“Parts”(r *j64(g,yT|+*;*s4)#^(j6odPDm}CD TABLE tT5| (“″Tpcd2″.SUPPLIERS”"“PARTSUPP”(;GT>{)M“Tpcd.PARTS”(Xk(g j6 Tpcd,qr|+*;*s4)# IT9CT>{4T-{4j6S{r)9{F%d,G4O*KE/{xPHO Z 22 B i/CJ=8 343 E/w'=YFq-ZE/E*D~Pr(} SQL 6k=E/Zrzi\E/E*D~DZ]#x( DB2 "PfDP' E/E*D~Z]IF*10E/E*D~#=(COPS)D XML #=hv#"b, E/E*D~vJCZ DB2 }]b Linux f"UNIX fM Windows f~qw# 10"PfD DB2 D COPS P>ZZ 351 3D:10E/E*D~#=;P# E/E*D~IT|,+VK DB2 f> 9.1 DP'E/E*D~D>}#KE/E*D~|,;v+ VE/}P,K*X|,;vf> tT,8>E/E*D~Df>* 9.1# < 35. P'DE/E*D~ Z 22 B i/CJ=8 345 +VE/#ZZ 345 3D< 35 PT>D> } P , K ? V | , ; v + V E / < r , | 8 ( & < G 9 C _ e / i / m (MQT)Test.AvgSales M Test.SumSales 4&pE/E*D~TdP'DNNod# odE*D~?V odE*D~(eJCZX(odDE/#ZZ 345 3D< 35 PT>D>}P,K?V|,E/E*D~TdP'DX(odDDodX|VM od6pE/D>}P, STMTKEY *X|,-Mw7j6?jodyhDd{E"# E/w9CodX|VT/+odE*D~k`&Dod%d#KX5Jmz*&C LrPDoda)E/#ZI&%dod E*D~PDodX|Vs,E/w+ZE/od1}CX*DodE/}P,odE*D~?V|(C OPTGUIDELINES *Xm> DodE/w}CJks#indexScan *XD tableReference *X8( SUPPLIERS m*CJksD?j#index *X8(9C I_SUPPKEY w}# D#M 4!q=8Dd`?V# 4(E/E*D~: y]10E/E*D~#=,E/E*D~XkP'# IZE/E*D~IT|,m` 4. +E/E*D~?VmSAKD5# 5. ZE/E*D~*XZ,y]h*4(+V6pek=odX|VP4`-E/E*D~"4(odE*D~#} g: 5. ZodX|VBf`4odE/{4j6CJksM,SksP9 CDTs#TBG,SksD>}: Z 22 B i/CJ=8 347 6. i$"#fD~# *bTa{,kq-:dC DB2 T9CE/E*D~;":8(E/w+9CDE/ E*D~;MZ 343 3D:i$Gq9CKE/4(E/E*D~m# K mD?P<|,;vE/E*D~:SCHEMA M NAME Pj6E/E*D~,x PROFILE P|,E/E*D~DD># 2. I!:zITZh{O}]b2+T*sDNN(^#^[hCD(^gN,E/ w: v ^[NNd{hC*N,OPTPROFILE s(!n4^DE/E*D~#+G, 1}CKE/E*D~1,+ZZfP`k"TdxP_Y:f;9Xk}%b)} C#9C FLUSH OPTIMIZATION PROFILE CACHE odSE/E*D~_Y:fP }%IDE/E*D~,"9/,=8_Y:fP9CIE*D~<8DyPod< ''(_-'')# *^DE/E*D~: 1. `-E/E*D~TxPXhD|D"i$ XML# 2. 9CBDE*D~|B SYSTOOLS.OPT_PROFILE mPDP# 3. g{44(Z 371 3D:CZeUE/E*D~_Y:fD%"w;,G4"v FLUSH OPTIMIZATION PROFILE CACHE od# ":eUE/E*D~_Y:f1,9a+/,=8_Y:fP9CIE/E*D ~<8DyP/,od''# TKE/E*D~DNNsx}C}E/E*D~: (}S SYSTOOLS.OPT_PROFILE mP>};Yh*DE/E*D~,IT}%KE /E*D~#1}CKE/E*D~1,+ZZfP`k"TdxP_Y:f;r K,g{Q9C-}D E/E*D~# *>}E/E*D~: 1. S SYSTOOLS.OPT_PROFILE mP>}E/E*D~#}g: DELETE FROM SYSTOOLS.OPT_PROFILE WHERE SCHEMA = ’NEWTON’ AND NAME = ’INVENTDB’; 2. g{44(Z 371 3D:CZeUE/E*D~_Y:fD%"w;,G4(}S CLP PKP FLUSH OPTIMIZATION PROFILE CACHE |n4eUI\|,ZE /E*D~_Y:fPDNNf>DE/E*D~# ":KYw9a Z 22 B i/CJ=8 351 352 w{}]bT\ Z 22 B i/CJ=8 353 354 w{}]bT\ Z 22 B i/CJ=8 355 OPTPROFILE *XD XML #=: OPTPROFILE *XGE/E*D~Dy#4gB ==(e OPTPROFILE *X: XML Schema 356 w{}]bT\ hv I!D OPTGUIDELINES S*X(eE/E*D~D+VE/ hv IT9C MQTOptimizationChoices iPD*X"computationalPartitionGroupChoices i PD*Xr_9C REOPT *X(e+VE/ hv MQTOPT *XCZtCr{Cm{D}CDfr`,#g{8(K;vr`v MQT *X,G4E/w;v(Gq9C;vr`v8(D MQT 44P MQT f;# >} TB>}5wKgN{C MQT E/# TB>}5wKgN^FvT MQT“Tpcd.PARTSMQT”M“COLLEGE.STUDENTS”xP MQT E/# FcVxiE/!n: i computationalPartitionGroupOptimizationChoices (e;iI CZ0lFcVxiE/D*X#XpG,IT9Cb)*X4tCr{CFcVx iE/,r8(*CZFcVxiE/DX(Vxi# XML Schema hv PARTOPT *XCZtCr{Cv(Gq9C8(DV xi4P/,YV"# >} TB>}5wKgN{CFcVxiE/# TB>}T>KgN8>+Vxi WORKPART CZFcVxiE/: 358 w{}]bT\ REOPT +VE/ hv odE*D~8(JCZX(od(E/E*D~TKodP')DE/T0w7j6}7D&CLrody hDd{E"iI#:STMTKEY *XD XML #=;PyhvD STMTKEY S* Xm>odX|V# v od6pE/CZE/odDX(o dE*D~# STMTKEY *XD XML #=: statementKeyType `M(e STMTKEY *XDq=# XML Schema hv odX|VDodD>?V;w*p} ; * ` k X | V _ P 1 ! # = “COLLEGE”M/} 7 6 “SYSIBM,SYSFUN,SYSPROC,DAVE”,TB>}odX|VMkod“select * from orders where foo(orderkey) > 20”%d# 20]]> ":r*odD>|,Xb XML V{“>”,yTZodD>D\'9CK CDATA ? V(T a2)# odX|VM`kX|V%d: odX|VCZj6od6pE/ - &CLrP`4DodDD># v 1!#= - Cw4^(m{D~=?JD#={#K?VGI!D,+g{odD >PfZ4^(Dm{,G4&a)K#={# v /}76 - bv4^(D/}M}]`M}C19CD/}76#K?VGI!D, +g{odPfZ4^(DC'(eD/}rC'(eD`M,G4&a)K7 6# 1 DB2 `k SQL od"iRn/DE/E*D~1,|+"T9E/E*D~PD ?vodX|Vk10`kX|V%d#g{odX|VD?v8(?V: XML Schema 360 w{}]bT\ hv optGuidelinesType i(e OPTGUIDELINES *XDP'S*X/#DB2 E/wO*? vS*XG;vE/ \ \ \ \ hv IT9C;cks*X4(e;cE/DE/: XML Schema Z 22 B i/CJ=8 361 hv DEGREE ;cks*X_PXhD VALUE tT,KtT8( DEGREE !nDhC# KtTIT9C 1 = 32767 .dD{}5rV{.5“-1”r“ANY”#5 -1(H,Z “ANY”)8>9CD"PHI DB2 7(#5 1 8>i/;&9CVxZ"PT# QRYOPT ks: IT9C QRYOPT ;cks*X42Gs(!n"dft_qryopt }] bdCN}rH0D SET CURRENT QUERY OPTIMIZATION odDhC#QRYOPT ;cks*XI qryoptType (e,gBy>: XML Schema hv QRYOPT ;cks*X_PXhD VALUE tT,KtT8( DEGREE !nDhC# KtTIT9CTBPmPDNN5:0"1"2"3"5"7 M 9#Performance Guide | ,PX?vIT9CDhCDP*E"# REOPT ks: IT9C REOPT ;cks*X42G REOPT s(!nDhC# REOPT s(!n0l|,N}jGrwd?DodDE/#REOPT ;cks*XI reoptType (e,gBy>: XML Schema hv REOPT ;cks*X_PXhD VALUE tT,KtT8( REOPT !nDhC#K tTIT9C5 ONCE r5 ALWAYS#5 ONCE 8>&TZ;iwd?rN}jG 5E/od#5 ALWAYS 8>&T?iwd?rN}jG5E/od#Performance Guide |,PX?vIT9CD REOPT s(!nhCDP*Dj8E"# 362 w{}]bT\ RTS ks: IT9C RTS ;cks*X4tCr{C513FE"U/#9IT9C|4^F5 13FE"U/y(D1d#TZ3)i/r$w:X,I\h*{Cr^F513 FE"U/y(D1d,T\bod`k1Dnb*z# \ \ \ \ \ \ hv RTS ;cks*X_P=vI!tT# v OPTION tTCZtCr{C513FE"U/#|ITIC5 ENABLE r DIS- ABLE#g{48(!n,G4 ENABLE G1!5# v TIME tT8(Zod`k1U/%vodD513FE"yCDn$1d(TAk F)# g{T OPTION tT8(K ENABLE,G4Xk(}`&DdCN}tCT/3FE "U/M513FE"#qr,+;a&CE/ i/X4 hv v INLIST2JOIN:tCr{C IN-LIST A,SDX4d;#IT+|Cwod6p< r,TtCr{Ci/P*xP IN-LIST A,Sd;DyP IN-LIST =J#9IT +|Cw=J6p: XML Schema hv INLIST2JOIN *XP}vI!tT,+G;PS*X#OPTION tTD`M* optionType,d5*“ENABLE”r“DISABLE”#g{48( OPTION tT,G41!5 *“ENABLE”#m{tTMP{tTCZ8(f0y8(DmMPD IN-LIST =J#g {48(m{tTMP{tT,r_m{tTMP{tT<8(*UV{.:;,G 4+|w*od6p: XML Schema hv NOTEX2AJ *XP;vI!tT,+G;PS*X#OPTION tTD`M* optionType, d5*“ENABLE”r“DISABLE”#g{48( OPTION tT,G41!5* “ENABLE”# NOT-IN A4,SDX4ks: IT9C NOTIN2AJ ks*X4tCr{C NOT-IN A4,SDX4d;#;\+K*X8(*od6p: XML Schema 364 w{}]bT\ hv NOTIN2AJ *XP;vI!tT,+G;PS*X#OPTION tTD`M* optionType, d5*“ENABLE”r“DISABLE”#g{48( OPTION tT,G41!5* “ENABLE”# Si/A,SDX4ks: IT9C SUBQ2JOIN ks*X4tCr{CSi/A, SDX4d;#;\+K*X8(*od6p: XML Schema hv SUBQ2JOIN *XP;vI!tT,+G;PS*X#OPTION tTD`M* optionType,d5*“ENABLE”r“DISABLE”#g{48( OPTION tT,G41!5 *“ENABLE”# =8E/Zj85wICZ0l=8 E/D?vCJks*XM,Sks*X# CJks: accessRequest i(eP'CJks*X!nD/O#CJks8(CZz codPDm}CyhD=(# XML Schema hv v TBSCAN"IXSCAN"LPREFETCH"IXAND M IXOR b)*XT&Z DB2 }]CJ=(,;\+|G&CZodP}CD>Xm#|G ;\}CGF(6Lm)rIzDm(Si/Da{)# v ACCESS Z 22 B i/CJ=8 365 1,S3r(x;GCJ=()GX"Dw*Jb1,+9CK*X#1?jm} CGIzDm1,Xk9CK*X#E/w+y]I>!q?jm}CDCJ= (# CJ`M: TBSCAN"IXSCAN"LPREFETCH"IXAND"IXOR M ACCESS *XD ;c=fIBfT>Dis`M accessType (e# XML Schema hv yPCJks*X<)94S`M accessType#?vbV*X z#{Pby;v4PF.,|8(CJksD?jmw*`& FROM SdD,S3 rPDZ;vmvV#?v FROM SdP;\P;vCJr,Sks8( FIRST t T#g{T,; FROM SdPDm*?jD`vCJr,Sks8( FIRST tT,G 4+vT}Z;vksbDyPks,"R"v-rk* 13 D/f SQL0437W# NNCJks: IT9C ACCESS CJks*X4ksE/wTyZI>D==!q CZCJmDJ1=(#K!n(#CZ8(v8>>XmkodPDd{mD,S ==DCJks#1}CIzDm1,Xk9CKCJks*X#IzDmGm;v Si/Da{#ACCESS CJks*XI4S`M anyAccessType (e,gBy>: XML Schema hv 4S`M anyAccessType Gis`M accessType Dr%)9#4mSB*XrtT# w} AND KcCJks: IT9C indexAnding CJks*X4ksE/w9Cw } AND Kc}]CJ=(4CJ>Xm#K*XI4S`M indexAndingType (e, gBy>: XML Schema 366 w{}]bT\ hv 4S`M indexAndingType (}mSI!D INDEX tTMI!D INDEX S*X4) 9is`M localAccessType#INDEX tTICZ8(w} AND YwP9CDZ;v w}#g{9C INDEX tT,G4E/w+TyZI>D==!qd{w}MCJ3 r#INDEX *XICZ8(<7Dw}MCJ3r/#INDEX S*XDT>3r8> 4Pwvw}(h1&ICD3r#8( INDEX S*X+!z8( INDEX tT# v g{48(w},G4E/w+TyZI>D==!qw}MCJ3r# v g{(}9CtTrS*X8(Kw},G4b)w}Xkj6T TABLE r TABID tTyj6Dm(eDw}# v g{4Tm(ew},G4+vTCJks""v-rk* 13 D/f SQL0437W# Zw} AND KcCJksP,iw}XkvVZGXm#K*XI4S`M indexOringType (e,gBy>: XML Schema hv 4S`M indexOringType Gis`M accessType Dr%)9#4mSB*XrtT# g{w} OR KcCJ=(;ZodDP'QwUdP,G4+vTCJks""v- rk* 13 D/f SQL0437W#E/w+TyZI>D==!qw} OR YwP9C D=JMw}#w} OR KcCJ=(AYh*;vIT("w}D IN =JrxP_ - OR YwIT("w}M,SDnD=J#g{IZXhD=Jrw};fZxXm#K*XI4S`M indexScanType (e,gBy>: XML Schema hv 4 S ` M indexScanType ( } m S I ! D INDEX t T 4)9 i s ` M accessType#INDEX tT8(*CZCJmDw}D{F# Z 22 B i/CJ=8 367 v g{w}(hCJ=(;ZodDP'QwUdP,G4+vTCJks""v- rk* 13 D/f SQL0437W# v g{8(K INDEX tT,G4|Xkj6T TABLE r TABID tTyj6Dm( eDw}# v g{w};fZ,G4+vTCJks""v-rk* 13 D/f SQL0437W# v g{48( INDEX tT,G4E/w+TyZI>D==!qw}# v g{4T?jm(ew},G4+vTCJks""v-rk* 13 D/f SQL0437W# Pm$!CJks: IT9C listPrefetch *X4ksE/w9CPm$!w}(h4 CJ>Xm#K*XI4S`M listPrefetchType (e,gBy>: XML Schema hv 4S`M listPrefetchType (}mSI!D INDEX tT4)9is`M accessType# INDEX tT8(*CZCJmDw}D{F# v g{Pm$!CJ=(;ZodDP'QwUdP,G4+vTCJks""v- rk* 13 D/f SQL0437W# v Pm$!CJ=(AYh*;vIT("w}D=J# v g{IZXhD=J;fZxD==!qw}# v g{4T?jm(eJ1Dw},G4+vTCJks""v-rk* 13 D/f SQL0437W# m(hCJks: IT9C TBSCAN CJks*X4ksE/w9C3rm(h4C J>Xm#K*XI4S`M tableScanType (e,gBy>: XML Schema 368 w{}]bT\ hv 4S`M tableScanType GOfyT>Dis`M accessType Dr%)9#4mSB* XrtT#g{m(hCJ=(;ZodDP'QwUdP,G4+vTCJks" "v-rk* 13 D/f SQL0437W# ,Sks: joinRequest i(eP',Sks*X!nD/O#,Sks8(CZ,S =vmyhD=(# XML Schema hv NLJOIN"MSJOIN M HSJOIN ,Sks*XVpT&Z6W-7,S=("O",S =(M"P,S=(#Performance Guide |j8XhvKb),S=(DOq*sM4 PXw#JOIN ,Sks*X8>E/wIT!q,S=(#18(X(,S3rGX" Dw*Jb1,IT9CK!n# yP,Sks*X<|,=vS*X,|Gm>,SYwDdkm#,Sks9IT 8(I!D FIRST tT# NN,Sks: IT9C JOIN ,Sks*X4ksE/wIC|!qDNN,S= (TX(3r,S=vm#b=vdkmITGCJksS*Xy8(D>XmrI zDm,2ITG,SksS*Xy8(D,SYwDa{#JOIN ,Sks*XI4S `M anyJoinType (e,gBy>: XML Schema hv 4S`M anyJoinType Gis`M joinType Dr%)9#4mSB*XrtT# "P,Sks: IT9C HSJOIN ,Sks*X4ksE/wIC"P,S=(,S =vm#b=vdkmITGCJksS*Xy8(D>XmrIzDm,2ITG ,SksS*Xy8(D,SYwDa{#HSJOIN ,Sks*XI4S`M hashJoinType (e,gBy>: XML Schema Z 22 B i/CJ=8 369 hv 4S`M hashJoinType Gis`M joinType Dr%)9#4mSB*XrtT#g{ "P,S=(;ZodDP'QwUdP,G4+vT,Sks""v-rk* 13 D /f SQL0437W# O",Sks: IT9C MSJOIN ,Sks*X4ksE/wICO",S=(,S =vm#b=vdkmITGCJksS*Xy8(D>XmrIzDm,2ITG ,SksS*Xy8(D,SYwDa{#MSJOIN ,Sks*XI4S`M mergeJoinType (e,gBy>: XML Schema hv 4S`M mergeJoinType Gis`M joinType Dr%)9#4mSB*XrtT#g {O",S=(;ZodDP'QwUdP,G4+vT,Sks""v-rk* 13 D /f SQL0437W# 6W-7,Sks: IT9C NLJOIN ,Sks*X4ksE/wIC6W-7,S =(,S=vm#b=vdkmITGCJksS*Xy8(D>XmrIzDm, 2ITG,SksS*Xy8(D,SYwDa{#NLJOIN ,Sks*XI4S`M nestedLoopJoinType (e,gBy>: XML Schema hv 4S`M nestedLoopJoinType Gis`M joinType Dr%)9#4mSB*XrtT# g{6W-7,S=(;ZodDP'QwUdP,G4+vT,Sks""v-r k* 13 D/f SQL0437W# ,SksD`M: yP,Sks*XD+2=f: XML Schema 370 w{}]bT\ hv )9 joinType D,Sks*XXk}CP=vS*X#;vS*XITGSi accessRequest P!qDCJks*X,m;vS*XITGSi joinRequest P!qD ,Sks*X#,SksPvVDZ;vS*X8(,SYwDb?m,Z~v*X 8(Z?m#g{8(K FIRST tT,G4KtTD5Xk* TRUE#+ FIRST t TmSA,Sks*Xm>z#{Pby;v4PF.,dP,SksD?jmG` & FROM SdD,S3rPDb?m#?v FROM SdP;\P;vCJr,Sk s8( FIRST tT#g{T,; FROM SdPDm*?jD`vCJr,Sks8( FIRST tT,G4+vT}u(e SYSTOOLS.OPT_PROFILE mPDP: SCHEMA v 8(E/E*D~D#=^({##={n`IT|, 30 vV8}VrB. _V{,+|(e*gOy>D VARCHAR(128)# {F v 8(E/E*D~Dy>{F#K{Fn`IT|, 128 vV8}VrB. _V{# PROFILE v CZ(eE/E*D~D XML D5# ": 1. ITZ8v;,DOBDP}C,;vE/E*D~#SYSTOOLS.OPT_PROFILE m D NAME PM SCHEMA P;p8(I=?ViIDE/E*D~{#PROFILE P|,CZ(eE/E*D~D XML D5# 2. mUdrVxi;\NN^F# CZeUE/E*D~_Y:fD%"w: &4(BP SQL }LM%"w,T7# Z|Br>} SYSTOOLS.OPT_PROFILE mPDu?1aT/eUE*D~_Y:f# CREATE PROCEDURE SYSTOOLS.OPT_FLUSH_CACHE( IN SCHEMA VARCHAR(128), IN NAME VARCHAR(128) ) LANGUAGE SQL MODIFIES SQL DATA BEGIN ATOMIC -- FLUSH stmt (33) + quoted schema (130) + dot (1) + quoted name (130) = 294 DECLARE FSTMT VARCHAR(294) DEFAULT ’FLUSH OPTIMIZATION PROFILE CACHE ’; -- Z 22 B i/CJ=8 371 IF NAME IS NOT NULL THEN IF SCHEMA IS NOT NULL THEN SET FSTMT = FSTMT || ’"’ || SCHEMA || ’".’; -- END IF; -- SET FSTMT = FSTMT || ’"’ || NAME || ’"’; -- EXECUTE IMMEDIATE FSTMT; -- END IF; -- END; CREATE TRIGGER SYSTOOLS.OPT_PROFILE_UTRIG AFTER UPDATE ON SYSTOOLS.OPT_PROFILE REFERENCING OLD AS O FOR EACH ROW CALL SYSTOOLS.OPT_FLUSH_CACHE( O.SCHEMA, O.NAME ); CREATE TRIGGER SYSTOOLS.OPT_PROFILE_DTRIG AFTER DELETE ON SYSTOOLS.OPT_PROFILE REFERENCING OLD AS O FOR EACH ROW CALL SYSTOOLS.OPT_FLUSH_CACHE( O.SCHEMA, O.NAME ); \m SYSTOOLS.OPT_PROFILE m: E/E*D~Xkk(;D#=^({X*, "RXkf"Z SYSTOOLS.OPT_PROFILE mP#IT9C LOAD"IMPORT M EXPORT |n4\mCmPDD~#}g,ITZNN DB2 M'zP9C IMPORT | n4+D~PD}]ekr|B= SYSTOOLS.OPT_PROFILE mP#IT9C EXPORT |n+ OPT_PROFILE mPDE*D~lw=D~P# TBG+%@DdkD~PD}vBPek= SYSTOOLS.OPT_PROFILE mPD>}# Y(D~;Z10?}P,;sY+dek,r_+ INSERT_UPDATE !nk IMPORT dO9C: IMPORT FROM profiledata OF DEL MODIFIED BY LOBSINFILE INSERT_UPDATE INTO SYSTOOLS.OPT_PROFILE *+ ROBERT.PROF1 E*D~lw= ROBERT.PROF1.xml P(Y(KE*D~!Z 32,700 vVZ): EXPORT TO ROBERT.PROF1.xml OF DEL SELECT PROFILE FROM SYSTOOLS.OPT_PROFILE WHERE SCHEMA=’ROBERT’ AND NAME=’PROF1’ * X_e/GqGI>nMD=(,r_GqGErYwDXh=h#ZbVivB, vSICDJ4I\aa_T\# BPdCN}rrS0l SQL r XQuery `kw!qDCJ=8: v 14(rDd:eX18(D:eXs! 1E/w!qCJ=81,E/w*"@F zci/yh*D I/O N}#@F|($b:eX9Civ,r*;h*d{Dom I/O 4A!QZ:eXPD3PDP# E/wI0l: – gN,S=vm – Gq+9CG/:w}4A!}] v 1!H(dft_degree) dft_degree dCN}(}* CURRENT DEGREE (CDfwM DEGREE s(! na)1!548("PT#5 1 m>^VxZ"PT#5 -1 m>E/wy]&m w}?Mi/`M47(VxZ"PH# ":}G(}hC intra_parallel }]b\mwdCN}4tCZ?"P&m,qr; axPZ?"P&m# v 1!i/E/6p(dft_queryopt) d;Z`k SQL r XQuery i/1IT8(i/E/6p,+9IThC1!i/ E/6p# v n/&CLr=y}(avg_appls) E/w9C avg_appls N}4oz@FKP1ZdICZy!CJ=8D:eXDv }#O_DKN}5a0lE/w,9|!qZ:eXD9Civ=f|Z!DC J=8#g{8(5 1,G4E/wO*{v:eX+ICZ&CLr# v ErQs!(sortheap) g{*ErDP,|(@@Gq I9C\@+MEr: – @F*ErD}]? – i4 sortheap N},T7(GqPc;DUd(}\@+MEr# v x(PmDnsf"w(locklist)M}60x(PmDnsYVH(maxlocks) 1tk6pGIX4A(RR)1,E/w#CPU I>@FMwV I/O I> @FPzZ!qi/DnQCJ=8# ;(zwD CPU YHITx0ly!DC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ERIAL.ELASTCITY b)PD3FE"# Pi3FE"G9C RUNSTATS D“ON COLUMNS”!nU/D#}g,*U/ PRODUCT.COLOR M PRODUCT.ELASTICITY DPi3FE",I"vTB RUNSTATS |n: RUNSTATS ON TABLE product ON COLUMNS ((color, elasticity)) r%H[=JD@5T } JOIN =J`XTb,E/w99C`M* COL = Dr%H[=J4\m@5T# } g , k < G ; , N 5 ` M D m , ? ; V N 5 < P MAKE( 4 F l L ) " MODEL"YEAR"COLOR M STYLE(g=R5"CP5"|5)#r*8u?vFl L?jzzDwVMEM=yDN5<_P`,DjXH[=J,E/wxPw{1M;h*(;w }# 9Cw}MPi3FE"4FcVi|( 1i/*sT3V==T}]xPVi1,E/wh*Fc%5Vi},4Vi| (#VihsI\GIng GROUP BY r DISTINCT .`DYw}pD# k}P9|(5XDP })+G DEPTNO"MGR M YEAR_HIRED D%5}K}#bv@cY(Vi|PG @"D#+G,g{?v-m}P,IX1 PD FULLKEYCARD rE/wa)KTOi/D+7%5Vi}# kK (DEPTNO,MGR,YEAR_HIRED) D%5i}, yT|9PzZFcVi|(# }w}3FE"(FIRST2KEYCARD"FIRST3KEYCARD"FIRST4KEYCARD M FULLKEYCARD)Tb,E/w9IT{CPi3FE"4T`FD==FcVi| (#T DEPTNO"MGR M YEAR_HIRED U/DPi3FE"kOfD IX1 M IX2 P`,DEc: RUNSTATS ON TABLE EMPLOYEE ON COLUMNS ((DEPTNO, MGR, YEAR_HIRED)) "b,g{Vi||, 5 vr|`DP,G4nCU/Pi3FE"#bGr*, RUNSTATS vT0 4 PMNNx(w}Dj+w}|PU/3FE"# 3FS< 3FE"S3;PP}]5DV<,1}]54y HV<1|ITa_y}@FD<7T#3FE"9IC4m>;iPP%5D} ?,1b)PZ3FO`X1|ITa_y}@FD<7T#+G,.V#{D;V ivG,b)3FE"I\^(m>|4SDX5,}g,f0=`XtTMdNt TD=Jr[/D}K'{(}g,make = ’Honda’ AND model = ’Accord’)"km o=a{xPHO(}g,price > MSRP + Dealer_markup)"g`vmDX5(}g, product.name = ’Alloy wheels’ and product.key = sales.product_key)r_}Kf0=@ "tTMr%HOYwD=Jr[/.bDNNTs# 3FE"S; \xPE/DS<#Z;N4(S<1,;\xPE/# v *tCS 9.1 .0,T3FE"S<4P RUNSTATS +vn4?<3F E"mTxPV/|B,+;U/NN3FE"#Z DB2 f> 9.1 P,T3FE "S<4P RUNSTATS +U/3FE"#bm> RUNSTATS D4P1dI\H T0*$\`,b!vZS<5XD}]?# 3. |BS<3FE"a,tT} ]I\kB5mtT}];Br;;B#10ICZE/wD+3y>m3FE"; JmE/wfpwvm.dDX5#IT9C3FE"S<(M MQT)ODPMmV< 3FE"4*E/wa)|}b)`MDy}@FmsyhDE"# m3FE"4 7(>X=JD!qT,rKE/wI\T=J item_desc = ’golf club’ D!qT}Z V[# }g,g{_{rrw}a)KPXgNhC3FE"S<4bvK`JbDp=5w# T B G d M } ] V b P D ; v } ] b , d P STORE"CUSTOMER"PRODUCT"PROMOTION M PERIOD G,m,x DAILY_SALES GB5m# m 67. STORE(63 P) P storekey store_number city state district ... tT integer GU w| char(2) char(20) char(5) char(14) ... m 68. CUSTOMER(1,000,000 P) P custkey {F address age gender ... tT integer GU w| char(30) char(40) smallint char(1) ... m 69. PRODUCT(19,450 P) P prodkey category item_desc price cost ... tT integer GU w| integer char(30) decimal(11) decimal(11) ... m 70. PROMOTION(35 P) P promokey promotype promodesc promovalue ... tT integer GU w| integer char(30) decimal(5) ... 380 w{}]bT\ m 71. PERIOD(2922 P) P perkey calendar_date month period year ... tT integer GU w| date char(3) smallint smallint ... m 72. DAILY_SALES(754 069 426 P) P storekey custkey prodkey promokey perkey sales_price ... tT integer integer integer integer integer decimal(11) ... Yh+>D-m#{Kbg{{G*X7MT`,z7xPr[,G4{Q_Gqa YN:rCz7#Kb,YhvT+z 18 RjPDLj“01”xPwi#m 73 T>Kx PD;,`pDYz,CYzYVHm># m 73. PROMOTION(35 P) promotype promodesc COUNT(promotype) YzYVH 1 X7M 1 2.86% 2 E]/ 15 42.86% 3 cf 5 14.29% 4 -mDXbK1 3 8.57% 5 f"}`DL7 4 11.43% 6 (@)K9> 7 20.00% Cmmwya)D 35 VYzP;P 2.86% 4TX7M[[(1/35 = 0.0286)# ;s,4PBPi/"5XF} 12,889,514: SELECT count(*) FROM store d1, promotion d2, daily_sales f WHERE d1.storekey = f.storekey AND d2.promokey = f.promokey AND d1.store_number = ’01’ AND d2.promotype = 1 Ki/Gy]E/wzIDBP=84PD#ZKy}@F,Z~PGKc{`M,(EPD}VGKc{j6# 6.15567e+06 IXAND (8) /------------------+------------------\ 2.15448e+07 2.15448e+08 NLJOIN NLJOIN ( 9) ( 13) /---------+--------\ /---------+--------\ 1 2.15448e+07 18 1.19694e+07 FETCH IXSCAN FETCH IXSCAN ( 10) ( 12) ( 14) ( 16) /---+---\ | /---+---\ | 35 35 7.54069e+08 18 63 7.54069e+08 IXSCAN TABLE: DB2DBA INDEX: DB2DBA IXSCAN TABLE: DB2DBA INDEX: DB2DBA ( 11) PROMOTION PROMO_FK_IDX ( 15) STORE STORE_FK_IDX || 35 63 INDEX: DB2DBA INDEX: DB2DBA PROMOTION_PK_IDX STOREX1 Z 22 B i/CJ=8 381 Z6W-7,S`E 9 P,E/w@Fz[Dz7Ps< 2.86% 4TKMYNT[[ [q:r`,z7(2.15448e+07 / 7.54069e+08 = 0.0286)#k"b,KYVHZ,S PROMOTION mk DAILY_SALES m0s;Pd/#m 74 \aK,S0sDy}@ F0dYVH(}K'{)# m 74. k DAILY_SALES ,S0sDy}@F# ,S0 ,Ss =J F} OqPYVH F} OqPYVH store_number = ’01’ 18 28.57% 2.15448e+08 28.57% promotype=1 1 2.86% 2.15448e+07 2.86% r* promotype = 1 DI\T!Z store_number = ’01’ DI\T,yTE/w!q PROMOTION k DAILY_SALES .dDk,Sw*GM,S=8Dw} AND YwD b?'7#b+Cv9CYz`M 1 s<[vK 6,155,670 vz7D@FF},+b; G}7Dy}@F,d+krS* 2.09%(12,889,514/6,155,670 = 2.09)# G24D9CYz`M 1 z[D 2.86% Dz7I\Gs<#DAILY_SALES PD5J YVH\I\kT>D}V;,# IT9C3FE"S<4ozE/w|}d@F"5M_@rM@DI\T#WH, h*4(=v3FE"S<,Vpm>Ovi/PD?vk,S#Z;v3FE"S yPU#z[DY z`MDV<#k"b,?v3FE"S<<\a)PXNNX(Lj`ErYz` MDV}P,9C 10% DIyJ4lwwvS STORE k DAILY_SALES D,S# CREATE view sv_store_dailysales as (SELECT s.* FROM store s, daily_sales ds WHERE s.storekey = ds.storekey) 2. 4(;vS<4m> PROMOTION k DAILY_SALES D,S# CREATE view sv_promotion_dailysales as (SELECT p.* FROM promotion.p, daily_sales ds WHERE p.promokey = ds.promokey) 3. (}tCS<4xPi/E/,Sx9CS: 1.04627e+07 IXAND (8) /------------------+------------------\ 6.99152e+07 1.12845e+08 NLJOIN NLJOIN ( 9) ( 13) /---------+--------\ /---------+--------\ 18 3.88418e+06 1 1.12845e+08 FETCH IXSCAN FETCH IXSCAN ( 10) ( 12) ( 14) ( 16) /---+---\ | /---+---\ | 18 63 7.54069e+08 35 35 7.54069e+08 IXSCAN TABLE:DB2DBA INDEX: DB2DBA IXSCAN TABLE: DB2DBA INDEX: DB2DBA DB2DBA ( 11) STORE STORE_FK_IDX ( 15) PROMOTION PROMO_FK_IDX || 63 35 INDEX: DB2DBA INDEX: DB2DBA STOREX1 PROMOTION_PK_IDX k"b,K1 STORE M DAILY_SALES .dDk,SGZw} And =8Db?' 74PD#bGr*=v3FE"S<5JOf*E/w=J store_number = ’01’ } KDP}H promotype = 1 *`#m 75 \aK?vk,SD,S0sDy}@F0d YVH(}K'{)# k"b,K1 STORE M DAILY_SALES .dDk,SGZw} And =8Db?' 74PD#bGr*=v3FE"S<5JOf*E/w=J store_number = ’01’ } KDP}H promotype = 1 *`#bo,E/w@Fs<[vK 10,462,700 vz7# K@FD+nrS* 1.23(12,889,514 / 10,462,700 = 1.23),bHZ 382 3Dm 74 P CvD@F<7\`#m 75 \aK,S0sDy}@FM?v=JD}K'{# m 75. k DAILY_SALES ,S0sDy}@F# ,S0 ,Ss ;P3FE"S< ,Ss _P3FE"S< =J F} OqPYVH F} OqPYVH F} OqPYVH store_number = ’01’ 18 28.57% 2.15448e+08 28.57% 6.99152e+07 9.27% promotype=1 1 2.86% 2.15448e+07 2.86% 1.12845e+08 14.96% K1,E/w@Fs<[vK 10,462,700 vz7#K@FD+nrS* 1.23,bH; P3FE"S<1D@F*<7\`# Z 22 B i/CJ=8 383 384 w{}]bT\ Z 6 ?V =< © Copyright IBM Corp. 2006, 2008 385 386 w{}]bT\ =< A. DB2 Lr – LL v DB2 i. – PDF D~(IBX) – PDF D~(Z DB2 PDF DVD P) – !"fi. v |nPoz – |noz – {"oz ":DB2 E"PDwbD|B5JH PDF i.r2=4i.D|B5J_#*q!n BE",k20ICDD5|B,r_ND ibm.com® OD DB2 E"PD# ITZ_CJ ibm.com ODd{ DB2 c:http://www.ibm.com/ software/data/sw-library/# D54! RGG#XSzT DB2 D5D4!#g{zkMgNDF DB2 D5av(i,k+ gSJ~"MA db2docs@ca.ibm.com# DB2 D5!iaDAzDyP4!,+;\1 Sp4z#k!I\a)_eD>},byRGE\|CXKbzyXDDJb#g {z*a)PX_ewbrozD~D4!,kSOjbM URL# k;*CTOgSJ~X7k DB2 M''Vz9*5# g{zv=D5;\bvD DB2 9.5 VaMQ-kDf># !\b)mj6i.P!"f,+I\4ZzyZzRrXxa)# ?N|BVa1,m%EDVaDnBf># © IBM Corporation 1993, 2008 387 ":DB2 E"PDH PDF r2=4i.D|B5J_# m 76. DB2 c,x7*:http://www.ibm.com/shop/publications/order# XkH!qzR" XxroTE\CJvfo):E",;sY4UkTzyZ;CD):8>E" xP):# v *S1XD IBM zm&):!"fD DB2 i.: 1. SBPdP;v Web >cR=1Xzm&D*5E": – IBM +r*5K?<,x7* www.ibm.com/planetwide – IBM vfo Web >c,x7* http://www.ibm.com/shop/publications/order# XkH!qzR"XxroTE\CJT&zDyZXDvfow3#ZK 3fPCJ“XZK>c”4S# 2. kZBg15wzk): DB2 vfo# 3. krz1XDzma)k*):Di.Di{MiE#PXi{MiEDE", kNDZ 387 3D:2=4r PDF q=D DB2 SQL 4,oz DB2 5Xhv SQL od4Pa{D SQLSTATE#SQLSTATE oz5w SQL 4,M SQL 4,`zkD,e# *wC SQL 4,oz,r*|nP&mw"dk: ? sqlstate or ? class code dP,sqlstate m>P'D 5 ; SQL 4,,class code m>C SQL 4,D0 2 ;# }g,? 08003 T> 08003 SQL 4,Doz,x ?08T> 08 `zkDoz# CJ;,f>D DB2 E"PD TZ DB2 f> 9.5 wb,DB2 E"PD URL *http://publib.boulder.ibm.com/infocenter/ db2luw/v9r5/ TZ DB2 f> 9 wb,DB2 E"PD URL * http://publib.boulder.ibm.com/infocenter/ db2luw/v9/ TZ DB2 f> 8 wb,kCJTBf> 8 E"PD URL:http://publib.boulder.ibm.com/ infocenter/db2luw/v8/ 390 w{}]bT\ Z DB2 E"PDPTzDW!oTT>wb: DB2 E"PD"TTzZ/@wW!nP8(DoTT>wb#g{4a)wbDW! oT-kf>,G4 DB2 E"PD+T>CwbD"Df# v *Z Internet Explorer /@wPTzDW!oTT>wb: 1. Z Internet Explorer P,%w$_ —> Internet !n —> oT...4%#“oTW !n”0Zr*# 2. 7#zDW!oT;8(*oTPmPDZ;vu?# – *+BoTmSAPm,%wmS... 4%# ":mSoT";\#$Fcz_PTW!oTT>wbyhDVe# – *+oTFAPm%?,!qCoT"%wOF4%1=CoTI*oTP mPDZ;vu?# 3. e}/@w_Y:f;s"B3fTcTW!oTT> DB2 E"PD# v *Z Firefox r Mozilla /@wPTW!oTT>wb: 1. Z$_ —> !n —> _6T0rPDoT?VP!q4%#“oT”fe+T>Z “W!n”0ZP# 2. 7#zDW!oT;8(*oTPmPDZ;vu?# – *+BoTmSAPm,%wmS... 4%TS“mSoT”0ZP!q;VoT# – *+oTFAPm%?,!qCoT"%wOF4%1=CoTI*oTP mPDZ;vu?# 3. e}/@w_Y:f;s"B3fTcTW!oTT> DB2 E"PD# Z3)/@wMYw53iOO,I\9Xk+Yw53DxrhC|D*z!qD oT73MoT# |B20ZzDFczrZ?x~qwOD DB2 E"PD g{Q-Z>X20K DB2 E"PD,G4zITS IBM q!D5|B"20# |BZ>X20D DB2 E"PD*sz: 1. #9FczOD DB2 E"PD,;sT@"==XBt/E"PD#g{T@"= =KPE"PD,G4xgODd{C'+^(CJE"PD,rxzIT&C| B#G\mMGy DB2 E"PDc5qA>XD~53"20 DB2 E"PD#g{xgPPm`C'+20D5|B,G4IT(}Z>X2*|B >c("5q"*|B>c4(zm4uL?vK4P|Byh*D1d# g{a)K|B|,k9C“|B”&\?~4q!b)|B|#+G,;PZ@" ==BE\9C“|B”&\?~# 3. #9@"E"PD,;sZFczOXBt/ DB2 E"PD# =< A. DB2 D|n#*t/_P yP\m1X(D|na>{r\IBM\DB2 Information Center\Version 9.5 ? m> Program Files ?: help_start 531! Web /@w+t/TT>@"E"PD# 3. %w|B4%( )#ZE"PDDR_feO,%wiR|B# +T>VPD5 D|BPm# 4. *t/20xL,kliz*20D!n,;s%w20|B# 5. Z20xLjIs,k%wjI# 6. *#9@"E"PD,k4PBPYw: v Z Windows O,/@A20?: help_end ":help_end E>|,2+XU99C help_start E>t/DxLyhD|n# ;*9CNNd{=(4U9 help_start E># 7. XBt/ DB2 E"PD# 392 w{}]bT\ v Z Windows O,%w*< → XFfe → \m$_ → ~q#R|%w DB2 E "PD~q,"!qt/# v Z Linux O,dkTB|n: /etc/init.d/db2icdv95 start |BsD DB2 E"PD+T>BDwbM|BsDwb# DB2 LL DB2 LLozzKb DB2 z7Dwv=f#b)NLa)Kp=8>E"# *<.0 ISE"PDi4 XHTML fDLL:http://publib.boulder.ibm.com/infocenter/db2help/ # 3)NL9CKy>}]rzk#PXdX(NqDNNHvu~Dhv,kNDL L# DB2 LL *i4LL,k%wjb# 6pureXML 8O7PD:pureXML™; hC DB2 }]bTf" XML }]T0gNT>z XML }]f"4Py> Yw# 6Visual Explain LL7PD:Visual Explain; 9C Visual Explain 4Vv"E/Mw{ SQL odTq!|CDT\# DB2 JOoOE" \`JOoOMJb7(E"Iozz9C DB2 z7# DB2 D5 JOoOE"IZ DB2 E"PDD“DB2 JOoO8O”r“'VMJOoO” ?VR=#IZC&R=PXgN9C DB2 oO$_M5CLrtkMRvJ bDE""3)n#{JbDbv=8T0PXgNbv9C DB2 z71I\ v=DJbD(i# DB2 c g{zv=KJb"Rk*q!iRI\D-rMbv=8Doz,kND DB2 c#C“c_P8rnB DB2 vfo"< u5w"Z(LrVv(f(APAR rms^))"^)|Md{J4D4S# IQwK*6b"iRJbDI\bv=8# CJ;ZTBx7D DB2 c:http://www.ibm.com/software/ data/db2/udb/support.html unMu~ g{{OTBunMu~,G4Zhz9Cb)vfoDrFwb)vfordPNN?VD] ow7# L59C:;*#tyPD(P(yw,zMITvZs5Z4F"V"M9>b) vfo#4- IBM w7,b,z;ITFwb)vfoD]ow7,r_ZzDs5 b?4F"V"r9>b)vfordPDNN?V# }G>D9G5 ,D)ZhdP|,DvforNNE""}]"m~rd{*6z(# 19Cb)vfop&K IBM D{f,r_y] IBM Df(,4}7qXOv8< 5w1,G4 IBM #tTwv(7z>DZhDE",}Gj+qXyPJCD(IM(f,|(y P@zvZ(IM(f# IBM Tb)vfoDZ];wNN#$#b)vfo“4V4”a),;=PNNV`D (^[Gw>D9G5,D)#$,|(+;^Z5,DXZJzMJCZ3VX( C>D#$# 394 w{}]bT\ =< B. yw >E"G*Z@za)Dz7M~q`4D# IBM I\Zd{zRrXx;a)>D5PV[Dz7"~qr&\XT#PXz10 yZxrDz7M~qDE",krz1XD IBM zmI/#NNT IBM z7"L rr~qD}C"GbZw>r5>;\9C IBM Dz7"Lrr~q#;*;V8 IBM D*6z(,NN,H&\Dz7"Lrr~q,I\Q5Pr}Zjkk>D5Z]PXDwn({#a)>D5"4ZhC '9Cb)({DNNmI#zITCif==+mIi/Dy: IBM Director of Licensing IBM Corporation North Castle Drive Armonk, NY 10504-1785 U.S.A. PX+VZ(DBCS)E"DmIi/,kkzyZzRrXxD IBM *6z(?E* 5,rCif==+i/Dy: IBM World Trade Asia Corporation Licensing 2-31 Roppongi 3-chome, Minato-ku Tokyo 106, Japan >un;JC"zrNNbyDunk1X(I;;BDzRrXx:International Busi- ness Machines Corporation“4V4”a)>vfo,;=PNNV`D(^[Gw>D9 G5,D)#$,|(+;^Z5,DPXGV("JzMJCZ3VX(C>D# $#3)zRrXxZ3);WP;Jmb}w>r5,D#$#rK>unI\; JCZz# >E"PI\|,JODBf>P#IBM ITf1T>JOPhvDz7M/rLrxPD xM/r|D,x;mP(*# >D5I\a)G IBM Web >cMJ4D4Sr}C#IBM TZNNG IBM Web > crZ}=J4;wNNyw"#$rd{P5,49>D5I\}CKb) Web > crZ}=J4,r_IS>D5CJr4S=b) Web >crZ}=J4#=3v G IBM Web >cD4S";b6E IBM OIK` Web >cDZ]r9CrdyP _#Kb,IBM ;GzkNNZ}=)p-iDNN;WD;=,2;TNN;W: p,49zS3v IBM >cKb=K`Z}=r9C=K`Z}=D4S1`gK# rK,zh*PO",b,IBM ;TK`b?>crJ4DICT:p,2;TISG )>crJ4OqCDNNZ]"~q"z7rd{JOP#NNpNreq#Z} =a)DNNm~kqXCm~f=DmI$DunMu~# © IBM Corporation 1993, 2008 395 IBM IT4|O*J1DNN==9CrV"zya)DNNE"x^kTzP#NN pN# >LrD;mI=g{*KbPXLrDE"To=gB?D:(i)JmZ@"4( DLrMd{Lr(|(>Lr).dxPE";;,T0(ii)JmTQ-;;DE "xP`%9C,kkBPX7*5: IBM Canada Limited Office of the Lab Director 8200 Warden Avenue Markham, Ontario L6G 1C7 CANADA ;*qXJ1DunMu~,|(3)iNBD;(}?D6Q,JOPhvDmILr0dyPICDmIJOyI IBM @] IBM M'-i"IBM zJm~mI-irNN,H-iPDuna)# K&|,DNNT\}]D5DC'&1i$dX(73DJC}]# f0G IBM z7DE"ISb)z7D)&L"dvf5wrd{I+*qCDJO Pq!#IBM ;PTb)z7xPbT,2^(7OdT\D+7T"f]TrNNd {XZG IBM z7Dyw#PXG IBM z7T\DJb&1rb)z7D)&La v# yPXZ IBM 44=rrbrDywK?jMb8xQ# >E"I\|,ZU#5qYwP9CD}]M(fD>}#*K!I\j{X5w b)>},>}PI\a|(vK"+>"7FMz7D{F#yPb){FE"I\|(4oTN=Dy>&CLr,b)y>5w;,Yw=(OD`L= (#g{G*4UZ`4y>LrDYw=(OD&CLr`LSZ(API)xP&C LrD*""9C"-zrV"*?D,zITNNN=Tb)y>LrxP4F" ^D"V",x^kr IBM 6Q#b)>}"4ZyPu~Bw+fbT#rK,IBM ;\##r5>b)LrDI?T"I,$Tr&\# 2b)y>LrD?]=4rdNN?VrNN\zz7,D{F)(j]). K?VzkGy] IBM +>Dy>Lr\zv4D#© Copyright IBM Corp. (dkj]). All rights reserved. 396 w{}]bT\ Lj BPuoG International Business Machines Corporation Z@zM/rd{zRrXxD Ljr"aLj# pureXML OS/390 POWER4 DB2 Connect DRDA Redbooks eServer ibm.com pSeries DB2 IBM AIX BPuoGd{+>DLjr"aLj# v Linux G Linus Torvalds Z@zM/rd{zRrXxD"aLj# v UNIX G The Open Group Z@zM/rd{zRrXxD"aLj# v Windows G Microsoft Corporation Z@zM/rd{zRrXxD"aLj# d{+>"z7r~q{FI\Gd{+>DLjr~qjG# =< B. yw 397 398 w{}]bT\ w} [B] oz dCoT 391 SQL od 390 s( 8(tk6p 148 s(!n REOPT 2G 362 `kX|V (e 360 `kw 6qE" 5w$_ 291 X4 O"S< 247 mS~,=J 251 `XSi/ 249 j 88 dM,TQz== 75 =( 76 uYh* 75, 89 7(h* 86 Qz 79 V! 75 T/ 90 SP,CZVx}]bPD,S_T 273 `,/: 27 CJ I db2expln T>DE" 300 CJ76 x(== 171 *zXi 81, 82 ]#MXBt/ 82 x(== 171 QzXi 78 a_T\ 80 mXi ms&m 83 `S 83 mUd Ti/E/D0l 193 *z 193 TRANSFERRATE,hC 193 m3FE" V/|B 234 "P&m db2expln $_ 310 "PT G SMP 73 190 VxZ E/_T 281 Ev 190 I/O ~qwdC 70 \m 71 "PTXF *O}]b 145 9Cx( 150 Jb 145 ;IX4A "PTXF 145 [C] Yw IE/wO"rF/ 246 ek}] &m 37 1Tw}/:m 37 vT4d5D 170 i/ X4} 249 i/w{ 88 ms&m 83 `S 83 © Copyright IBM Corp. 2006, 2008 399 Xi (x) uYh* 89 *z 81 JOMV4 82 U>Ud*s 88 x(M"PT"bBn 83 w} 74 T/ 90 Qz 78 JOMV4 80 Ud*s 88 a_T\ 80 Qzk*z 76 !q=( 76 +3mXi 78 EL f"wT\rX 19 f"}L 9C=( 237 \@$ 237 [D] zmLr $wLrzm`M 105 \m 106 M'z,S 108 hv 105 ZVx}]bP 109 w{ JOoO 7 V^T 9 ZfVdN} 54 T\ Ev 1 Er 73 T\a_xL Ev 5 "PTDdv>} 315 9Cw} w}a9 31 w}(h 261 9C REFRESH TABLE od4( 296 }]Dhv 261 for REFRESH TABLE od 296 for SET INTEGRITY od 296 CJ76 j} 222 V/|Bfr 233 E/ 222 Vxm x( 180 w} 97 E/ 285 Vxd"PT db2expln $_ dv>} 320 dvy> 318 VxZ"PT E/_T 281 db2expln $_ dv>} 320 dvy> 316 Vx}]b73 i/Db}`X(>}) 249 4F_e/i/m 271 ,S _T 273 =( 274 400 w{}]bT\ Vx}]b73 (x) Tw{Zf 59, 61 V;}V<3FE" 219 [G] tk6p Tx(j8LHD0l 150 TT\D0l 146 @9kx(`XDT\Jb 165 8( 148 |B *' "PTXF 145 xL(f 133 <8 130 \aD=h 132 db2batch $_ 131 SQL od,CZ 130 /:w} 23 9CVxm 102 9CVxmDf& 102 GD~xPi/ 127 fr*X 119 hv 115 w} 401 XFw$_ (x) dC 117 dCD~ frhv 117 dCD~>} 123 t/ 115 U>D~4(_ 124 X$Lr hv 116 #9 115 XFPD lU`Sw 110 9C“hFKJLr” 138 B~Vvw 110 ij6(BID) ZCJm0xP<8 309 lU 1dc`S 110 [L] }L SQL T\ 237 *O}]b "PTXF 145 i/D+VVv 260 i/D db2expln dv 322 i/E" 312 VvZN&Ti/s5 256 ~qw!n 195 +VE/ 258 BFVv 253 *zXi 4(DD~ 81 JOMV4 82 WN 81 hv 81 U>Ud*s 88 gN4P 82 x(M"PT"bBn 83 EcM1c 76 kQzXiHO 76 ]#MXBt/ 82 ,S "CD 274 =( 267 Vx}]b73 274 Vx}]bPDmSP_T 273 Ev 266 2m[/ 247 c%Z?m 274 c%b?m 274 O"(merge) 267 `M (rZ?m 274 ,S (x) `M (x) (rb?m 274 6W-7 267 ks*X `M 370 HSJOIN 369 INLIST2JOIN 364 JOIN 369 joinRequest i 369 MSJOIN 370 NLJOIN 370 NOTEX2AJ 364 NOTIN2AJ 364 SUBQ2JOIN 365 "P 267 >} 247 5wVv=(DE" 294 !qE/w 269 E/w4PDSi/d; 247 db2expln E" 307 ,S/Pw M'z,SDx 108 C(>} 108 ZVx}]bP9CzmLr 109 P U/V<3FE",XZX(D 212 U/S*XD3FE" 227 V/|B3FE",fr 232 Pi3FE" 376 Y1m 9CE",db2expln 305 _-Vx `v 41 _-Zc }]bVx~qw 41 [M] |n db2gov 9C 115 ?} 222 |Bdv 62 Zf#M }]b\mw2mZf 51 Zf*s FCM :eX 54 GF V/|B3FE" 234 [P] Er TCJ=8D0l 280 \m 73 dCN} 0li/E/ 373 keepfenced 41 dCD~ XFw$_ 117 frhv 117 fr*X 119 >} 123 ,N{} kND}]Vx{} 285 [Q] 0vV4 (e 35 6W-7,S hv 267 +VE/ #tU>G< (e 35 -7 (e 35 IXFw$_4( 124 U>:ex a_i/T\ 35 U>G< 3FE" 208 3FE"n/ 203 U>D~ XFw$_ 127 [S] "P,S hv 267 T\w{ 267 hFKJLr (e$w:X 139 Ev 135 +%;Vx}]b(FA`Vx}]b 140 V^T 140 w}(i 92 ^F 140 T\w{ 47 KP 138 yw 395 1dc`S hv 110 5} 5wE" 331 513FE" tC 363 B~lU 110 S< IE/wO" 247 IE/wjID=JBF 249 X$Lr XFw 116 i. !"f ): 389 w} 403 }] i/PDIy 189 3FE"U/ 213 9u 74 }]Vx{} 285 }]b xL 12 }]bTs 5wE" 330 }]bVx~qw `Vx&m 41 }]bVxi i/E/D0l 374 }]b\mw 2mZf9C 51 }]b53`Sw E" Ev 110 }]wE" db2expln |n 308 }]4 T\ 258 I/O YH 258 5wm q=/Z] 333 i/ 329 5w$_ 6qE" 293 4(lU 293 VvE" 294 Ev 291, 297, 298 *Oi/s5 256 *O}]b 260 U/DE" 292 T>DE" d{ 313 5} 331 }]Ts 330 }]Kc{ 331 db2exfmt $_ 297 db2expln $_ 297 dynexpln $_ 297 Visual Explain 297 5w5} 329 @x Ev 16 lbw 16 x( j 94 SYe} 29 l=e} 29, 100 Ec 91 {mi, *z 102 [T] e5a9 Ev 11 unMu~ vfoD9C 393 (*6pdCN} x(}6JOoO 167 3FS< 4( 377 Dxy}$b 379 Ev 377 `X3FE" 379 3FE" Iy U/ 213 |B}) 251 &C 249 IE/w*; 246 4d5D}] "PTXF 145 D5 Ev 387 9CunMu~ 393 !"f 387 PDF 387 Jb7( LL 393 ICDE" 393 [X] 53xL 12 BFVv *O}]bi/ 253 B;|x( w}`M 183 *;w} 84 2 `w} 96 _L hv 41 Z DB2 P 12 j8LH lock Ev 153 r< hFKJLr 135 -wzmLr ,S/Pw9C 108 hv 12, 41 w} 405 T\ i/ 9C REOPT s(!nxPE/ 188 ELf"wrX 19 w{ dv 133 3 s! m 23 w} 23 Ev 23 3e}Lr w{}? 63 gvG< T\0l 86 ZjD 342 `M 341 i$ 344 ;c 341 MDC mD_T 283 E/E*D~ 340, 345, 348 4( 346, 348 \m 372 >} 350 ^D 350, 371 8( 349, 371 XML #= 351 E/w w{ 340 3FS< 4( 377 Ev 377 E/dv 324 XISCAN y>dv 324, 327 XSCAN y>dv 326 [Z] {mi, w} 102 "amd? DB2_SKIPINSERTED 170 *v SYe} 29 4, x(== 152 Si/ `XD X4== 249 Tw{Zf Vx}]b73 59, 61 Ev 55, 56 `S 57 {C 57 V^T 58 tC 56 G3;73 61 T/Xi hv 90 tC 90 T/w{Zf 57 T/&\ T/Xi 90 T/U/3FE" 202 f"w 203 T/3FE"E*Vv f"w 203 T/**m hv 289 \am kND_e/i/m# 289 nsi/"PHdCN} Ti/E/D0l 373 [}V] 2 `w} hv 31 B;|x( 183 Ec 96 A ALTER TABLE od @9kx(`XDT\Jb 165 ALTER TABLESPACE od >} 193 APPEND == ekxL 37 AUTO_PROF_UPD 9C 214 AUTO_STATS_PROF 9C 214 B BLOCKINSERT LOCKSIZE Sd5 Ec 153 C CLI(wC6SZ) 8(tk6p 148 COMMIT od @9kx(`XDT\Jb 165 comm_bandwidth }]b\mwdCN} Ti/E/D0l 373 cpuspeed dCN} Ti/E/D0l 373 CREATE SERVER od *O}]b!n 195 CURRENT EXPLAIN MODE (CDfw 6q5w}] 293 CURRENT EXPLAIN SNAPSHOT (CDfw 6q5wE" 293 CURRENT LOCK TIMEOUT (CDfw x(H}==_T 184 D database_memory }]bdCN} Tw{ 56 DB2 E"PD f> 390 w} 407 DB2 E"PD (x) |B 391 TwVoTi4 391 oT 391 db2advis |n 9C 138 w}(i 92 T\w{ 47 db2batch |n Ev 131 db2exfmt |n hv 333 dv>} 315 db2expln |n Pj6<8 309 ij6<8 309 dvhv *O}]b 312 ;c 300 dv>} ek 309 |B 309 _PVxd"PTD`Vx=8 318 _PVxZ"PTD%Vx=8 316 _Pj+"PTD`Vx=8 320 *O}]b=8 322 hv 315 >} 309 ^"PT 315 XANDOR Kc{ 324 XISCAN Kc{ 327 XSCAN Kc{ 324, 326 T>DE" mCJ 300 "P&m 310 [/ 310 ,S 307 Y1m 305 d{ 313 }]w 308 db2gov |n t/XFw 115 #9XFw 115 db2mtrk |n y>dv 62 DB2_EVALUNCOMMITTED "amd? SYPx( 168 DB2_USE_ALTERNATE_PAGE_ CLEANING "amd? w/D3e} 67 dft_degree dCN} Ti/E/D0l 373 2G 361 dynexpln $_ ms{" 299 73d? 299 hv 299 dynexpln $_ (x) dvhv 300 DYNEXPLN_OPTIONS 73d? hv 299 DYNEXPLN_PACKAGE 73d? hv 299 F FCM(lY(E\mw) :eX(buffer pool) 54 Zf*s 54 FOR FETCH ONLY Sd Zi/w{P 185 FOR READ ONLY Sd Zi/w{P 185 I IN(^br)== x(==hv 152 INCLUDE Sd Tw}h*DUdD0l 23 IS(br2m)== x(==hv 152 IX(br%b)== x(==hv 152 I/O "PT \m 71 $! 71 J Java }]b,S(JDBC) tk6p 8( 148 L LOCK TABLE od @9kx(`XDT\Jb 165 9x(}6n!/ 167 locklist dCN} i/E/ 373 x(j8LH 150 LOCKSIZE Sd Tx(j8LHD0l 150 8(x(j8LH 153 M maxappls dCN} TZf9CD0l 49 408 w{}]bT\ maxcoordagents dCN} 49 maxlocks dCN} 8(N1%"x(}6 167 max_connections }]b\mwdCN} CZ\mzmLr 106 max_coordagents }]b\mwdCN} CZ\mzmLr 106 MDC(`,/:)m mMw}D\m 27 i6px( 150 x(== mM RID w}(h 174 E/_T 283 *v>} 283 MINPCTUSED Sd CZ*zw}{mi, 23 MQT(_e/i/m) 4F,ZVx}]bP 271 T/**m 289 N NS(B;|2m)== x(==hv 152 NUMDB dCN} TZf9CD0l 49 NW(B;|u%b)== x(==hv 152 O ODBC(*E=}]b,S) 8(tk6p 148 OPTGUIDELINES *X +V XML #= 357 od6p XML #= 360 OPTIMIZE FOR Sd Zi/w{P 185 OPTPROFILE *X XML #= 356 Q QRYOPT ;cks*X XML #= 362 R REOPT s(!n hv 189 REOPT ks 362 REOPT +VE/oz 390 E/ dCN} 373 REOPT s(!n 188 SQLJ 8(tk6p 148 STMM(Tw{Zf\mw) Ev 55 `S 57 V^T 58 w} 409 STMM(Tw{Zf\mw) (x) tC 56 stmtheap }]bdCN} Ti/E/D0l 373 STMTKEY *X 359 STMTPROFILE *X 359 T TABLESAMPLE CZ 189 U U(|B)== x(==hv 152 V Visual Explain T*Oi/xPs5 256 LL 393 *O}]b 260 W W(u%b)== 152 WHERE Sd =J`p 252 X X(%b)== x(==hv 152 XML #= i/X4 9.5 Linux f"UNIX fM Windows f w{}]bT\ 

下载文档,方便阅读与编辑

文档的实际排版效果,会与网站的显示效果略有不同!!

需要 8 金币 [ 分享文档获得金币 ] 0 人已下载

下载文档

相关文档