DB2 导出数据命令
在unix 系统下,什么命令可以将DB2数据库里,所有表的数据导出来。便于大环境测试。
[解决办法]
用db2move命令可以备份所有表以及恢复所有表,并且可以跨平台迁移数据
db2move sample export
db2move sample export -tc userid1,us*rid2 -tn tbname1,*tbname2
db2move sample import -l D:\LOBPATH1,C:\LOBPATH2
db2move sample load -l /home/userid/lobpath,/tmp
[解决办法]
用db2move命令可以备份所有表以及恢复所有表,并且可以跨平台迁移数据
db2move sample export
db2move sample export -tc userid1,us*rid2 -tn tbname1,*tbname2
db2move sample import -l D:\LOBPATH1,C:\LOBPATH2
db2move sample load -l /home/userid/lobpath,/tmp
[解决办法]
用db2move命令可以备份所有表以及恢复所有表,并且可以跨平台迁移数据
db2move sample export
db2move sample export -tc userid1,us*rid2 -tn tbname1,*tbname2
db2move sample import -l D:\LOBPATH1,C:\LOBPATH2
db2move sample load -l /home/userid/lobpath,/tmp
[解决办法]
http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=%2Fcom.ibm.db2.udb.admin.doc%2Fdoc%2Fr0002079.htm
[解决办法]
db2move 不是sql的
在command下执行
[解决办法]
语句前加DB2
[解决办法]
说错了,DB2MOVE前面不用加,你要切换到su到数据库的用户底下,执行才算是sql的命令行
[解决办法]
这些语句是在DB2的命令窗口下执行的
[解决办法]
doc下执行就ok了吧
[解决办法]
命令行:db2cmd
进去执行
[解决办法]
也可以用backup备份,然后用restore恢复,
下面是用于这种备份的 BACKUP 命令实用程序的语法:
BACKUP DATABASE database-alias [USER username [USING password]]
[TABLESPACE (tblspace-name [ {,tblspace-name} ... ])] [ONLINE]
[INCREMENTAL [DELTA]] [USE {TSM
[解决办法]
XBSA} [OPEN num-sess SESSIONS]]
[解决办法]
TO dir/dev [ {,dir/dev} ... ]
[解决办法]
LOAD lib-name [OPEN num-sess SESSIONS]]
[WITH num-buff BUFFERS] [BUFFER buffer-size] [PARALLELISM n]
[WITHOUT PROMPTING]
要使用其它备份选项来执行数据库“sample”的完全脱机备份,可以使用以下命令:
(1) BACKUP DATABASE sample
(2) TO /db2backup/dir1, /db2backup/dir2
(3) WITH 4 BUFFERS
(4) BUFFER 4096
(5) PARALLELISM 2
下面是 RESTORE 命令的语法:
RESTORE DATABASE source-database-alias { restore-options
[解决办法]
CONTINUE
[解决办法]
ABORT }
restore-options:
[USER username [USING password]] [{TABLESPACE [ONLINE]
[解决办法]
TABLESPACE (tblspace-name [ {,tblspace-name} ... ]) [ONLINE]
[解决办法]
HISTORY FILE [ONLINE]}] [INCREMENTAL [AUTOMATIC
[解决办法]
ABORT]]
[{USE {TSM
[解决办法]
XBSA} [OPEN num-sess SESSIONS]
[解决办法]
FROM dir/dev [ {,dir/dev} ... ]
[解决办法]
LOAD shared-lib
[OPEN num-sess SESSIONS]}] [TAKEN AT date-time] [TO target-directory]
[INTO target-database-alias] [NEWLOGPATH directory]
[WITH num-buff BUFFERS] [BUFFER buffer-size]
[DLREPORT file-name] [REPLACE EXISTING] [REDIRECT] [PARALLELISM n]
[WITHOUT ROLLING FORWARD] [WITHOUT DATALINK] [WITHOUT PROMPTING]
示例。要执行 sample 数据库的恢复,请使用以下命令:
(1)RESTORE DATABASE sample
(2) FROM C:\DBBACKUP
(3) TAKEN AT 20030314131259
(4) WITHOUT ROLLING FORWARD
(5) WITHOUT PROMPTING