LightDB 22.4 新特性之相容Oracle線上轉換普通表為分割槽表
Oracle 11G可以使用線上重定義進行非分割槽錶轉換為分割槽表(Online Redefinition),在Oracle 12C的新特性中,可線上將非分割槽錶轉換為分割槽表,同樣,LightDB實現了此特性:
建立測試表emp2,並且在emp2上建立索引
lightdb@test=# create table emp2 as select * from emp; CREATE TABLE lightdb@test=# create index i_emp2_name on emp2(ename); CREATE INDEX lightdb@test=# create index i_emp2_empno on emp2(empno); CREATE INDEX
測試語句執行語句如下:
lightdb@test=# alter table emp2 modify lightdb@test-# partition by range (HIREDATE) lightdb@test-# ( lightdb@test(# partition part_1980 values less than (to_date('1980','yyyy')), lightdb@test(# partition part_1981 values less than (to_date('1981','yyyy')), lightdb@test(# partition part_1982 values less than (to_date('1982','yyyy')), lightdb@test(# partition part_1983 values less than (to_date('1983','yyyy')), lightdb@test(# partition part_1984 values less than (to_date('1984','yyyy')), lightdb@test(# partition part_1985 values less than (to_date('1985','yyyy')), lightdb@test(# partition part_1986 values less than (to_date('1986','yyyy')), lightdb@test(# partition part_1987 values less than (to_date('1987','yyyy')), lightdb@test(# partition part_1988 values less than (to_date('1988','yyyy')) lightdb@test(# ) online lightdb@test-# update indexes lightdb@test-# ( i_emp2_name GLOBAL, lightdb@test(# i_emp2_empno local lightdb@test(# ); ALTER TABLE
然後我們檢視轉換後的表DDL語句
lightdb@test=# \d+ emp2 Partitioned table "public.emp2" Column | Type | Collation | Nullable | Default | Storage | Stats target | Description ----------+---------------+-----------+----------+---------+---------+--------------+------------- empno | numeric(4,0) | | | | main | | ename | varchar2(20) | | | | plain | | job | varchar2(9) | | | | plain | | mgr | numeric(4,0) | | | | main | | hiredate | date | | | | plain | | sal | numeric(7,2) | | | | main | | comm | numeric(7,2) | | | | main | | deptno | numeric(2,0) | | | | main | | dname | varchar2(100) | | | | plain | | Partition key: RANGE (hiredate) Indexes: "i_emp2_empno" btree (empno) "i_emp2_name" btree (ename) Partitions: part_1980 FOR VALUES FROM (MINVALUE) TO ('1980-01-01'), part_1981 FOR VALUES FROM ('1980-01-01') TO ('1981-01-01'), part_1982 FOR VALUES FROM ('1981-01-01') TO ('1982-01-01'), part_1983 FOR VALUES FROM ('1982-01-01') TO ('1983-01-01'), part_1984 FOR VALUES FROM ('1983-01-01') TO ('1984-01-01'), part_1985 FOR VALUES FROM ('1984-01-01') TO ('1985-01-01'), part_1986 FOR VALUES FROM ('1985-01-01') TO ('1986-01-01'), part_1987 FOR VALUES FROM ('1986-01-01') TO ('1987-01-01'), part_1988 FOR VALUES FROM ('1987-01-01') TO ('1988-01-01')
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29990276/viewspace-2929688/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- LightDB 22.4 新特性之相容Oracle sqluldr2OracleSQL
- Oracle 12C新特性-線上把非分割槽錶轉為分割槽表Oracle
- LightDB 22.4 新特性之相容Oracle樹形查詢Oracle
- Oracle 12.2之後ALTER TABLE .. MODIFY轉換非分割槽表為分割槽表Oracle
- LightDB 22.4 新特性之完全相容Oracle varchar2資料型別Oracle資料型別
- 線上重定義與普通表改為分割槽表
- oracle 普通表-分割槽表改造流程Oracle
- oracle 線上重新定義,普通表改變分割槽表,分割槽表可以更改型別、分割槽欄位等Oracle型別
- ORACLE 19c 新特性之混合分割槽表Oracle
- PG的非分割槽表線上轉分割槽表
- 線上重定義方式將普通表修改為分割槽表
- PostgreSQL/LightDB 分割槽表之分割槽裁剪SQL
- oracle 19C新特性——混合分割槽表Oracle
- 線上重定義的操作步驟__普通錶轉換為分割槽表的實驗案例
- 【ASK_ORACLE】使用insert語句將普通錶轉換成分割槽表Oracle
- LightDB 22.4 新特性之支援Oracle cardinality和ordered_predicates hintOracle
- oracle將表配置為分割槽表Oracle
- 非分割槽錶轉換成分割槽表
- PostgreSQL/LightDB分割槽表之常見問題SQL
- MySQL線上轉分割槽表(以及TiDB)MySqlTiDB
- oracle分割槽表和分割槽表exchangeOracle
- oracle分割槽表和非分割槽表exchangeOracle
- LightDB 23.1相容Oracle新特性支援Oracle
- 指令碼:線上重定義,從普通表到分割槽表,redefinition_table.sh指令碼
- oracle 分割槽表move和包含分割槽表的lob moveOracle
- 非分割槽錶轉換成分割槽表以及注意事項
- [oracle] expdp 匯出分割槽表的分割槽Oracle
- ORACLE分割槽表梳理系列Oracle
- Oracle分割槽表基礎運維-04列表分割槽Oracle運維
- Oracle分割槽表基礎運維-07增加分割槽(3列表分割槽)Oracle運維
- Oracle分割槽表基礎運維-06分割槽表索引Oracle運維索引
- Oracle分割槽表基礎運維-01分割槽表分類Oracle運維
- Oracle分割槽表基礎運維-09刪除分割槽Oracle運維
- Oracle分割槽表基礎運維-05組合分割槽Oracle運維
- Oracle分割槽表基礎運維-02範圍分割槽Oracle運維
- Oracle分割槽表基礎運維-03HASH分割槽Oracle運維
- Oracle SQL調優之分割槽表OracleSQL
- 對oracle分割槽表的理解整理Oracle