The using of `db2move` command


==db2move== command could export data from db2.

Format

1
db2move <database-name> <action> [<option>   <value>]

Parameters interpretation

  • ==database-name== Name of the database;

  • ==action== Command of databse to implement import or export,including ==export、import、load==;

  • ==-u== username;

  • ==-p== password;

  • ==-tn== table’s name,export single table

  • ==-tf== file name,every sentence of the file record integrated name of the table

  • ==-ts== the name of tablespace,export all of the data in a table space

  • ==-tc== creator of the table,export all of the data which created by someone

  • ==-sn== name of model,export all of the data in a model

  • ==-io== model of import,assign a model the implement of DB2 could operate. Effective options contains: ==CREATE、 INSERT、 INSERT_UPDATE、 REPLACE 和 REPLACE_CREATE。== default value is ==REPLACE_CREATE==。

  • ==-lo== model of load,assign one model which the tools of DB2 can operate. Effective options contains :==INSERT== and ==REPLACE==. Default value is == INSERT==。

Examples

  • Export all data from Database
1
db2move db export -u db2admin -p db2admin
  • Export all data from one tablespace
1
db2move db export -ts tb1 -u db2admin -p db2admin
  • Export all data from several tablespaces
1
db2move db export -ts tb1,tb2 -u db2admin -p db2admin
  • Export Single table
1
db2move db export -tn tbname -u db2admin -p db2admin
  • Export all data in one model
1
db2move db export -sn schemaname -u db2admin -p db2admin
  • Export data on the basis of configuration files

All of tables which needed to export recorded in configuration files. You must pay attention to that only one table name should be writtened in that file each sentence.Addtionally, when put one table name in that line, you should increase model name belonging to.The quotation marks are also required.

1
db2move db export -tf table.txt -u db2admin -p db2admin
  • export all data which created by one person
1
db2move db export -tc db2admin -u db2admin -p db2admin

文章作者: Xiaowan
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 Xiaowan !
 上一篇
Linux中对limits.conf配置文件的优化 Linux中对limits.conf配置文件的优化
引言Linux中所有东西都是文件,系统配置的最大打开文件数以及单个进程能够打开的最大文件数都是由linux文件句柄限制的,默认一般都是1024,生产服务器用其实很容易就达到这个数量。
2017-06-22 liuxiaowan
下一篇 
Linux下添加Apache HTTP至系统服务 Linux下添加Apache HTTP至系统服务
版权声明:本文为博主原创文章,转载需注明出处。 测试环境 centos 6.5 自启动服务概述 自动启动的脚本一般放在/etc/rc.d/init.d目录下; 用命令chkconfig --add httpd(ubuntu下可用sys
2017-06-06 Xiaowan
  目录