db2 数据迁移

db2数据库将表迁移到新的表空间



1、db2 create table newtable like oldtable in 新的表空间  

2、db2 declare c1 cursor database 数据库名 user 用户名 using 密码  for select  * from 原表 

3、db2 load from c1 of cursor insert into newtable 

4、db2 drop table oldtable 

5、db2 rename table newtable to oldtable 

你可能感兴趣的:(db2,表迁移,其他表空间)