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 SQL命令将现有数据库表迁移至新的表空间,包括创建新表、声明并加载数据、删除旧表以及重命名新表等关键步骤。
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

被折叠的 条评论
为什么被折叠?