DBZ-3877 Improve subpartition support in Oracle DDL parser

This commit is contained in:
Chris Cranford 2021-08-18 14:21:47 -04:00 committed by Gunnar Morling
parent 680b6438f5
commit a402774e4c
3 changed files with 11 additions and 4 deletions

View File

@ -685,7 +685,7 @@ on_comp_partitioned_table
on_comp_partitioned_clause
: PARTITION partition_name?
(segment_attributes_clause | key_compression)*
UNUSABLE index_subpartition_clause?
UNUSABLE? index_subpartition_clause?
;
index_subpartition_clause
@ -1980,7 +1980,9 @@ hash_subparts_by_quantity
;
range_values_clause
: VALUES LESS THAN '(' literal (',' literal)* ')'
: VALUES LESS THAN
('(' literal (',' literal)* ')' |
'(' TIMESTAMP literal (',' TIMESTAMP literal)* ')')
;
list_values_clause
@ -2892,6 +2894,7 @@ substitutable_column_clause
partition_name
: regular_id
| DELIMITED_ID
;
supplemental_logging_props

View File

@ -13,4 +13,6 @@ ALTER TABLE sales split partition p5 into (Partition p6 values less than (1996),
ALTER TABLE sales truncate partition p5;
-- Alter table add unique index
alter table dbz1211 add constraint name unique (id,data) using index tablespace ts;
alter table dbz1211_child add constraint name unique (id) using index tablespace ts;
alter table dbz1211_child add constraint name unique (id) using index tablespace ts;
-- Alter table add primary key using index
ALTER TABLE "IDENTITYDB"."CHANGE_NUMBERS" ADD CONSTRAINT "IDX_CHANGENUMBERS_PK" PRIMARY KEY ("CHANGE_NO", "EXPIRY_TIME") USING INDEX "IDENTITYDB"."IDX_CHANGENUMBERS_PK" ENABLE NOVALIDATE;

View File

@ -8,6 +8,8 @@ create table dbz1211 (id number(38) not null, data varchar2(50), constraint name
CREATE TABLE "HR"."COUNTRIES"( "COUNTRY_ID" CHAR(2) CONSTRAINT "COUNTRY_ID_NN" NOT NULL ENABLE,"COUNTRY_NAME" VARCHAR2(40),"REGION_ID" NUMBER,CONSTRAINT "COUNTRY_C_ID_PK" PRIMARY KEY ("COUNTRY_ID") ENABLE,SUPPLEMENTAL LOG DATA (ALL) COLUMNS,CONSTRAINT "COUNTR_REG_FK" FOREIGN KEY ("REGION_ID")REFERENCES "HR"."REGIONS" ("REGION_ID") ENABLE) ORGANIZATION INDEX NOCOMPRESS;
CREATE TABLE "VELEBIT_ZAVAR_PROD"."PON_PRIJENOS" ("SIF_AGENCIJE" NUMBER DEFAULT 0 NOT NULL ENABLE, "DAT_PRIJENOSA" DATE NOT NULL ENABLE, "VRS_POLICE" NUMBER DEFAULT 0 NOT NULL ENABLE, "BR_ZAPRIMLJENIH" NUMBER DEFAULT 0, "BR_POLICIRANIH" NUMBER DEFAULT 0) SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 ROW STORE COMPRESS ADVANCED LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "TS_VELEBIT" PARALLEL 8 ;
create table eshp_auction_file_history (history_id number not null, history_date timestamp not null, auction_id number not null, changed_by varchar(4000), type varchar(4000) not null, constraint pk_eshp_auction_file_history primary key (history_id) using index (create unique index idx_eshp_auction_file_history_id on eshp_auction_file_history(history_id)), constraint fk_eshp_auc_file_history_auction foreign key (auction_id) references eshp_auction(auction_id) on delete cascade);
CREATE TABLE "IDENTITYDB"."CHANGE_NUMBERS" ( "CHANGE_NO" NUMBER(*,0) NOT NULL ENABLE, "SOURCE_INFO" VARCHAR2(128) NOT NULL ENABLE, "CHANGED_TIME" TIMESTAMP (6) DEFAULT SYSDATE, "ENTITY_TYPE" VARCHAR2(36) NOT NULL ENABLE, "ORGANIZATIONID" VARCHAR2(36), "PROCESSED" NUMBER(1,0) DEFAULT 1 NOT NULL ENABLE, "TRACKING_ID" VARCHAR2(256) NOT NULL ENABLE, "EXPIRY_TIME" TIMESTAMP (6), "ACTOR" VARCHAR2(36), "ENTITY_ID" VARCHAR2(36) ) PARTITION BY RANGE ("EXPIRY_TIME") INTERVAL (NUMTODSINTERVAL(7, 'DAY')) SUBPARTITION BY HASH ("CHANGE_NO") SUBPARTITIONS 16 (PARTITION "SYS_P44414" VALUES LESS THAN (TIMESTAMP' 2021-07-06 00:00:00') ( SUBPARTITION "SYS_SUBP44398" , SUBPARTITION "SYS_SUBP44399" , SUBPARTITION "SYS_SUBP44400" , SUBPARTITION "SYS_SUBP44401" , SUBPARTITION "SYS_SUBP44402" , SUBPARTITION "SYS_SUBP44403" , SUBPARTITION "SYS_SUBP44404" , SUBPARTITION "SYS_SUBP44405" , SUBPARTITION "SYS_SUBP44406" , SUBPARTITION "SYS_SUBP44407" , SUBPARTITION "SYS_SUBP44408" , SUBPARTITION "SYS_SUBP44409" , SUBPARTITION "SYS_SUBP44410" , SUBPARTITION "SYS_SUBP44411" , SUBPARTITION "SYS_SUBP44412" , SUBPARTITION "SYS_SUBP44413" ) );
-- Create index
create index hr.name on hr.table (id,data) tablespace ts;
create unique index idx_eshp_auction_file_history_id on eshp_auction_file_history(history_id);
create unique index idx_eshp_auction_file_history_id on eshp_auction_file_history(history_id);
CREATE UNIQUE INDEX "IDENTITYDB"."IDX_CHANGENUMBERS_PK" ON "IDENTITYDB"."CHANGE_NUMBERS" ("CHANGE_NO", "EXPIRY_TIME") LOCAL (PARTITION "SYS_P44414" NOCOMPRESS ( SUBPARTITION "SYS_SUBP44398" , SUBPARTITION "SYS_SUBP44399" , SUBPARTITION "SYS_SUBP44400" , SUBPARTITION "SYS_SUBP44401" , SUBPARTITION "SYS_SUBP44403" , SUBPARTITION "SYS_SUBP44404" , SUBPARTITION "SYS_SUBP44405" , SUBPARTITION "SYS_SUBP44406" , SUBPARTITION "SYS_SUBP44407" , SUBPARTITION "SYS_SUBP44408" , SUBPARTITION "SYS_SUBP44409" , SUBPARTITION "SYS_SUBP44410" , SUBPARTITION "SYS_SUBP44411" , SUBPARTITION "SYS_SUBP44412" , SUBPARTITION "SYS_SUBP44413" ) )