After a partition balancing task is completed, you can view the task execution history in the view.
View the background partition balancing task history as the sys tenant
Log in to the
systenant of the cluster as therootuser.The following is a connection example. Adjust the connection details according to your actual environment when connecting to the database.
obclient -h10.xx.xx.xx -P2883 -uroot@sys#obdemo -p***** -AExecute the following statement to view the partition balancing task history in the background for the specified tenant.
View the partition balancing task history in the background for the specified tenant.
The
CDB_OB_BALANCE_JOB_HISTORYview displays the macro-level balance tasks for all tenants, including scaling out, scaling in, migration balancing, and partition balancing.obclient(root@sys)[oceanbase]> SELECT * FROM oceanbase.CDB_OB_BALANCE_JOB_HISTORY WHERE TENANT_ID = 1002 AND JOB_TYPE = 'PARTITION_BALANCE';The query result is as follows:
+-----------+--------+----------------------------+----------------------------+---------------------------------+-------------------+-----------------+-------------------------+-----------+---------+--------------+--------------------+----------------------------------------------------------------------------------------------+ | TENANT_ID | JOB_ID | CREATE_TIME | FINISH_TIME | BALANCE_STRATEGY | JOB_TYPE | TARGET_UNIT_NUM | TARGET_PRIMARY_ZONE_NUM | STATUS | COMMENT | MAX_END_TIME | ZONE_UNIT_NUM_LIST | PARAMETER_LIST | +-----------+--------+----------------------------+----------------------------+---------------------------------+-------------------+-----------------+-------------------------+-----------+---------+--------------+--------------------+----------------------------------------------------------------------------------------------+ | 1002 | 312280 | 2024-06-14 11:00:49.034035 | 2024-06-14 11:01:04.528871 | partition attribution alignment | PARTITION_BALANCE | NULL | 1 | COMPLETED | NULL | NULL | zone1:1 | ls_scale_out_factor:1,enable_rebalance:true,enable_transfer:true,enable_gts_standalone:false | +-----------+--------+----------------------------+----------------------------+---------------------------------+-------------------+-----------------+-------------------------+-----------+---------+--------------+--------------------+----------------------------------------------------------------------------------------------+ 1 row in setFor more information about the fields in the
CDB_OB_BALANCE_JOB_HISTORYview, see CDB_OB_BALANCE_JOB_HISTORY.View the log stream-level partition balancing task history for the specified tenant.
The
CDB_OB_BALANCE_TASK_HISTORYview displays all log stream-level tasks for all tenants, including log stream split (LS_SPLIT), log stream merge (LS_MERGE), log stream transfer (LS_TRANSFER), and log stream attribute modification (LS_ALTER).obclient(root@sys)[oceanbase]> SELECT * FROM oceanbase.CDB_OB_BALANCE_TASK_HISTORY WHERE TENANT_ID = 1002 AND BALANCE_STRATEGY LIKE '%partition%';The query result is as follows:
+-----------+---------+----------------------------+----------------------------+-------------+--------+---------+-----------+--------------------+------------+---------------------+-------------+-----------+-------------+------------+--------------------------+--------+---------+---------------------------------+ | TENANT_ID | TASK_ID | CREATE_TIME | FINISH_TIME | TASK_TYPE | SRC_LS | DEST_LS | PART_LIST | FINISHED_PART_LIST | PART_COUNT | FINISHED_PART_COUNT | LS_GROUP_ID | STATUS | PARENT_LIST | CHILD_LIST | CURRENT_TRANSFER_TASK_ID | JOB_ID | COMMENT | BALANCE_STRATEGY | +-----------+---------+----------------------------+----------------------------+-------------+--------+---------+-----------+--------------------+------------+---------------------+-------------+-----------+-------------+------------+--------------------------+--------+---------+---------------------------------+ | 1002 | 312281 | 2024-06-14 11:00:49.036806 | 2024-06-14 11:00:50.416084 | LS_ALTER | 1002 | -1 | NULL | NULL | 0 | 0 | 1001 | COMPLETED | NULL | 312282 | -1 | 312280 | NULL | partition attribution alignment | | 1002 | 312282 | 2024-06-14 11:00:49.038509 | 2024-06-14 11:00:54.460059 | LS_TRANSFER | 1002 | 1001 | NULL | 500129:500129 | 0 | 1 | 1001 | COMPLETED | NULL | 312283 | -1 | 312280 | NULL | partition attribution alignment | | 1002 | 312283 | 2024-06-14 11:00:49.038509 | 2024-06-14 11:00:56.470614 | LS_ALTER | 1002 | -1 | NULL | NULL | 0 | 0 | 0 | COMPLETED | NULL | NULL | -1 | 312280 | NULL | partition attribution alignment | +-----------+---------+----------------------------+----------------------------+-------------+--------+---------+-----------+--------------------+------------+---------------------+-------------+-----------+-------------+------------+--------------------------+--------+---------+---------------------------------+ 3 rows in setFor more information about the fields in the
CDB_OB_BALANCE_TASK_HISTORYview, see CDB_OB_BALANCE_TASK_HISTORY.View the tablet-level partition balancing task history for the specified tenant.
The
CDB_OB_TRANSFER_TASK_HISTORYview displays all tablet-level tasks for all tenants, showing which partitions and Tablets of each tenant are involved in the transfer operation.obclient(root@sys)[oceanbase]> SELECT * FROM oceanbase.CDB_OB_TRANSFER_TASK_HISTORY WHERE TENANT_ID = 1002;The query result is as follows:
+-----------+---------+----------------------------+----------------------------+--------+---------+---------------+------------+---------------------+-------------------------+------------------------+--------------------------------------------------------------------------------------------------+--------------+---------------------+---------------------+-----------+-----------------------------------+--------+-----------------+---------------------+---------+ | TENANT_ID | TASK_ID | CREATE_TIME | FINISH_TIME | SRC_LS | DEST_LS | PART_LIST | PART_COUNT | NOT_EXIST_PART_LIST | LOCK_CONFLICT_PART_LIST | TABLE_LOCK_TABLET_LIST | TABLET_LIST | TABLET_COUNT | START_SCN | FINISH_SCN | STATUS | TRACE_ID | RESULT | BALANCE_TASK_ID | TABLE_LOCK_OWNER_ID | COMMENT | +-----------+---------+----------------------------+----------------------------+--------+---------+---------------+------------+---------------------+-------------------------+------------------------+--------------------------------------------------------------------------------------------------+--------------+---------------------+---------------------+-----------+-----------------------------------+--------+-----------------+---------------------+---------+ | 1002 | 1 | 2024-06-14 11:00:52.439818 | 2024-06-14 11:00:53.780044 | 1002 | 1001 | 500129:500129 | 1 | NULL | NULL | NULL | 200070:0,1152921504606847005:0,1152921504606847006:0,1152921504606847007:0,1152921504606847008:0 | 5 | 1718334052840440001 | 1718334053449914002 | COMPLETED | YB42AC1E87DC-00061AC2E771139C-0-0 | 0 | 312282 | 312299 | | +-----------+---------+----------------------------+----------------------------+--------+---------+---------------+------------+---------------------+-------------------------+------------------------+--------------------------------------------------------------------------------------------------+--------------+---------------------+---------------------+-----------+-----------------------------------+--------+-----------------+---------------------+---------+ 1 row in setFor more information about the fields in the
CDB_OB_TRANSFER_TASK_HISTORYview, see CDB_OB_TRANSFER_TASK_HISTORY.
View the background partition balancing task history as a user tenant
Log in to the MySQL-compatible or Oracle-compatible tenant of the cluster as the tenant administrator of the user tenant.
The following is a connection example. Adjust the connection details according to your actual environment when connecting to the database.
obclient -h10.xx.xx.xx -P2883 -uroot@mysql_tenant#obdemo -p***** -AExecute the following statement to view the background partition balancing task history of the current tenant.
MySQL-compatible modeOracle-compatible modeView the partition balancing task history of the current tenant.
The
DBA_OB_BALANCE_JOB_HISTORYview displays the balance tasks at the macro level of the current tenant, including scale-out, scale-in, migration balance, and partition balance tasks.obclient(root@mysql001)[oceanbase]> SELECT * FROM oceanbase.DBA_OB_BALANCE_JOB_HISTORY WHERE JOB_TYPE = 'PARTITION_BALANCE';The query result is as follows:
+--------+----------------------------+----------------------------+---------------------------------+-------------------+-----------------+-------------------------+-----------+---------+--------------+--------------------+----------------------------------------------------------------------------------------------+ | JOB_ID | CREATE_TIME | FINISH_TIME | BALANCE_STRATEGY | JOB_TYPE | TARGET_UNIT_NUM | TARGET_PRIMARY_ZONE_NUM | STATUS | COMMENT | MAX_END_TIME | ZONE_UNIT_NUM_LIST | PARAMETER_LIST | +--------+----------------------------+----------------------------+---------------------------------+-------------------+-----------------+-------------------------+-----------+---------+--------------+--------------------+----------------------------------------------------------------------------------------------+ | 312280 | 2024-06-14 11:00:49.034035 | 2024-06-14 11:01:04.528871 | partition attribution alignment | PARTITION_BALANCE | NULL | 1 | COMPLETED | NULL | NULL | zone1:1 | ls_scale_out_factor:1,enable_rebalance:true,enable_transfer:true,enable_gts_standalone:false | +--------+----------------------------+----------------------------+---------------------------------+-------------------+-----------------+-------------------------+-----------+---------+--------------+--------------------+----------------------------------------------------------------------------------------------+ 1 row in setFor more information about the fields in the
DBA_OB_BALANCE_JOB_HISTORYview, see DBA_OB_BALANCE_JOB_HISTORY.View the log stream-level partition balancing task history of the current tenant.
The
DBA_OB_BALANCE_TASK_HISTORYview displays the log stream-level tasks for the current tenant, including log stream split (LS_SPLIT), log stream merge (LS_MERGE), log stream transfer (LS_TRANSFER), and log stream attribute modification (LS_ALTER).obclient(root@mysql001)[oceanbase]> SELECT * FROM oceanbase.DBA_OB_BALANCE_TASK_HISTORY WHERE BALANCE_STRATEGY LIKE '%partition%';The query result is as follows:
+---------+----------------------------+----------------------------+-------------+--------+---------+-----------+--------------------+------------+---------------------+-------------+-----------+-------------+------------+--------------------------+--------+---------+---------------------------------+ | TASK_ID | CREATE_TIME | FINISH_TIME | TASK_TYPE | SRC_LS | DEST_LS | PART_LIST | FINISHED_PART_LIST | PART_COUNT | FINISHED_PART_COUNT | LS_GROUP_ID | STATUS | PARENT_LIST | CHILD_LIST | CURRENT_TRANSFER_TASK_ID | JOB_ID | COMMENT | BALANCE_STRATEGY | +---------+----------------------------+----------------------------+-------------+--------+---------+-----------+--------------------+------------+---------------------+-------------+-----------+-------------+------------+--------------------------+--------+---------+---------------------------------+ | 312281 | 2024-06-14 11:00:49.036806 | 2024-06-14 11:00:50.416084 | LS_ALTER | 1002 | -1 | NULL | NULL | 0 | 0 | 1001 | COMPLETED | NULL | 312282 | -1 | 312280 | NULL | partition attribution alignment | | 312282 | 2024-06-14 11:00:49.038509 | 2024-06-14 11:00:54.460059 | LS_TRANSFER | 1002 | 1001 | NULL | 500129:500129 | 0 | 1 | 1001 | COMPLETED | NULL | 312283 | -1 | 312280 | NULL | partition attribution alignment | | 312283 | 2024-06-14 11:00:49.038509 | 2024-06-14 11:00:56.470614 | LS_ALTER | 1002 | -1 | NULL | NULL | 0 | 0 | 0 | COMPLETED | NULL | NULL | -1 | 312280 | NULL | partition attribution alignment | +---------+----------------------------+----------------------------+-------------+--------+---------+-----------+--------------------+------------+---------------------+-------------+-----------+-------------+------------+--------------------------+--------+---------+---------------------------------+ 3 rows in setFor more information about the fields in the
DBA_OB_BALANCE_TASK_HISTORYview, see DBA_OB_BALANCE_TASK_HISTORY.View the tablet-level partition balancing task history of the current tenant.
The
DBA_OB_TRANSFER_TASK_HISTORYview displays the tablet-level tasks for the current tenant, showing which partitions and Tablets of the tenant are involved in the transfer operation.obclient(root@mysql001)[oceanbase]> SELECT * FROM oceanbase.DBA_OB_TRANSFER_TASK_HISTORY;The query result is as follows:
+---------+----------------------------+----------------------------+--------+---------+---------------+------------+---------------------+-------------------------+------------------------+--------------------------------------------------------------------------------------------------+--------------+---------------------+---------------------+-----------+-----------------------------------+--------+-----------------+---------------------+---------+ | TASK_ID | CREATE_TIME | FINISH_TIME | SRC_LS | DEST_LS | PART_LIST | PART_COUNT | NOT_EXIST_PART_LIST | LOCK_CONFLICT_PART_LIST | TABLE_LOCK_TABLET_LIST | TABLET_LIST | TABLET_COUNT | START_SCN | FINISH_SCN | STATUS | TRACE_ID | RESULT | BALANCE_TASK_ID | TABLE_LOCK_OWNER_ID | COMMENT | +---------+----------------------------+----------------------------+--------+---------+---------------+------------+---------------------+-------------------------+------------------------+--------------------------------------------------------------------------------------------------+--------------+---------------------+---------------------+-----------+-----------------------------------+--------+-----------------+---------------------+---------+ | 1 | 2024-06-14 11:00:52.439818 | 2024-06-14 11:00:53.780044 | 1002 | 1001 | 500129:500129 | 1 | NULL | NULL | NULL | 200070:0,1152921504606847005:0,1152921504606847006:0,1152921504606847007:0,1152921504606847008:0 | 5 | 1718334052840440001 | 1718334053449914002 | COMPLETED | YB42AC1E87DC-00061AC2E771139C-0-0 | 0 | 312282 | 312299 | | +---------+----------------------------+----------------------------+--------+---------+---------------+------------+---------------------+-------------------------+------------------------+--------------------------------------------------------------------------------------------------+--------------+---------------------+---------------------+-----------+-----------------------------------+--------+-----------------+---------------------+---------+ 1 row in setFor more information about the fields in the
DBA_OB_TRANSFER_TASK_HISTORYview, see DBA_OB_TRANSFER_TASK_HISTORY.
View the partition balancing task history of the current tenant.
The
DBA_OB_BALANCE_JOB_HISTORYview displays the macro-level balance tasks in the current tenant, including scale-out, scale-in, migration balancing, and partition balancing.obclient(SYS@oracle001)[SYS]> SELECT * FROM SYS.DBA_OB_BALANCE_JOB_HISTORY WHERE JOB_TYPE = 'PARTITION_BALANCE';The query result is as follows:
+--------+------------------------------+------------------------------+---------------------------------+-------------------+-----------------+-------------------------+-----------+---------+--------------+--------------------+----------------------------------------------------------------------------------------------+ | JOB_ID | CREATE_TIME | FINISH_TIME | BALANCE_STRATEGY | JOB_TYPE | TARGET_UNIT_NUM | TARGET_PRIMARY_ZONE_NUM | STATUS | COMMENT | MAX_END_TIME | ZONE_UNIT_NUM_LIST | PARAMETER_LIST | +--------+------------------------------+------------------------------+---------------------------------+-------------------+-----------------+-------------------------+-----------+---------+--------------+--------------------+----------------------------------------------------------------------------------------------+ | 346408 | 14-JUN-24 01.59.59.014732 PM | 14-JUN-24 02.00.09.055400 PM | partition attribution alignment | PARTITION_BALANCE | NULL | 1 | COMPLETED | NULL | NULL | zone1:1 | ls_scale_out_factor:1,enable_rebalance:true,enable_transfer:true,enable_gts_standalone:false | +--------+------------------------------+------------------------------+---------------------------------+-------------------+-----------------+-------------------------+-----------+---------+--------------+--------------------+----------------------------------------------------------------------------------------------+ 1 row in setFor more information about the fields in the
DBA_OB_BALANCE_JOB_HISTORYview, see DBA_OB_BALANCE_JOB_HISTORY.View the log stream-level partition balancing task history of the current tenant.
The
DBA_OB_BALANCE_TASK_HISTORYview displays the log stream-level tasks for the current tenant, including log stream split (LS_SPLIT), log stream merge (LS_MERGE), log stream transfer (LS_TRANSFER), and log stream attribute modification (LS_ALTER).obclient(SYS@oracle001)[SYS]> SELECT * FROM SYS.DBA_OB_BALANCE_TASK_HISTORY WHERE BALANCE_STRATEGY LIKE '%partition%';The query result is as follows:
+---------+------------------------------+------------------------------+-------------+--------+---------+-----------+--------------------+------------+---------------------+-------------+-----------+-------------+------------+--------------------------+--------+---------+---------------------------------+ | TASK_ID | CREATE_TIME | FINISH_TIME | TASK_TYPE | SRC_LS | DEST_LS | PART_LIST | FINISHED_PART_LIST | PART_COUNT | FINISHED_PART_COUNT | LS_GROUP_ID | STATUS | PARENT_LIST | CHILD_LIST | CURRENT_TRANSFER_TASK_ID | JOB_ID | COMMENT | BALANCE_STRATEGY | +---------+------------------------------+------------------------------+-------------+--------+---------+-----------+--------------------+------------+---------------------+-------------+-----------+-------------+------------+--------------------------+--------+---------+---------------------------------+ | 346409 | 14-JUN-24 01.59.59.016760 PM | 14-JUN-24 02.00.00.652394 PM | LS_ALTER | 1002 | -1 | NULL | NULL | 0 | 0 | 1001 | COMPLETED | NULL | 346410 | -1 | 346408 | NULL | partition attribution alignment | | 346410 | 14-JUN-24 01.59.59.017468 PM | 14-JUN-24 02.00.04.959125 PM | LS_TRANSFER | 1002 | 1001 | NULL | 500021:500021 | 0 | 1 | 1001 | COMPLETED | NULL | 346411 | -1 | 346408 | NULL | partition attribution alignment | | 346411 | 14-JUN-24 01.59.59.017468 PM | 14-JUN-24 02.00.06.970879 PM | LS_ALTER | 1002 | -1 | NULL | NULL | 0 | 0 | 0 | COMPLETED | NULL | NULL | -1 | 346408 | NULL | partition attribution alignment | +---------+------------------------------+------------------------------+-------------+--------+---------+-----------+--------------------+------------+---------------------+-------------+-----------+-------------+------------+--------------------------+--------+---------+---------------------------------+ 3 rows in setFor more information about the fields in the
DBA_OB_BALANCE_TASK_HISTORYview, see DBA_OB_BALANCE_TASK_HISTORY.View the tablet-level partition balancing task history of the current tenant.
The
DBA_OB_TRANSFER_TASK_HISTORYview displays the tablet-level tasks for the current tenant, showing which partitions and Tablets of the tenant are involved in the transfer operation.obclient(SYS@oracle001)[SYS]> SELECT * FROM SYS.DBA_OB_TRANSFER_TASK_HISTORY;The query result is as follows:
+---------+------------------------------+------------------------------+--------+---------+---------------+------------+---------------------+-------------------------+------------------------+------------------------------------------------------+--------------+---------------------+---------------------+-----------+-----------------------------------+--------+-----------------+---------------------+---------+ | TASK_ID | CREATE_TIME | FINISH_TIME | SRC_LS | DEST_LS | PART_LIST | PART_COUNT | NOT_EXIST_PART_LIST | LOCK_CONFLICT_PART_LIST | TABLE_LOCK_TABLET_LIST | TABLET_LIST | TABLET_COUNT | START_SCN | FINISH_SCN | STATUS | TRACE_ID | RESULT | BALANCE_TASK_ID | TABLE_LOCK_OWNER_ID | COMMENT | +---------+------------------------------+------------------------------+--------+---------+---------------+------------+---------------------+-------------------------+------------------------+------------------------------------------------------+--------------+---------------------+---------------------+-----------+-----------------------------------+--------+-----------------+---------------------+---------+ | 1 | 14-JUN-24 02.00.02.675095 PM | 14-JUN-24 02.00.04.443093 PM | 1002 | 1001 | 500021:500021 | 1 | NULL | NULL | NULL | 200007:0,1152921504606846987:0,1152921504606846988:0 | 3 | 1718344803084664002 | 1718344803870702005 | COMPLETED | YB42AC1E87DC-00061AC2EE113D0F-0-0 | 0 | 346410 | 346428 | NULL | +---------+------------------------------+------------------------------+--------+---------+---------------+------------+---------------------+-------------------------+------------------------+------------------------------------------------------+--------------+---------------------+---------------------+-----------+-----------------------------------+--------+-----------------+---------------------+---------+ 1 row in setFor more information about the fields in the
DBA_OB_TRANSFER_TASK_HISTORYview, see DBA_OB_TRANSFER_TASK_HISTORY.