查看: 10806|回复: 10

[笔记] db2dart工具使用的总结点滴

[复制链接]
论坛徽章:
3
授权会员
日期:2006-02-05 11:03:26数据库板块每日发贴之星
日期:2006-02-10 01:02:41IBM软件技术精英协会成员
日期:2006-12-21 15:37:12
跳转到指定楼层
1#
发表于 2006-2-10 12:14 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
数据库:
C:\>db2dart sample

表空间:
db2dart sample /ts /tsi 2
db2dart sample /ts <= When prompted for the table space ID,
enter "2".

Identify the object:
C:\>db2 "select creator,name,tid,fid from sysibm.systables where name =
'EMP_PHOTO'"
CREATOR NAME TID FID
------------------ --------------------- ------ ------
DB2 EMP_PHOTO 2 8

To inspect this table, execute either of the following db2dart commands:
db2dart sample /t /tsi 2 /oi 8
db2dart sample /t <= When prompted for the table ID and
table space ID, enter "8 2".

The ORG table in the sample database resides in table space 2 and has an object ID of 2. To
extract all of the data from this table, execute this command:
db2dart sample /ddel
When prompted, enter either of the following lines of input:
2 2 0 1000
ORG 2 0 1000

To determine the index object ID for a table, inspect that table. For example, inspect tables T1 and
T2 in table space DMS1 (which has a table space ID of 3):
db2dart sample /t /tsi 3 /tn T1(大写)

Look for the T1 entry. It should look something like this:
Table inspection start: DB2.T1
Data inspection phase start. Data obj: 4 In pool: 3
Data inspection phase end.
Index inspection phase start. Index obj: 4 In pool: 3
Scanning pages for index itoken(1) root page:258p.
Index inspection phase end.
Table inspection end.

As you can see, both the data object (the table) and the index object have the same table space ID
(4) and object ID (3). To mark this index object as bad, execute the following db2dart command:
db2dart sample /mi /tsi 3 /oi 4

Before moving on to the next section, reset the quiesce state for table space DMS1:
db2 "connect to sample"
db2 "quiesce tablespaces for table kelly.t3 reset"
db2 "connect reset"
论坛徽章:
3
授权会员
日期:2006-02-05 11:03:26数据库板块每日发贴之星
日期:2006-02-10 01:02:41IBM软件技术精英协会成员
日期:2006-12-21 15:37:12
2#
 楼主| 发表于 2006-2-10 12:20 | 只看该作者
在db2 v8.1 中提供了一个新的工具:
$db2  inspect  check  database  results  inspect_sample.err

inspect_sample.err文件存放在diaglogpath目录下

使用道具 举报

回复
论坛徽章:
71
马上加薪
日期:2014-02-19 11:55:14ITPUB十周年纪念徽章
日期:2011-11-01 16:19:412010广州亚运会纪念徽章:橄榄球
日期:2011-05-22 10:54:33管理团队成员
日期:2011-05-07 01:45:082011新春纪念徽章
日期:2011-01-25 15:42:562011新春纪念徽章
日期:2011-01-25 15:42:332011新春纪念徽章
日期:2011-01-25 15:42:152011新春纪念徽章
日期:2011-01-25 15:41:502011新春纪念徽章
日期:2011-01-25 15:41:012010年世界杯参赛球队:丹麦
日期:2010-04-06 10:23:36
3#
发表于 2006-2-10 14:32 | 只看该作者
用db2dart对数据库作一致性检查,很少用。但是用db2dart来恢复数据最近经常用,呵呵

使用道具 举报

回复
论坛徽章:
3
授权会员
日期:2006-02-05 11:03:26数据库板块每日发贴之星
日期:2006-02-10 01:02:41IBM软件技术精英协会成员
日期:2006-12-21 15:37:12
4#
 楼主| 发表于 2006-2-12 00:39 | 只看该作者
也把你的笔记贴出来看看

使用道具 举报

回复
招聘 : 数据库管理员
论坛徽章:
1
2010系统架构师大会纪念
日期:2010-09-03 16:39:57
5#
发表于 2006-2-14 10:51 | 只看该作者
最初由 bpmfhu 发布
[B]用db2dart对数据库作一致性检查,很少用。但是用db2dart来恢复数据最近经常用,呵呵 [/B]


db2dart 一次一个表一个表的导数据太麻烦,能不能一次把库里的数据都导出?

使用道具 举报

