2006-12-22 11:10
炸鸡
怎样看lv的使用量
db2的tablespace下有很多lv,它们好象定义为container。
现在有tablespace使用了90%,但下面的lv(都是raw device)估计使用量很不平均。
有什么命令可以看到每个lv(container)的用量呢?
db2的命令非常不熟悉,不知有没有sp_helpdevice之类的命令。
AIX上有没有办法看呢?
第3方工具?
2006-12-22 11:39
jpzhai
使用db2dart <databasename> /DTSF看一下Current map应该能推出来吧
2006-12-22 11:41
炸鸡
我用下面地方法,但全部都是100%使用。
icmadmin@dms5:/home/icmadmin>db2 list tablespace containers for 4 show detail
Tablespace Containers for Tablespace 4
Container ID = 0
Name = /home/cmdbins1/cmdbins1/NODE0000/SQL00003/sms
Type = Path
Total pages = 70
Useable pages = 70
Accessible = Yes
icmadmin@dms5:/home/icmadmin>db2 list tablespace containers for 0 show detail
Tablespace Containers for Tablespace 0
Container ID = 0
Name = /home/cmdbins1/cmdbins1/NODE0000/SQL00003/SQLT0000.0
Type = Path
Total pages = 9215
Useable pages = 9215
Accessible = Yes
2006-12-22 11:47
seven
鸡歌,db2中,某一个tbs下的containers是均匀使用的(除非这些containers的大小是不一样大的),当你add or drop一个containers 的时候,db2会对这个tbs中所有的containers 做Rebalance的,使得大家的使用率是一致的。
2006-12-22 11:56
jpzhai
我好象记得对于SMS类型的这条命令得出来的结果是做不得参考的
2006-12-22 11:59
wolfop
嗯,SMS肯定都是100%的了。找DMS跑那条命令看看。
2006-12-22 12:12
beginner-bj
最简单的命令是db2pd -tablespace -alldbs
2006-12-22 13:02
炸鸡
现在肯定那些container是不一样大小的,我想先把小的加大,达到同一水平的时候在一起加大。
wolfop,很熟悉,我认识你吗?我的记性不大好。:$
2006-12-22 13:06
炸鸡
beginner的命令输出:
Containers:
Address TspId ContainNum Type TotalPages UseablePgs StripeSet Container
0x41A46960 0 0 Path 260072 260072 0 /home/cmdbins1/cmdbins1/NODE0000/SQL00002/SQLT0000.0
0x41A47110 1 0 Path 1 1 0 /home/cmdbins1/cmdbins1/NODE0000/SQL00002/SQLT0001.0
0x41A478C0 2 0 Path 304 304 0 /home/cmdbins1/cmdbins1/NODE0000/SQL00002/SQLT0002.0
0x41A47A20 3 0 Path 22356 22356 0 /home/cmdbins1/cmdbins1/NODE0000/SQL00002/ICMLFQ32
0x41A47B80 4 0 Path 2956 2956 0 /home/cmdbins1/cmdbins1/NODE0000/SQL00002/ICMLNF32
0x41A47CE0 5 0 Path 92 92 0 /home/cmdbins1/cmdbins1/NODE0000/SQL00002/ICMVFQ04
0x41A47E40 6 0 Path 46646 46646 0 /home/cmdbins1/cmdbins1/NODE0000/SQL00002/ICMSFQ04
0x54447B60 7 0 Path 9 9 0 /home/cmdbins1/cmdbins1/NODE0000/SQL00002/CMBINV04
0x54447CC0 8 0 Path 1 1 0 /home/cmdbins1/cmdbins1/NODE0000/SQL00002/icmlssystspace32
0x54447E20 9 0 Path 1 1 0 /home/cmdbins1/cmdbins1/NODE0000/SQL00002/icmlssystspace4
我截取了有关container的部分,全都是100%。我现在是先用rmdb来做测试,icmnlsdb那边不知怎样。
2006-12-22 13:09
炸鸡
噢,icmnlsdb的输出也一样,都100%,这不是我想要看到的。
2006-12-22 13:10
beginner-bj
path表示的就是SMS,肯定永远都是100%。
2006-12-22 13:12
beginner-bj
防止SMS不够用,是用操作系统的df等命令定时监控。
2006-12-22 13:23
炸鸡
等等,type为path就代表sms,虽然我不明白sms的意思,但这表示我一定要进有问题那台机器看了。我还以为都一样,所以随手找一台有db2的来看。
2006-12-22 13:30
炸鸡
噢,这台是eee版本,db2pd跑不动。:L
2006-12-22 13:57
beginner-bj
sms是系统管理表空间,dms是DB管理表空间。两者的一个显著区别是dms是预先分配空间的,sms是按需分配,所以只有dms才会存在free的空间。
eee版本应该是v7的,db2pd是v8才有的,所以db2pd跑不动,替换方法可以db2 list tablespaces show detail。
2006-12-22 14:12
炸鸡
For SMS-managed storage, the tablespace will always appear to be 100% full.
This is because space is allocated in the filesystem (for the tablespace
containers) on an as-needed basis. There usually isn't any free space in
SMS containers, unless rows have been deleted and the space has not been
reclaimed (by inserting new rows or by doing a reorg.)
For DMS-managed storage, "Useable pages" will always be close to "Total
pages". The difference between these two values are the number of pages
that DB2 uses for control structures (container tags, extent maps, etc.)
What you really want to look at is the number of "Free pages". "list
tablespaces show detail" will show you the number of useable and free pages
in the tablespace. (In this case, 28672 of 146688 useable pages are free,
so the tablespace has about 20% free.)
Tablespace ID = 24
Name = TS_RAND
Type = Database managed space
Total pages = 147183
Useable pages = 146688
Used pages = 118016
Free pages = 28672
Unfortunately (to answer your original question), DB2 only lists "Free
pages" at the tablespace level, not at the container level. However, since
DB2 accesses containers in a round-robin fashion (on an extent basis), each
container will generally have the same amount of free space -- assuming that
each of your containers is the same size.
--
Matt Emmerton
DB2 OLTP Performance
IBM Toronto Lab
2006-12-22 15:17
darkbug
:D :D :D
2006-12-22 16:04
炸鸡
鄙视只会幸灾乐祸的斑竹。
我用list tablespaces show detail和list tablespaces container for x show detail查看,终于看到dms跟sms的区别。但,跟我们的dba商量之后,发现用处还是不大。
Tablespace ID = 86
Name = EDWTS_D_INC40
Type = Database managed space
Contents = Any data
State = 0x0000
Detailed explanation:
Normal
Total pages = 98304
Useable pages = 98272
Used pages = 3232
Free pages = 95040
High water mark (pages) = 3808
Page size (bytes) = 8192
Extent size (pages) = 32
Prefetch size (pages) = 32
Number of containers = 1
Minimum recovery time = 2005-05-26-09.24.07.000000
[email=dw1@ProdDB:/home/dw1]dw1@ProdDB:/home/dw1>db2[/email] list tablespace containers for 86 show detail
Tablespace Containers for Tablespace 86
Container ID = 0
Name = /dev/rd_inc40_p3_c1
Type = Disk
Total pages = 98304
Useable pages = 98272
Accessible = Yes
[[i] 本帖最后由 炸鸡 于 2006-12-22 16:06 编辑 [/i]]
2006-12-22 17:20
darkbug
SMS方式不支持添加容器并且平衡。。。。
LS到底想干什么?
2006-12-23 16:45
turbo
:L :L :L
鸡哥是故意装的吧,这么简单的问题,
2006-12-24 20:28
darkbug
还说和dba商量过。。。。。
2006-12-25 13:32
wolfop
[quote]原帖由 [i]炸鸡[/i] 于 2006-12-22 16:04 发表
鄙视只会幸灾乐祸的斑竹。
我用list tablespaces show detail和list tablespaces container for x show detail查看,终于看到dms跟sms的区别。但,跟我们的dba商量之后,发现用处还是不大。
Tablespace ... [/quote]
还不够么?
Total pages = 98304
Useable pages = 98272
Used pages = 3232
Free pages = 95040
High water mark (pages) = 3808
已经相当清楚了。
2006-12-26 15:47
炸鸡
靠,刚好这个有空间。这里有千多个裸设备,整天嚷嚷着要加大,但又没盘了。我只是想看看有没有办法另空间最有效地使用,当年建库的时候太随便了,现在可优化的地方应很多。
我们的DBA只是一个传声筒,实际功效不大,忽悠我也很容易。
2006-12-26 20:16
darkbug
千多个?鸡哥,我劝你还是算了吧,搞不好会死人的
老眼昏花,一旦弄错一个。。。。
页:
[1]
2
Powered by Discuz! Archiver 5.5.0
© 2001-2006 Comsenz Inc.