从默认子分区移动值
Moving values from default subpartition
在 oracle 19c 数据库中,在一个键值上 table 我已经在加载时间戳上定义了一个分区,在自定义列集上定义了子分区。
create table mytable
(
load_Dts timestamp(6) not null,
segment VARCHAR2(4000),
field_ident VARCHAR2(4000),
value VARCHAR2(4000)
)
partition by list (LOAD_DTS) AUTOMATIC
SUBPARTITION by LIST (FIELD_IDENT)
SUBPARTITION template
(
SUBPARTITION G VALUES ('GD161','GD171'),
SUBPARTITION M VALUES ('MD020','MD031'),
SUBPARTITION OTH VALUES (DEFAULT)
)
(
partition P0 values (NULL)
);
这导致例如分区 SYS_P242603 子分区 SYS_P242603_G、SYS_P242603_M 和 SYS_P242603_OTH。
如何移动新属性,例如存储在默认子分区SYS_P242603_OTH中的GD100到子分区SYS_P242603_G?
我已经相应地更改了子分区模板并尝试将值 GD100 从 SYS_P242603_OTH 中拆分出来(想稍后将其合并到 SYS_P242603_G)但没有成功 - 它抛出 ORA -14400 错误。
ALTER TABLE mytable SPLIT SUBPARTITION SYS_P242603_OTH VALUES ('GD100') INTO
( SUBPARTITION SYS_P242603_G_TEMP ,
SUBPARTITION SYS_P242603_OTH
)
ONLINE;
列表按时间戳分区???
SQL> create table mytable(
2 load_dts timestamp(6) not null,
3 segment VARCHAR2(4000),
4 field_ident VARCHAR2(4000),
5 value VARCHAR2(4000)
6 )
7 partition by list (load_dts) automatic
8 subpartition by list (field_ident)
9 subpartition template(
10 subpartition g values ('GD161','GD171'),
11 subpartition m values ('MD020','MD031'),
12 subpartition oth values (DEFAULT)
13 )
14 (
15 partition p0 values (null)
16 )
17 /
Table created.
SQL> alter table mytable
2 set subpartition template(
3 subpartition g values ('GD161','GD171'),
4 subpartition m values ('MD020','MD031'),
5 subpartition g1 values ('GD100'),
6 subpartition oth values (DEFAULT)
7 )
8 /
Table altered.
SQL> alter table mytable
2 split subpartition p0_oth
3 values('GD100')
4 into(
5 subpartition g1,
6 subpartition oth
7 )
8 /
Table altered.
SQL> select partition_name,
2 subpartition_name,
3 high_value
4 from user_tab_subpartitions
5 where table_name = 'MYTABLE'
6 order by subpartition_position
7 /
PARTITION_NAME SUBPARTITION_NAME HIGH_VALUE
-------------- ----------------- --------------------
P0 P0_G 'GD161', 'GD171'
P0 P0_M 'MD020', 'MD031'
P0 G1 'GD100'
P0 OTH DEFAULT
在 oracle 19c 数据库中,在一个键值上 table 我已经在加载时间戳上定义了一个分区,在自定义列集上定义了子分区。
create table mytable
(
load_Dts timestamp(6) not null,
segment VARCHAR2(4000),
field_ident VARCHAR2(4000),
value VARCHAR2(4000)
)
partition by list (LOAD_DTS) AUTOMATIC
SUBPARTITION by LIST (FIELD_IDENT)
SUBPARTITION template
(
SUBPARTITION G VALUES ('GD161','GD171'),
SUBPARTITION M VALUES ('MD020','MD031'),
SUBPARTITION OTH VALUES (DEFAULT)
)
(
partition P0 values (NULL)
);
这导致例如分区 SYS_P242603 子分区 SYS_P242603_G、SYS_P242603_M 和 SYS_P242603_OTH。
如何移动新属性,例如存储在默认子分区SYS_P242603_OTH中的GD100到子分区SYS_P242603_G?
我已经相应地更改了子分区模板并尝试将值 GD100 从 SYS_P242603_OTH 中拆分出来(想稍后将其合并到 SYS_P242603_G)但没有成功 - 它抛出 ORA -14400 错误。
ALTER TABLE mytable SPLIT SUBPARTITION SYS_P242603_OTH VALUES ('GD100') INTO
( SUBPARTITION SYS_P242603_G_TEMP ,
SUBPARTITION SYS_P242603_OTH
)
ONLINE;
列表按时间戳分区???
SQL> create table mytable(
2 load_dts timestamp(6) not null,
3 segment VARCHAR2(4000),
4 field_ident VARCHAR2(4000),
5 value VARCHAR2(4000)
6 )
7 partition by list (load_dts) automatic
8 subpartition by list (field_ident)
9 subpartition template(
10 subpartition g values ('GD161','GD171'),
11 subpartition m values ('MD020','MD031'),
12 subpartition oth values (DEFAULT)
13 )
14 (
15 partition p0 values (null)
16 )
17 /
Table created.
SQL> alter table mytable
2 set subpartition template(
3 subpartition g values ('GD161','GD171'),
4 subpartition m values ('MD020','MD031'),
5 subpartition g1 values ('GD100'),
6 subpartition oth values (DEFAULT)
7 )
8 /
Table altered.
SQL> alter table mytable
2 split subpartition p0_oth
3 values('GD100')
4 into(
5 subpartition g1,
6 subpartition oth
7 )
8 /
Table altered.
SQL> select partition_name,
2 subpartition_name,
3 high_value
4 from user_tab_subpartitions
5 where table_name = 'MYTABLE'
6 order by subpartition_position
7 /
PARTITION_NAME SUBPARTITION_NAME HIGH_VALUE
-------------- ----------------- --------------------
P0 P0_G 'GD161', 'GD171'
P0 P0_M 'MD020', 'MD031'
P0 G1 'GD100'
P0 OTH DEFAULT