??xml version="1.0" encoding="utf-8" standalone="yes"?>精品一区二区三区免费播放,国产私拍福利精品视频二区,国产在线播放avhttp://www.aygfsteel.com/qileilove/category/54129.html不想做屌丝的码农Q不是好目l理Q屌丝生涯从此开始!zh-cnFri, 14 Feb 2014 12:26:33 GMTFri, 14 Feb 2014 12:26:33 GMT60db2 数据库体pȝ?/title><link>http://www.aygfsteel.com/qileilove/articles/409872.html</link><dc:creator>其自然EVO</dc:creator><author>其自然EVO</author><pubDate>Fri, 14 Feb 2014 09:41:00 GMT</pubDate><guid>http://www.aygfsteel.com/qileilove/articles/409872.html</guid><wfw:comment>http://www.aygfsteel.com/qileilove/comments/409872.html</wfw:comment><comments>http://www.aygfsteel.com/qileilove/articles/409872.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/qileilove/comments/commentRss/409872.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/qileilove/services/trackbacks/409872.html</trackback:ping><description><![CDATA[<p style="padding: 5px 0px; margin: 0px; font-size: 14px; font-family: 微Y雅黑; color: #333333; line-height: 25px; -webkit-text-size-adjust: none; background-color: #ffffff;">?1. DB2 UDB 体系l构<br style="padding: 0px; margin: 0px;" /></p><p align="center" style="padding: 5px 0px; margin: 0px; font-size: 14px; font-family: 微Y雅黑; color: #333333; line-height: 25px; -webkit-text-size-adjust: none; background-color: #ffffff;"><img alt="DB2 UDB 体系l构" src="http://www.searchdatabase.com.cn/upload/5/20086/20080616192509171.gif" border="0" style="padding: 0px; margin: 0px; font-size: 14px; line-height: 21px; border: none;" /><br /><br /><p style="padding: 5px 0px; margin: 0px; font-size: 14px;">DB2 UDB 内存l构</p><ul style="padding: 0px; margin: 0px; font-size: 14px; line-height: 21px; list-style: none;"><li style="padding: 0px 0px 0px 20px; margin: 0px 0px 0px 10px; font-size: 14px; line-height: 25px; list-style: disc inside;">包缓?—— 为存储静态和动?SQL 语句而分配的内存?/li><li style="padding: 0px 0px 0px 20px; margin: 0px 0px 0px 10px; font-size: 14px; line-height: 25px; list-style: disc inside;">~冲?—— 在将数据h到磁盘之前,为存储数据而分配的内存?/li><li style="padding: 0px 0px 0px 20px; margin: 0px 0px 0px 10px; font-size: 14px; line-height: 25px; list-style: disc inside;">日志~冲?—— 在将所有对数据库的更改h到磁盘上的日志之前,用来存储q些更改的内存?/li></ul><p style="padding: 5px 0px; margin: 0px; font-size: 14px;">  ?2. DB2 UDB 数据库结?br /><br /><p align="center" style="padding: 5px 0px; margin: 0px; font-size: 14px;"><img alt="DB2 UDB 数据库结? src="http://www.searchdatabase.com.cn/upload/5/20086/20080616192550974.gif" border="0" style="padding: 0px; margin: 0px; font-size: 14px; line-height: 21px; border: none;" /></p><ul style="padding: 0px; margin: 0px; font-size: 14px; line-height: 21px; list-style: none;"><li style="padding: 0px 0px 0px 20px; margin: 0px 0px 0px 10px; font-size: 14px; line-height: 25px; list-style: disc inside;">驱动?目录 —— ?create DATABASE 命o中指定的驱动器或目录?/li><li style="padding: 0px 0px 0px 20px; margin: 0px 0px 0px 10px; font-size: 14px; line-height: 25px; list-style: disc inside;">DB2 实例名称 —— DB2 实例所有者的名称?/li><li style="padding: 0px 0px 0px 20px; margin: 0px 0px 0px 10px; font-size: 14px; line-height: 25px; list-style: disc inside;">NODE0000 —— 数据库的分区数? 表示非分区的数据库?/li><li style="padding: 0px 0px 0px 20px; margin: 0px 0px 0px 10px; font-size: 14px; line-height: 25px; list-style: disc inside;">SQL00001 —— ?1 开始的数据?ID?/li><li style="padding: 0px 0px 0px 20px; margin: 0px 0px 0px 10px; font-size: 14px; line-height: 25px; list-style: disc inside;">SQLOGDIR —— 数据库的默认日志目录?/li><li style="padding: 0px 0px 0px 20px; margin: 0px 0px 0px 10px; font-size: 14px; line-height: 25px; list-style: disc inside;">SQLT0000.0 —— 目录表空?SYSCATSPACE?/li><li style="padding: 0px 0px 0px 20px; margin: 0px 0px 0px 10px; font-size: 14px; line-height: 25px; list-style: disc inside;">SQLT0001.0 —— 临时表空?TEMPSPACE1?/li><li style="padding: 0px 0px 0px 20px; margin: 0px 0px 0px 10px; font-size: 14px; line-height: 25px; list-style: disc inside;">SQLT0002.0 —— 用户表空?USERSPACE1?br /><br /><div></div><div>q样理解数据?=数据+日志 数据库启?数据库管理系l就数据和日志调入内存中处?br /><div>一个驱动器? 可以有多个实?/div></div><br /></li></ul><br /></p></p><img src ="http://www.aygfsteel.com/qileilove/aggbug/409872.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/qileilove/" target="_blank">其自然EVO</a> 2014-02-14 17:41 <a href="http://www.aygfsteel.com/qileilove/articles/409872.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>一ơdb2数据库调优的l历http://www.aygfsteel.com/qileilove/articles/409664.html其自然EVO其自然EVOMon, 10 Feb 2014 06:22:00 GMThttp://www.aygfsteel.com/qileilove/articles/409664.htmlhttp://www.aygfsteel.com/qileilove/comments/409664.htmlhttp://www.aygfsteel.com/qileilove/articles/409664.html#Feedback0http://www.aygfsteel.com/qileilove/comments/commentRss/409664.htmlhttp://www.aygfsteel.com/qileilove/services/trackbacks/409664.htmlpȝ上线两个月左叻I请IBM工程师对数据库进行了一ơ调优,主要收获感觉有以下几点:
1Q应?/span>服务器一定要与数据库服务器分开
2Q如果存在多个数据库Q一定要盘分开(io?
3Q每个数据库的数据与日志一定要盘分开(io?
4Q针Ҏ据库主要有如下几点:
查看命中率:
打开实例U开养I主要是以下几个参敎ͼ
db2 update dbm cfg using DFT_MON_BUFPOOL  ON;
db2 update dbm cfg using DFT_MON_TABLE  ON;
db2 update dbm cfg using DFT_MON_STMT  ON;
update monitor switches using bufferpool on lock on sort on statement on table on uow on;

抓取快照:
db2 get snapshot for dynamic sql on dbname;
db2 get snapshot for table sql on dbname;
db2 get snapshot for bufferpools on dbname;

在快照文件中查看行读,行写,以及命中率的情况,从而做出相?/span>调整.

5,修改~冲池内存大?
先查看缓冲池的具体信?
select * from syscat.bufferpools;
修改~冲池大?
alter bufferpool bufferpool_name immediate size Ҏ的的大小 automatic;
6,动?/span>监视~冲池用情?
db2mtrk -i -d
7,查看数据库日志某D|间内
db2diag -time 2009-05-23.00.00.00:2009-05-23.00.30.00

其自然EVO 2014-02-10 14:22 发表评论
]]>
如何查询Table占用I间的大?/title><link>http://www.aygfsteel.com/qileilove/articles/409588.html</link><dc:creator>其自然EVO</dc:creator><author>其自然EVO</author><pubDate>Fri, 07 Feb 2014 09:53:00 GMT</pubDate><guid>http://www.aygfsteel.com/qileilove/articles/409588.html</guid><wfw:comment>http://www.aygfsteel.com/qileilove/comments/409588.html</wfw:comment><comments>http://www.aygfsteel.com/qileilove/articles/409588.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/qileilove/comments/commentRss/409588.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/qileilove/services/trackbacks/409588.html</trackback:ping><description><![CDATA[<span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">Oracle?/span><span href="tag.php?name=DB2" style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #ff0000; white-space: nowrap; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;">DB2</span><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">都支持分Q但是我们得知道什么样的表适合使用分区表技术,Oracle的官方徏议是过2G的Tablep使用分区表?nbsp;</span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">       下面来ȝ一下,各DB中如何获得这些大信息:</span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">  Oracle 10G中:</span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">  查询出当前用L表所占用的空间大,q按大小q行降序排列Q?/span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">  Select Segment_Name,Sum(bytes)/1024/1024 From User_Extents Group By Segment_Name order by Sum(bytes)/1024/1024 desc</span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">  查询出系l?/span><span href="tag.php?name=%E8%A1%A8%E7%A9%BA%E9%97%B4" style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #ff0000; white-space: nowrap; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;">表空?/span><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">的大,q按大小q行降序排列(需要SYSDBA?/span><span href="tag.php?name=%E6%9D%83%E9%99%90" style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #ff0000; white-space: nowrap; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;">权限</span><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">)Q?/span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">  Select Tablespace_Name,Sum(bytes)/1024/1024 From Dba_Segments Group By Tablespace_Name order by Sum(bytes)/1024/1024 desc</span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">  q个在OEMC中也可以看,但是如果没有装的话,</span><span href="tag.php?name=SQL%E8%AF%AD%E5%8F%A5" style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #ff0000; white-space: nowrap; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;">SQL语句</span><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">q是比较方便的?/span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">  DB2中:</span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">  查看某个Table的大可以在控制中心中用囑Ş界面查看?br /></span><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">DB2中有两种方式L看:</span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">一.查看表的使用|Q^均每行敎ͼq_行大(需要对表做runstats才获得准的数据Q?/span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">SELECT SUBSTR(a.tabname,1,10) AS table, PAGESIZE, b.CARD, b.npages , </span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">CASE WHEN (b.NPAGES  > 0) THEN (b.CARD / b.NPAGES) ELSE -1 END AS ROWS_PER_PAGE, </span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">SUM(AVGCOLLEN) AVG_ROW_SIZE FROM SYSCAT.COLUMNS a, SYSCAT.TABLES b, SYSCAT.TABLESPACES c </span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">WHERE a.tabschema = b.tabschema AND a.tabname = b.tabname AND b.tbspaceid = c.tbspaceid </span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">AND a.tabname = 'tabname' GROUP BY a.tabschema, a.tabname, pagesize, card, npages</span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">?查看表的大小Q获得的数据准确Q但查询语句执行很慢Q需要去扫描物理表)</span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">SELECT   SUBSTR(TABSCHEMA,1,18)   TABSCHEMA,</span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">                SUBSTR(TABNAME,1,30)     TABNAME,</span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">                SUM(DATA_OBJECT_P_SIZE)  DATA_OBJECT_P_SIZE,</span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">                SUM(INDEX_OBJECT_P_SIZE) INDEX_OBJECT_P_SIZE,</span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">                SUM(LONG_OBJECT_P_SIZE)  LONG_OBJECT_P_SIZE,</span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">                SUM(LOB_OBJECT_L_SIZE)   LOB_OBJECT_L_SIZE,</span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">                SUM(LOB_OBJECT_P_SIZE)   LOB_OBJECT_P_SIZE,</span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">                SUM(XML_OBJECT_P_SIZE)   XML_OBJECT_P_SIZE</span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">FROM     SYSIBMADM.ADMINTABINFO</span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">WHERE    TABSCHEMA='TABSCHNAME' and TABNAME='TABNAME'</span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">GROUP BY TABSCHEMA, TABNAME;</span><br /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">l计业务表数据量</span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">Select tabschema,tabname,sum(data_object_p_size),sum(index_object_p_size),sum(xml_object_p_size)        from sysibmadm.admintabinfo                                 </span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">where tabschema='模式A' and tabname like '%表名%'                                </span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">group by tabschema,tabname                                </span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">order by tabname</span><br /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">  SQL Server中:</span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">  执行</span><span href="tag.php?name=%E7%BB%9F%E8%AE%A1" style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #ff0000; white-space: nowrap; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;">l计</span><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">q查看指定表名的表大:</span><br style="word-wrap: break-word; margin: 0px; padding: 0px; word-break: break-all; list-style-type: none; line-height: normal; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #ffffff;" /><span style="color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22.39583396911621px; background-color: #ffffff;">  exec sp_spaceused '表名', true;<br /><br /></span><img src ="http://www.aygfsteel.com/qileilove/aggbug/409588.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/qileilove/" target="_blank">其自然EVO</a> 2014-02-07 17:53 <a href="http://www.aygfsteel.com/qileilove/articles/409588.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>DB2物理体系l构讲解http://www.aygfsteel.com/qileilove/articles/409417.html其自然EVO其自然EVOTue, 28 Jan 2014 16:21:00 GMThttp://www.aygfsteel.com/qileilove/articles/409417.htmlhttp://www.aygfsteel.com/qileilove/comments/409417.htmlhttp://www.aygfsteel.com/qileilove/articles/409417.html#Feedback0http://www.aygfsteel.com/qileilove/comments/commentRss/409417.htmlhttp://www.aygfsteel.com/qileilove/services/trackbacks/409417.html1  DB2 物理体系l构
1.1  主要对象层次关系 
pȝ  –> 实例  –> 数据?nbsp;
对象  名词解释  怺关系  备注 
pȝ 
体系l构中的最高层,  DB2产品安装版本 一个系l可创徏多个实例 一台机器上可安装多个DB2版本,  卛_版本共存; 
环境变量DB2PATH: (db2set –all查看)  DB2 数据库品安装目?nbsp;
实例 
DB2的独立运行环?  包括一l进E?U程、共享内?  数据库及其对象和DB2代码间的联系和结?一个实例可理多个数据?  删除实例q不删除?/div>
据库(Share  Nothing 架构), 但一个数据库只能属于一个实?实例?#8221;逻辑”?cM?#8221;服务”概念; 实例间彼此相互独? 互不影响 数据? 信息的物理存?  文g集合   
数据?br />?#8221;物理”?数据库对??表、烦?占用物理存储I间 
? Share Nothing VS Share Disk 

