DB2(常用工具)具体实用
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
题目:
1、熟练使用db2look工具导出数据库结构
2、使用db2pd监控表空间、锁的使用情况
3、使用db2mtrk 检查数据库内存的分配情况
4、练习使用db2top工具
5、使用db2batch测试SQL语句的性能
解答:
1、熟练使用db2look工具导出数据库结构
[myinst@ye ~]$ db2look -d mydb3 -l -e -o mydb3.dll
-- No userid was specified, db2look tries to use Environment variable USER
-- USER is: MYINST
-- Creating DDL for table(s)
-- Output is sent to file: mydb3.dll
-- Binding package automatically ...
-- Bind is successful
-- Binding package automatically ...
-- Bind is successful
2、使用db2pd监控表空间、锁的使用情况
#db2pd监控表空间
[myinst@ye ~]$ db2pd -db mydb3 -tablespace
Database Member 0 -- Database MYDB3 -- Active -- Up 0 days 00:29:31 -- Date
2015-08-24-11.36.10.344000
Tablespace Configuration:
Address Id Type Content PageSz ExtentSz Auto Prefetch BufID BufIDDisk FSC NumCntrs MaxStripe LastConsecPg RSE Name
0x00007F9AC71E0080 0 DMS Regular 32768 4 Yes 4 1 1 Off 1 0 3 Yes SYSCATSPACE
0x00007F9AC71ED220 1 SMS SysTmp 32768 32 Yes 32 1 1 On 1 0 31 No TEMPSPACE1
0x00007F9AC71FA3C0 2 DMS Large 32768 32 Yes 32 1 1 Off 1 0 31 Yes USERSPACE1
0x00007F9AC7207560 3 DMS Large 32768 4 Yes 4 1 1 Off 1 0 3 Yes SYSTOOLSPACE
0x00007F9AC7214700 4 DMS Large 32768 32 Yes 32 2 2 Off 1 0 31 Yes MYSPACE3
Tablespace Statistics:
Address Id TotalPgs UsablePgs UsedPgs PndFreePgs FreePgs HWM
Max HWM State MinRecTime NQuiescers PathsDropped TrackmodState
0x00007F9AC71E0080 0 7168 7164 6880 0 284 6880
6880 0x00000000 0 0 No n/a
0x00007F9AC71ED220 1 1 1 1 0 0 - - 0x00000000 0 0 No n/a
0x00007F9AC71FA3C0 2 1024 992 96 0 896 96
96 0x00000000 0 0 No n/a
0x00007F9AC7207560 3 1024 1020 80 0 940 80
80 0x00000000 0 0 No n/a
0x00007F9AC7214700 4 1024 992 352 0 640 352
352 0x00000000 1439886641 0 No n/a
Tablespace Autoresize Statistics:
Address Id AS AR InitSize IncSize IIP MaxSize LastResize LRF
0x00007F9AC71E0080 0 Yes Yes 33554432 -1 No None None No
0x00007F9AC71ED220 1 Yes No 0 0 No 0 None No
0x00007F9AC71FA3C0 2 Yes Yes 33554432 -1 No None None No
0x00007F9AC7207560 3 Yes Yes 33554432 -1 No None None No
0x00007F9AC7214700 4 Yes Yes 33554432 -1 No None None No
Tablespace Storage Statistics:
Address Id DataTag Rebalance SGID SourceSGID
0x00007F9AC71E0080 0 0 No 0 -
0x00007F9AC71ED220 1 0 No 0 -
0x00007F9AC71FA3C0 2 -1 No 0 -
0x00007F9AC7207560 3 -1 No 0 -
0x00007F9AC7214700 4 -1 No 0 -
Containers:
Address TspId ContainNum Type TotalPgs UseablePgs PathID StripeSet
Container
0x00007F9AC1270580 0 0 File 7168 7164 0 0
/www/db2/db2test/myinst/NODE0000/MYDB3/T0000000/C0000000.CAT
0x00007F9AC1270C60 1 0 Path 1 1 0 0
/www/db2/db2test/myinst/NODE0000/MYDB3/T0000001/C0000000.TMP
0x00007F9AC1268A20 2 0 File 1024 992 0 0
/www/db2/db2test/myinst/NODE0000/MYDB3/T0000002/C0000000.LRG