The TRIGGER_PARTITION_BALANCE procedure is used 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 in seconds for the background partition balancing task.
Considerations
- You can call this system package only in a user tenant. If you call it in the sys tenant, an error
OB_OP_NOT_ALLOWis returned. - If the tenant-level parameter
enable_rebalanceorenable_transferis disabled, an errorOB_OP_NOT_ALLOWis returned when you manually trigger partition balancing. - If another partition balancing task is in progress, an error
OB_OP_NOT_ALLOWis returned. You must wait for the current task to complete before you can trigger another partition balancing task. - If the current tenant has already been partition balanced, an error
OB_PARTITION_ALREADY_BALANCEDis returned.
Examples
Trigger a partition balancing task. The background partition balancing task will run until it is completed.
obclient> BEGIN DBMS_BALANCE.TRIGGER_PARTITION_BALANCE(); END;Trigger a partition balancing task. The background partition balancing task will run for a maximum of 2 hours. If it is not completed within 2 hours, the task will be canceled.
obclient> BEGIN DBMS_BALANCE.TRIGGER_PARTITION_BALANCE(7200); END;