informix fragment 分片表的常見操作 ids9.40
1、建立分片表
create table cell_fragment
(
id int,
name varchar(10)
)
FRAGMENT by EXPRESSION
(id > 5 and id < 10) IN niosdbs,
(id <= 5) IN tpddbs;
2、生成測試資料
insert into cell_fragment values(1,'1111');
insert into cell_fragment values(4,'44');
insert into cell_fragment values(8,'81111');
insert into cell_fragment values(9,'91111');
insert into cell_fragment values(2,'21111');
insert into cell_fragment values(3,'31111');
insert into cell_fragment values(10,'31111');
insert into cell_fragment values(16,'31111');
insert into cell_fragment values(19,'31111');
3、查詢系統表,定位tabid
select * from systables where tabname ='cell_fragment'
select * from SYSFRAGMENTS where tabid = 1539
4、每次操作後更新統計資訊
update statistics high for table cell_fragment
5、add detach attach modify init更改分片
alter fragment on table cell_fragment add (id >=10 and id <20) in nrmdbs;
alter fragment on table cell_fragment detach nrmdbs temp_nrmdbs;
alter fragment on table cell_fragment attach temp_nrmdbs as (id >=10 and id <20);
alter fragment on table cell_fragment add remainder in kpidbs;
alter fragment on table cell_fragment modify kpidbs01 to (id <3) in tpddbs;
alter fragment on table cell_fragment init fragment by expression
id <3 in nrmdbs,
id >=3 and id <5 in niosdbs,
id >=5 and id <10 in kpidbs,
remainder in tpddbs;
select * from temp_nrmdbs;
alter table cell_fragment add CONSTRAINT primary key(id);
總結
1、ids9.4尚不支援 partition by expression partition part1 (id > 5 and id < 10) IN niosdbs類似的操作;ids11已經提供了支援
2、partition part1 in dbs01,partion part2 in dbs03,partition part3 in dbs01,partition part4 in dbs04;就是說每個partition要有每個具體的名稱,如果沒有具體的名
稱的話,分片的名稱就是所在dbspace的名稱。預設情況下每個分片所在不同的dbspace,如果多個分片在一個dbspace中要給每個分片起不同的名字。
[@more@]
create table cell_fragment
(
id int,
name varchar(10)
)
FRAGMENT by EXPRESSION
(id > 5 and id < 10) IN niosdbs,
(id <= 5) IN tpddbs;
2、生成測試資料
insert into cell_fragment values(1,'1111');
insert into cell_fragment values(4,'44');
insert into cell_fragment values(8,'81111');
insert into cell_fragment values(9,'91111');
insert into cell_fragment values(2,'21111');
insert into cell_fragment values(3,'31111');
insert into cell_fragment values(10,'31111');
insert into cell_fragment values(16,'31111');
insert into cell_fragment values(19,'31111');
3、查詢系統表,定位tabid
select * from systables where tabname ='cell_fragment'
select * from SYSFRAGMENTS where tabid = 1539
4、每次操作後更新統計資訊
update statistics high for table cell_fragment
5、add detach attach modify init更改分片
alter fragment on table cell_fragment add (id >=10 and id <20) in nrmdbs;
alter fragment on table cell_fragment detach nrmdbs temp_nrmdbs;
alter fragment on table cell_fragment attach temp_nrmdbs as (id >=10 and id <20);
alter fragment on table cell_fragment add remainder in kpidbs;
alter fragment on table cell_fragment modify kpidbs01 to (id <3) in tpddbs;
alter fragment on table cell_fragment init fragment by expression
id <3 in nrmdbs,
id >=3 and id <5 in niosdbs,
id >=5 and id <10 in kpidbs,
remainder in tpddbs;
select * from temp_nrmdbs;
alter table cell_fragment add CONSTRAINT primary key(id);
總結
1、ids9.4尚不支援 partition by expression partition part1 (id > 5 and id < 10) IN niosdbs類似的操作;ids11已經提供了支援
2、partition part1 in dbs01,partion part2 in dbs03,partition part3 in dbs01,partition part4 in dbs04;就是說每個partition要有每個具體的名稱,如果沒有具體的名
稱的話,分片的名稱就是所在dbspace的名稱。預設情況下每個分片所在不同的dbspace,如果多個分片在一個dbspace中要給每個分片起不同的名字。
[@more@]
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70612/viewspace-1029359/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 表空間常見的操作
- 常見的DOM操作
- Centos 常見操作CentOS
- mysql常見操作MySql
- JS常見的字串操作JS字串
- informix 幾個常見問題對資料庫版本的要求ORM資料庫
- linux常見的操作(轉)Linux
- Linux 常見高危操作Linux
- UE常見快捷鍵操作
- Oracle redo log 常見操作Oracle Redo
- adb常見操作命令
- Linux 和 macos 常見的埠操作LinuxMac
- Fragment跳轉的騷操作Fragment
- JavaScript 陣列常見操作(一)JavaScript陣列
- JavaScript 陣列常見操作 (二)JavaScript陣列
- Linux 下 常見操作命令Linux
- selenium定位與常見操作
- Linux常見操作小結Linux
- 華為交換機常見QinQ操作
- Ceph常規操作及常見問題梳理
- 常見的大資料術語表大資料
- 10-C++實現棧的常見操作C++
- python檔案的常見的操作有哪些?Python
- 常見埠表彙總(轉)
- 為Oracle資料庫表建立自動增長序列及Oracle的常見操作Oracle資料庫
- 華為交換機常見STP/RSTP操作
- Python常見資料框操作①Python
- 日期函式以及常見的日期表達函式
- 在NodeJS中操作檔案常見的APINodeJSAPI
- selenium 常見方法和頁面元素的操作
- git 常見問題及操作方法Git
- ORACLE常見檢視和表整理Oracle
- 大資料常見術語表大資料
- MongoDB分片叢集常用操作MongoDB
- 關於Fragment可見與不可見時的生命週期Fragment
- js中陣列的一些常見操作 - 1JS陣列
- 常見問題--表的約束initially immediate 理解
- 說說你對集合的理解?常見的操作有哪些?