回复
论坛徽章:
3
授权会员
日期:2006-02-05 11:03:26数据库板块每日发贴之星
日期:2006-02-10 01:02:41IBM软件技术精英协会成员
日期:2006-12-21 15:37:12
6#
 楼主| 发表于 2006-2-14 11:38 | 只看该作者
没听说db2dart可以导出一个库的数据。不知道ibm lab是否有其他秘密通道?

使用道具 举报

回复
论坛徽章:
71
马上加薪
日期:2014-02-19 11:55:14ITPUB十周年纪念徽章
日期:2011-11-01 16:19:412010广州亚运会纪念徽章:橄榄球
日期:2011-05-22 10:54:33管理团队成员
日期:2011-05-07 01:45:082011新春纪念徽章
日期:2011-01-25 15:42:562011新春纪念徽章
日期:2011-01-25 15:42:332011新春纪念徽章
日期:2011-01-25 15:42:152011新春纪念徽章
日期:2011-01-25 15:41:502011新春纪念徽章
日期:2011-01-25 15:41:012010年世界杯参赛球队:丹麦
日期:2010-04-06 10:23:36
7#
发表于 2006-2-14 12:18 | 只看该作者
只能单表dump

使用道具 举报

回复
招聘 : c/c++研发
论坛徽章:
45
技术图书徽章
日期:2014-03-10 14:09:192012新春纪念徽章
日期:2012-02-13 15:12:092012新春纪念徽章
日期:2012-02-13 15:12:092012新春纪念徽章
日期:2012-01-04 11:51:22ITPUB十周年纪念徽章
日期:2011-11-01 16:21:15现任管理团队成员
日期:2011-05-07 01:45:082011新春纪念徽章
日期:2011-01-25 15:42:562011新春纪念徽章
日期:2011-01-25 15:42:332011新春纪念徽章
日期:2011-01-25 15:42:152011新春纪念徽章
日期:2011-01-25 15:41:50
8#
发表于 2006-2-15 01:07 | 只看该作者
最初由 我笨故我在 发布
[B]

db2dart 一次一个表一个表的导数据[/B]

咦?有这等事?详细说说?

使用道具 举报

回复
论坛徽章:
5
ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44生肖徽章2007版:鸡
日期:2008-01-02 17:35:53生肖徽章2007版:鼠
日期:2008-01-02 17:35:532009新春纪念徽章
日期:2009-01-04 14:52:282011新春纪念徽章
日期:2011-02-18 11:43:33
9#
发表于 2008-1-20 00:19 | 只看该作者
原帖由 ganquan 于 2006-2-10 12:20 发表
在db2 v8.1 中提供了一个新的工具:
$db2  inspect  check  database  results  inspect_sample.err

inspect_sample.err文件存放在diaglogpath目录下


What is the difference (if any) between
inspect check database
and
db2dart:

Major difference is that inspect does not require deactivating the db which
db2dart does.
Another is that inspect cannot do any repair work which db2dart does.

Other is that because inspect checks the physical integrity of the db its
command structure is more detailed (do a db2 ? inspect and look ) and more
precise to specify and filter what to inspect.
Inspect also creates a binary formatted file which has to be formatted with
the propr command (db2inspf I think).

This is just a quick reply. If you Google each (inspect and/or db2dart)
you'll get all the info you need.

[ 本帖最后由 acme1921209 于 2008-1-20 00:23 编辑 ]

使用道具 举报

回复
招聘 : c/c++研发
论坛徽章:
45
技术图书徽章
日期:2014-03-10 14:09:192012新春纪念徽章
日期:2012-02-13 15:12:092012新春纪念徽章
日期:2012-02-13 15:12:092012新春纪念徽章
日期:2012-01-04 11:51:22ITPUB十周年纪念徽章
日期:2011-11-01 16:21:15现任管理团队成员
日期:2011-05-07 01:45:082011新春纪念徽章
日期:2011-01-25 15:42:562011新春纪念徽章
日期:2011-01-25 15:42:332011新春纪念徽章
日期:2011-01-25 15:42:152011新春纪念徽章
日期:2011-01-25 15:41:50
10#
发表于 2008-1-20 01:21 | 只看该作者
inspect有的功能dart没有,dart有的一些功能inspect没有,两者互补。
而且inspect一般来说效率会快一点,因为可以用prefetch读数据到bp,dart只能一页一页自己读

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表