Splitting Partitions (Chunks)
Do the following steps to split chunks in a directory-based distributed database.
-
Invoke the
DBMS_SHARDING_DIRECTORYPL/SQL APIflagKeyForSplitto mark keys for splitting.PROCEDURE flagKeyForSplit (schema_name IN varchar2, -- root table schema name root_table IN varchar2, -- root table name key … ) -- shard key column valuesNote that the key column values need to be in the same order as specified in the
CREATE TABLEstatement with the correct types. The procedure can only succeed if the provided key exists in the directory. -
Issue the partition split DDL.
ALTER TABLE customers SPLIT PARTITION p1 INTO ( PARTITION p1 TABLESPACE tb1, PARTITION p3 TABLESPACE tb3 ) UPDATE INDEXES;Note that, in directory-based data distribution, a partition can be split into only two partitions at a time.
This operation will go through all of the keys that have been marked for split in the directory and split the corresponding data out into the new partition.