達夢普通錶轉成分區表

1.創建測試表:
SQL> create table test (id int,name varchar(20));
SQL> begin
for i in 1..10000 loop
insert into test values (i,'aa'||i);
commit;
end loop;
end;
/

2.導出數據:
[dmdba@localhost ~]$ dexp sysdba/SYSDBA file=/dm7/test.dmp tables=test

3.刪除非分區表:
SQL> drop table test;

4.創建分區表:
create table test (
id int,
name varchar(20)
)
partition by range (id)(
partition p1 values less than (200),
partition p2 values less than (400),
partition p3 values less than (600),
partition p4 values less than (maxvalue) ) ;

5.導入數據:
[dmdba@localhost ~]$ dimp sysdba/SYSDBA file=/dm7/test.dmp tables=test ignore=y

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章