The TRIGGER_PARTITION_BALANCE procedure allows you to manually trigger partition balancing.
Syntax
DBMS_BALANCE.TRIGGER_PARTITION_BALANCE(balance_timeout BINARY_INTEGER DEFAULT NULL);
Parameters
The balance_timeout parameter specifies the timeout period for a partition balancing job in the background, in seconds.
Considerations
- You can use this procedure only in a user tenant. If you use it in the sys tenant, the
OB_OP_NOT_ALLOWerror will be returned. - If you call this procedure when either of the tenant-level parameters
enable_rebalanceandenable_transferis set toFalse, theOB_OP_NOT_ALLOWerror is returned, indicating that you cannot manually trigger partition balancing. - If you call this procedure when another partition balancing job is in progress, the
OB_OP_NOT_ALLOWerror is returned, prompting you to try again after the current partition balancing job is completed. - If you call this procedure when partition balancing is already achieved for the current tenant, the
OB_PARTITION_ALREADY_BALANCEDerror is returned.
Examples
Manually trigger a partition balancing job that will not time out in the background.
obclient> BEGIN DBMS_BALANCE.TRIGGER_PARTITION_BALANCE(); END;Manually trigger a partition balancing job that runs for at most 2 hours in the background. If the partition balancing job is not completed within 2 hours, it times out and is canceled.
obclient> BEGIN DBMS_BALANCE.TRIGGER_PARTITION_BALANCE(7200); END;