日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

oracle分区表学习及应用

發布時間:2025/3/15 编程问答 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 oracle分区表学习及应用 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

?????oracle分區表學習及應用

-- Create table(創建分區表)
create table BILL_MONTHFEE_ZERO
(
? SERV_ID???????????? NUMBER(20) not null,
? BILLING_CYCLE_MONTH NUMBER(6) not null,
? DATE_TYPE?????????? NUMBER(1),
? ACC_NBR???????????? VARCHAR2(80)
)
?partition by range (BILLING_CYCLE_MONTH)
? (partition p_200407 values less than (200407)
??? tablespace TS_ZIKEN
????? storage(initial 100k next 100k minextents 1 maxextents unlimited pctincrease 0),
?? partition p_200408 values less than (200408)
??? tablespace TS_ZIKEN
????? storage(initial 100k next 100k minextents 1 maxextents unlimited pctincrease 0))
????? ;
create index idx_bill_monthfee_zero_idx01 on bill_monthfee_zero(billing_cycle_month)
tablespace TS_ZIKEN_idx
storage(initial 100k next 100k minextents 1 maxextents unlimited pctincrease 0) nologging;
grant all on bill_monthfee_zero to dxsq_dev;

--增加分區表

alter table BILL_MONTHFEE_ZERO add Partition p_200409
values less than (200409) tablespace ts_ziken;


--
刪除一分區
alter table part_tbl drop Partition part_tbl_08;

--將一個分區分為兩個分區
alter table bill_monthfee_zero split Partition p_200409 at (200409)
into (Partition p_200409_1 tablespace ts_ziken,
Partition p_200409_2 tablespace ts_ziken_idx);

--合并分區
ALTERTABLE?bill_monthfee_zero
??
MERGE PARTITIONS p_200408, p_200409 INTOPARTITION p_all

--將分區改名

altertable?bill_monthfee_zero rename Partition?p_200408 to p_fee_200408

--將分區改表空間

altertable?bill_monthfee_zero move Partition p_200409
tablespace?ts_ziken_01 nologging

--查詢特定分區
select count(*) from BILL_MONTHFEE_ZERO partition (p_200407);

--添加數據
insert into bill_monthfee_zero select * from bill_monthfee_zero partition (p_200407)

--分區表的導出

userid=dxsq/teledoone@jndxsq154
buffer=102400
tables=bill_monthfee:P_200401,
file=E:"exp_para"exp_dxsq_tables.dmp
log=E:"exp_para"exp_dxsq_tables.log

技巧:

刪除表中一個字段:

alter table bill_monthfee_zero set unused column date_type;

添加一個字段:alter table bill_monthfee_zero add date_type number(1);

轉載于:https://www.cnblogs.com/jimeper/archive/2007/08/31/877776.html

總結

以上是生活随笔為你收集整理的oracle分区表学习及应用的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。