答案:
1、在IDS 7.31中您可以使用oncheck -me来实现
2、在IDS 9.x 或 IDS 10.x,您可以通过:
2.1 创建一个与源表同结构的raw表
2.2 使用"insert into ... select * from ..."语句来传输数据
2.3 改变表的模式为正常模式,重命名或删除原表,然后将新表更名为原表名
2.4 重新创建所需的索引或约束
例如,我们需重构customer表,该表拥有一个索引和一个主键:
create raw table customer_new
(
customer_num serial not null ,
fname char(15),
lname char(15),
company char(20),
address1 char(20),
address2 char(20),
city char(15),
state char(2),
zipcode char(5),
phone char(1
) extent size 16 next size 16 lock mode page;
insert into customer_new select * from customer;
alter table customer_new type (standard);
drop table customer;
rename table customer_new to customer;
set pdqpriority high;
alter table customer add constraint primary key (customer_num) constraint pk_customer;
create index zip_ix on customer (zipcode) ;
Physical Address 2:536
Creation date 11/11/2009 12:11:21
TBLspace Flags 801 Page Locking
TBLspace use 4 bit bit-maps
Maximum row size 134
Number of special columns 0
Number of keys 0
Number of extents 40
Current serial value 962567
Current SERIAL8 value 1
Current BIGSERIAL value 1
Current REFID value 1
Pagesize (k) 2
First extent size 8
Next extent size 32
Number of pages allocated 3776
Number of pages used 3761
Number of data pages 3760
Number of rows 52632
Partition partnum 2097237
Partition lockid 2097237
3.2 删除部分数据
dbaccess stores <<!
delete from customer_new where customer_num > 1000;
!
Database selected.
52590 row(s) deleted.
Database closed.
oncheck -pt stores:customer_new
TBLspace Report for stores:informix.customer_new
Physical Address 2:536
Creation date 11/11/2009 12:11:21
TBLspace Flags 801 Page Locking
TBLspace use 4 bit bit-maps
Maximum row size 134
Number of special columns 0
Number of keys 0
Number of extents 40
Current serial value 962567
Current SERIAL8 value 1
Current BIGSERIAL value 1
Current REFID value 1
Pagesize (k) 2
First extent size 8
Next extent size 32
Number of pages allocated 3776
Number of pages used 3761
Number of data pages 3
Number of rows 42
Partition partnum 2097237
Partition lockid 2097237
Physical Address 2:536
Creation date 11/11/2009 12:11:21
TBLspace Flags 801 Page Locking
TBLspace use 4 bit bit-maps
Maximum row size 134
Number of special columns 0
Number of keys 0
Number of extents 1
Current serial value 962567
Current SERIAL8 value 1
Current BIGSERIAL value 1
Current REFID value 1
Pagesize (k) 2
First extent size 8
Next extent size 32
Number of pages allocated 8
Number of pages used 8
Number of data pages 3
Number of rows 42
Partition partnum 2097237
Partition lockid 2097237