q行架构  应用架构  扩展方式  优势  典型代表 
Share Nothing  MPP  OLAP  Scale Up  可扩展?Teradata  DB2 
Share Disk  Cluster  OLTP  Scale Out  高可用?(ORACLE RAC   Sybase IQ)
1.2  数据库连?nbsp;
1.2.1  通信服务协议 
Type  PR  Value  Remark 
Local Connection IPC(q程间通信)    
Remote Connection TCP/IP DB2COMM 注册变量(db2set –all查看)讄 
 
db2set DB2COMM=TCPIP 
V9.5 后唯一支持?/div>
通信协议 
1.2.2  通信服务名称和端?nbsp;
Num  Opt    Example 
1 获取TCP/IP 服务名称 、服务端?db2 get dbm cfg | find “svcename” /i db2c_DB2 
2  获取TCP/IP 服务名称 、服务端?若参数gؓsvcename, 则需要查询TCP/IP  services文g,获取服务端口
/* Windows */ %systemRoot%\system32\drivers\etc\services  
 /* Linux / Unix  */ /etc/services db2c_DB2 50000/tcp  
 ? TCP/IP services
文g中寻扑֯应的
key/value条目
参数gؓport_name 50000 ?  查看服务器端口状? Netstat –ab  
? db2 get dbm cfg [service name | port name];  需重启实例生效 
1.2.3  ~目 
q程数据库连接需要先~目节点(机器),  DB2采用先编目再输入认证信息(用户名和?/div>
?来徏立数据库q接?br />
1、编?Catalog): 在客L注册要访问的节点(机器)及其数据? 先注册节点再注册?/div>
上的数据库?nbsp;
2、取消编?UnCatalog): ~目的反操作, 先取消数据库~目再取消节点编目?nbsp;

