- 1、本文档共5页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
DB2数据迁移备份与恢复及联邦数据库使用操作命令
数据移动及实用工具
跨平台移动数据,首选PC/IXF文件格式进行数据的导出,平台间数据传输使用二进制。
导出命令基本语法
Export to 路径+文件名 OF del | ixf | wsf
Lobs to 大对象文件路径 lobfile 大对象文件名
Modified 分隔符选项
Method n (字段名列表)
Messages 消息文件
Select 子句
Eg1. Export to d:\export\org.txt of del select * from org
Eg2. Export to d:\export\org1.dat of del modified by chardel! Coldel# messages d:\export\org1_msg.txt select * from org
Eg3. Export to d:\export\emp_resume1.del of del lobs to d:\export\ lobfile emp_resume_lob1 modified by lobsinfile select * from emp_resume
导入命令基本语法
Import from 路径+文件名 OF del | ixf | wsf
Messages 消息文件
insert | insert_update | replace | replace_create | create
Into 目标表名称
Eg1. Import from d:\export\org.txt of del insert into org
Eg2. Import from d:\export\org1.dat of del modified by chardel! Coldel# messages d:\export\org_im_msg.txt insert into org
Eg3. Import from d:\export\emp_resume1.del of del lobs from d:\export\ modified by lobsinfile insert into emp_resume
Eg4. Import from d:\export\staff.ixf of ixf commitcount 1 restartcount 2 insert into staffback
Load 命令的基本语法
Load from 路径+文件名 OF del | ixf | wsf
Messages 消息文件
[insert |replace |terminate |restart]
Into 目标表名
[copy yes |copy no |nonrecoverable] [indexing mode autoselect|rebuild |increamental]
Eg1. Load from d:\export\org.txt of del messages :\export\org_load_msg.txt replace into org
Eg2. Load from d:\export\staff1.del of del insert into staffback for exception staffexp
处理load导致的异常状况
查看表的状态 load query table 表名称
关闭完整性检查
Set integrity for 表名称 check |foreign key |all immediate unchecked
处理表空间挂起状态,方法一:使用restart 模式重新load,成功则自动消除;方法二:使用terminate 模式的load 命令,强行终止load过程,并消除挂起状态。
Db2move 工具的使用
Db2move dbname export|import|load [-tc table_creator] [-tn table list] [-io import_option] [-lo load_option] [-l lobpath] [-u userid] [-p password]
Eg1. Db2move sample export –tc db2admin –tn org, staff
Db2 create db test
Db2move test import
Db2look 工具的使用
Eg1. Db2look –d sample –a -e -o db2look_test.ddl
数据维护工具
Reorgchk,更新db2优化器所使用的重要统计信息。语法:reorgchk update statist
文档评论(0)