S
S
Serg4452019-11-07 12:39:39
Oracle
Serg445, 2019-11-07 12:39:39

How to properly change table partitioning in Oracle?

Good afternoon!
Prompt a correct way of change of partitioning.
There is a table in which partitions and subpartitions are created. Partitions and subpartitions are created by list. It is necessary to change partitions and subpartitions for other fields.
For example:

CREATE TABLE TAB1
(
ID VARCHAR2(36 BYTE) NOT NULL,
TYPE VARCHAR2(10 BYTE) NOT NULL,
YEAR VARCHAR2(4 BYTE) NOT NULL
)
PARTITION BY LIST (TYPE)
SUBPARTITION BY LIST (YEAR)

You need to do this:
CREATE TABLE TAB1
(
ID VARCHAR2(36 BYTE) NOT NULL,
TYPE VARCHAR2(10 BYTE) NOT NULL,
YEAR VARCHAR2(4 BYTE) NOT NULL
)
PARTITION BY LIST (YEAR)
SUBPARTITION BY LIST (TYPE)

that is, it is necessary to "swap" partitions with subpartitions

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
duhbox, 2019-11-07
@duhbox

You can use the DBMS_REDEFINITION package and pour the data into a new partitioned table.
https://docs.oracle.com/database/121/ARPLS/d_redef...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question