Opt  CATALOG  UNCATALOG 
(Local  Catalog )CATALOG LOCAL NODE <node name>  [INSTANCE  <instance name>] [SYSTEM <system name>]   [OSTYPE <os type>];  LIST NODE  DIRECTORY SHOW  DETAIL; CATALOG DB <db name> [AS alias]  ON <driver>; LIST DB DIRECTORY SHOW  DETAIL ON < driver>; 
UNCATALOG  NODE <node name>; 
(Remote  Catalog ) CATALOG TCPIP NODE  <node name> REMOTE <ip address>    SERVER <port>  REMOTE_INSTANCE  <node name>  OSTYPE <NT>; 
 LIST NODE  DIRECTORY SHOW  DETAIL; 
 CATALOG DB <db name> [AS alias]  AT NODE  <node name>]; 
 LIST DB DIRECTORY SHOW  DETAIL UNCATLOG  DB  <db name>;
? ~目操作cM于Oracle 本地Net 服务名配|?tnsname.ora,  但操作无法验证编?/div>
信息是否正确(无论~目信息是否正确都能注册), 只能通过输入认证信息建立数据库连
接才能测试是否注册成功?br />
1.3  实例理 
1.3.1  实例目录 
默认DB2INSTPROF(db2set –all查看) 注册变量路径,  实例目录下的主要文g及目? 
1?HOME\SQLDBDIR:数据库编?使用db2 list db directory 查看 
2?HOME\SQLNODIR:节点~目,使用db2 list node directory 查看 
3、db2nods.cfg:节点配置文g 
4、诊断文件db2diag.log、数据库错误日志、安全配|等信息 
1.3.2  实例配置 
对实例目录下二进制数据库理配置文gdb2systmq行查看、更改和重置?nbsp;
Opt  Windows  Remark 
List   db2 get dbm cfg  数据库管理配|文? $INSTANCE_HOME\  db2systm 
Update db2 update dbm cfg using  <param name> <param value> l大部分实例参数更改需要重启实例生?nbsp;
db2 update dbm cfg using  <param name> NULL 讄参数为空 
Reset  db2 reset dbm cfg   配置参数复位(初始化ؓ默认? 

1.3.3  实例操作 
Opt  Windows   Remark Create  
db2icrt <instance name>   -p <InstProfPath> -p: 实例目录路径,  若省略则默认 DB2INSTPROF(db2set –all查看) 注册变量路径
List /* 查看当前实例  */ db2 get instance  /* 查看所有可用实? */ db2ilist 可采用DB2INSTANCE操作pȝ环境变量查看: echo %db2instance% (Windwos) 
echo $db2instance (Linux/Unix) 
Set set db2instance=<instance name> set db2instance 1?DB2INSTANCE操作pȝ环境变量,cM于ORACLE中的ORACLE_SID, 用于实例切换 2?“=”  左右l对不能包含I格 
Start  db2 db2start   win7环境中启停、删除、更新等操作会遇DB21009E错误,需?#8221;理员权?#8221;才能启动此命?
 解决Ҏ:应用db2cmdAdminq入db2CLP
Stop db2 force application all  db2 db2stop [force] 
Upgrade db2 force application all;  db2 db2stop [force]; 
 db2iupdt <instance name> -p < InstProfPath>; 
1?更新前需停止该实例上q行的所有进
E?nbsp;
2?更新前需先停止实?nbsp;
3?-p: 更新实例目录路径 
4?适用于数据库版本升U?nbsp;
Drop  db2 force application all;  1?删除前需停止该实例上q行的所有进E?br />
db2 db2stop [force]; 
 
db2idrop <instance name>; 
2?删除前需先停止实?nbsp;
3?删除实例q完全删除实例目?q包?/div>
db2diag.log{文?, 需手工处理 
Attach  db2 attach to <instance name>  q接到远E实?nbsp;
Detach  db2 detach  断开q程实例q接 
 1.4  理服务器DAS 
DAS  (Database  Administration  Server) 配合DB2囑Ş界面完成对远E数据库的操? 
一个系l下仅能有一个DAS, 所有DB2副本都?个DAS, 同时理多个实例? 
1.4.1  理服务器配|?nbsp;
Opt  Windows  Remark 
List   db2 get admin cfg  数据库管理配|文? $INSTANCE_HOME\  db2systm 
Update db2 update admin cfg using  <param name> <param value> 某些情况下管理器配置参数更改需要重启管理服务器生效 
db2 update admin cfg using  <param name> NULL 讄参数为空 
Reset  db2 reset admin cfg   配置参数复位(初始化ؓ默认?
1.4.2  理服务器操?nbsp;
Opt  Unix(Linux)  Windows  Remark 
List  dasilist      db2admin 
win7 环境? 启停、删除等操作会遇
DB21009E错误,需?#8221;理员权?#8221;才能?/div>
动此命o;  解决Ҏ:应用db2cmdadmin
q入db2CLP  
Start    db2admin start 
Stop    db2admin stop 
Create  dasicrt  db2admin create 
Drop  dasidrp  db2admin drop 
 
备注: ׃DB2  V9.7 ?  db2cc(控制中心) \ db2tc(d中心) {图形界面逐渐被IBM 
Data Studio \ IBM  Optim  所取代, 在不使用囑Ş界面操作时候关闭此服务?/div>


其自然EVO 2014-01-29 00:21 发表评论
]]> վ֩ģ壺 | | ߶| ˳| | | | | | żҸ| | | ѷ| | | | | | | | | | ٽ| ޳| ׯ| Ϫ| | ̶| | | ΢| | ˫| | | | | ɽ| ˮ| ػ| |