Oracle 普通table 轉換為partition table
1.建立eg table
SQL> create table pp (id int,dt date);
Table created.
SQL> create index pp_index on pp(id);
index created.
begin
for i in 1..10000000 loop
if mod(i,3)=1 then
insert into pp values(i,to_date('2013/6/6','yyyy/mm/dd'));
elsif mod(i,3)=2 then
insert into pp values(i,to_date('2014/6/6','yyyy/mm/dd'));
else
insert into pp values(i,to_date('2015/5/5','yyyy/mm/dd'));
end if;
end loop;
commit;
end;
/
現在將pp錶轉換為partition table.
2.create partition table
SQL> edit
Wrote file afiedt.buf
1 create table pp_copy
2 (id int,dt date)
3 partition by range(dt)
4 (partition p1 values less than(to_date('2014/01/01','yyyy/mm/dd')) tablespace users,
5 partition p2 values less than(to_date('2015/01/01','yyyy/mm/dd')) tablespace users,
6 partition p3 values less than(to_date('2016/01/01','yyyy/mm/dd')) tablespace users,
7* partition p4 values less than(maxvalue) tablespace users)
SQL> /
SQL> insert into pp_copy select * from pp;
10000000 rows created.
SQL> commit;
Commit complete.
SQL> drop table pp purge;
Table dropped.
SQL> alter table pp_copy rename to pp;
Table altered.
SQL> create index pp_index on pp(id) tablespace users local;
Index created.
如果有package,procedure,view則需要重新編譯。
alter package package_name compile;
alter procedure procedure_name compile;
alter view view_name compile;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24237320/viewspace-1852252/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle cache table(轉)Oracle
- Oracle Pipelined Table(轉)Oracle
- Oracle Pipelined Table Functions(轉)OracleFunction
- Oracle 12.2之後ALTER TABLE .. MODIFY轉換非分割槽表為分割槽表Oracle
- Oracle:TABLE MONITORINGOracle
- Oracle table selectOracle
- TiDB 原始碼閱讀系列文章(二十)Table PartitionTiDB原始碼
- [20191203]enq: ZA - add std audit table partition.txtENQ
- layui將table轉化表單顯示(即table.render轉為表單展示)UI
- GLOBAL TEMPORARY TABLE(轉)
- ext4 lvreduce報錯superblock or the partition table is likely to be corruptVRBloC
- 利用poi將Html中table轉為ExcelHTMLExcel
- sap table 分為三種型別(轉)型別
- create table,show tables,describe table,DROP TABLE,ALTER TABLE ,怎麼使用?
- 今天測試了一下update partition table的part key
- Oracle Table建立引數說明Oracle
- Analyze table對Oracle效能的提升Oracle
- Oracle cluster table(1)_概念介紹Oracle
- ORACLE _small_table_threshold與eventOracle
- TableTools Export Excel前Table內容格式的轉換應用ExportExcel
- ESP32 編譯報錯 57) boot: no bootable app partitions in the partition table編譯bootAPP
- use azure data studio to create external table for oracleOracle
- 【TABLE】Oracle表資訊收集指令碼Oracle指令碼
- 深入解析 oracle drop table內部原理Oracle
- table
- LightDB 22.4 新特性之相容Oracle線上轉換普通表為分割槽表Oracle
- Oracle 19c Concepts(02):Tables and Table ClustersOracle
- 14_深入解析Oracle table cluster結構Oracle
- 教你解決ghost win10開機出現invalid partition table的方法Win10
- MySQL:Analyze table導致'waiting for table flush'MySqlAI
- oracle truncate table recover(oracle 如何拯救誤操作truncate的表)Oracle
- Sparse Table
- 有關oracle external table的一點測試。Oracle
- 【TABLE】Oracle監控異常的表設計Oracle
- oracle 19c 無法create table解決Oracle
- MySQL:Table_open_cache_hits/Table_open_cache_misses/Table_open_cache_overflowsMySql
- flink stream轉table POJO物件遇到的坑POJO物件
- [20220610][轉載]Is my table marked for archive.txtHive
- jQuery table表格隔行換色程式碼例項jQuery