Oracle Partition Table Learning

Source: Internet
Author: User


SQL code -- Create table (create partition table) Create table BILL_MONTHFEE_ZERO (www.2cto.com SERV_ID NUMBER (20) not null, BILLING_CYCLE_MONTH NUMBER (6) not null, DATE_TYPE NUMBER (1 ), ACC_NBR VARCHAR2 (80) partition by range (partition) (partition p_200407 values less than (200407) tablespace TS_ZIKEN storage (initial 100 k next 100 k minextents 1 maxextents unlimited pctincrease 0 ), partition p_200408 values less than (200408) tablespace TS_ZIKEN storage (initial 100 k next 100 k minextents 1 maxextents unlimited pctincrease 0); create index Statement on bill_monthfee_zero (billing_cycle_month) tablespace TS_ZIKEN_idx storage (initial 100 k next 100 k minextents 1 maxextents unlimited pctincrease 0) nologging; grant all on bill_monthfee_zero to dxsq_dev; -- add the Partition table alter table BILL_MONTHFEE_ZERO add Partition p_200409 values less than (200409) tablespace ts_ziken; -- delete a Partition alter table part_tbl drop Partition part_tbl_08; -- divide a Partition into two partitions: alter table bill_monthfee_zero split Partition p_200409 at (200409) into (Partition p_200409_1 tablespace ts_ziken, www.2cto.com Partition p_200409table_2 space Partition ); -- MERGE partition alter table bill_monthfee_zero merge partitions p_200408, p_200409 into partition p_all -- rename Partition alter table Partition rename PARTITION p_200408 to p_fee_200408 -- change Partition to tablespace alter table Partition move PARTITION p_200409 tablespace ts_ziken_01 nologging -- Query select count (*) from partition (p_200407); -- add data insert into partition select * from partition (p_200407) -- export userid = dxsq/teledoone @ partition buffer = 102400 www.2cto.com tables = bill_month.pdf: p_200401, file = E: \ exp_para \ pailog = E: \ exp_para \ exp_dxsq_tables.log tips: delete a field in the table: alter table bill_monthfee_zero set unused column date_type; add a field: alter table bill_monthfee_zero add date_type number (1); Author: liu9403

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.