Oracle大資料表的分表處理

來源:互聯網
上載者:User

標籤:ble   ora   rac   建立   number   logs   分數   不同的   nbsp   

1.首先給大資料表建立rownum序號

--增加序號欄位alter table TEST add xlh number;--以數列填滿號update TEST set xlh = rownum;

2.通過xlh欄位進行分資料到不同的表中(以建表的方式進行處理)

create table hik_1001 as select clm1 as hik_clm1,clm2 as hik_clm2,clm3 as hik_clm3 from TEST where   xlh>=1 and xlh <=5000000;create table hik_1002 as select clm1 as hik_clm1,clm2 as hik_clm2,clm3 as hik_clm3 from TEST where   xlh>=5000001 and xlh <=10000000;create table hik_1003 as select clm1 as hik_clm1,clm2 as hik_clm2,clm3 as hik_clm3 from TEST where   xlh>=10000001 and xlh <=15000000;create table hik_1004 as select clm1 as hik_clm1,clm2 as hik_clm2,clm3 as hik_clm3 from TEST where   xlh>=15000001;

3.給建立的表分別建立主鍵或者索引

create index hik_1001_index on HIK_1001  (HIK_CLM2)alter table HIK_1001  add constraint HIK_1001_PKEY primary key (HIK_CLM1)

如果資料有重複的話,只需要建立索引就可以.

4.然後對分表後的資料進行處理

 

Oracle大資料表的分表處理

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.