拆分Table 為Partition Table
---直接看例子
--drop table partt;
CREATE TABLE Partt
(logid number(*) NOT NULL,
name VARCHAR2(100),
lasterddl date)
select * from dba_objects where mod(object_id,10)=0
insert into partt select object_id,object_name,last_ddl_time from dba_objects where mod(object_id,10)=0
select * from partt order by logid
drop table sppartt
CREATE TABLE Sppartt
(logid number(*) NOT NULL,
name VARCHAR2(100),
lasterddl date)
partition by range(logid)
(
--PARTITION P0801 VALUES LESS THAN (1500),
--PARTITION P0901 VALUES LESS THAN (3000),
--PARTITION P1001 VALUES LESS THAN (5000),
PARTITION Pmax VALUES LESS THAN (MAXVALUE)
)
select * from Sppartt
select * from partt
alter table Sppartt exchange partition Pmax with table partt;
select count(*) from sppartt
select count(*) from partt
select count(*) from sppartt partition(pmax);
---拆分Partition Table 需要一個拆兩個,並且從大到小拆。
alter table sppartt split partition Pmax AT (5000) into (partition P1001,partition pmax);
select count(*) from sppartt partition(P1001)
select count(*) from sppartt partition(pmax)
alter table sppartt split partition P1001 AT (3000) into (partition P0901,partition P1001);
select count(*) from sppartt partition(P0901)
select count(*) from sppartt partition(P1001)
alter table sppartt split partition P0901 AT (1500) into (partition P0801,partition P0901);
select count(*) from sppartt partition(P0801)
select count(*) from sppartt partition(P0901)
select * from dba_objects where object_name=upper('sppartt')
select * from v$tablespace
TS_LIS2
TS_LIS3
TS_LIS1
---move partition table 到不同的Tablespace
alter table sppartt move partition p0801 tablespace ts_lis1;
alter table sppartt move partition p0901 tablespace ts_lis2;
alter table sppartt move partition p1001 tablespace ts_lis3;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/34596/viewspace-614977/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20191203]enq: ZA - add std audit table partition.txtENQ
- TiDB 原始碼閱讀系列文章(二十)Table PartitionTiDB原始碼
- ext4 lvreduce報錯superblock or the partition table is likely to be corruptVRBloC
- create table,show tables,describe table,DROP TABLE,ALTER TABLE ,怎麼使用?
- 今天測試了一下update partition table的part key
- ESP32 編譯報錯 57) boot: no bootable app partitions in the partition table編譯bootAPP
- table
- MySQL:Analyze table導致'waiting for table flush'MySqlAI
- 教你解決ghost win10開機出現invalid partition table的方法Win10
- Sparse Table
- MySQL:Table_open_cache_hits/Table_open_cache_misses/Table_open_cache_overflowsMySql
- JavaScript動態為table表格新增行JavaScript
- SQLAlchemy Table(表)類方式 – Table類和Column類SQL
- layui將table轉化表單顯示(即table.render轉為表單展示)UI
- Oracle table selectOracle
- Oracle:TABLE MONITORINGOracle
- audit by user by table
- jquery-tablejQuery
- flink table apiAPI
- table寬度
- Lua table(表)
- bootsrap table 表格載入完整 post-body.bs.tableboot
- sap table 分為三種型別(轉)型別
- 利用poi將Html中table轉為ExcelHTMLExcel
- [20200214]Printing all table preferences affecting dbms_stats.gather_table_stats
- el-table高亮
- Html DOM操作TABLEHTML
- a-table 設定
- 7.68 CUBE_TABLE
- MySQL table into a golang strucMySqlGolang
- HashMap、Hash Table、ConcurrentHashMapHashMap
- CSS table表格美化CSS
- SAP APO 常用Table
- [6 kyu] Multiplication table
- GLOBAL TEMPORARY TABLE(轉)
- oracle cache table(轉)Oracle
- tpextbuilder- Table 表格UI
- vertica解鎖table
- truncate table (tablename )表明