OceanBase Database provides a built-in scheduled partition balancing job named SCHEDULED_TRIGGER_PARTITION_BALANCE. You can query the parameters of the scheduled partition balancing job based on your business needs in a user tenant.
Procedure
Log in to a MySQL or Oracle user tenant of the cluster.
Note that you must specify the corresponding parameters in the following sample code based on your actual database configurations.
obclient -h10.xx.xx.xx -P2883 -uroot@mysql_tenant#obdemo -p***** -AExecute the following statement to query the parameters of the scheduled partition balancing job of the current tenant.
You can query the
DBA_SCHEDULER_JOBSview for all the scheduler jobs of the current tenant.MySQL modeOracle modeExecute the following statement:
obclient [oceanbase]> SELECT JOB_NAME, JOB_ACTION, START_DATE, REPEAT_INTERVAL, ENABLED, NEXT_RUN_DATE,MAX_RUN_DURATION, COMMENTS FROM oceanbase.DBA_SCHEDULER_JOBS WHERE job_name = 'SCHEDULED_TRIGGER_PARTITION_BALANCE'\GExecute the following statement:
obclient [SYS]> SELECT JOB_NAME, JOB_ACTION, START_DATE, REPEAT_INTERVAL, ENABLED, NEXT_RUN_DATE,MAX_RUN_DURATION, COMMENTS FROM SYS.DBA_SCHEDULER_JOBS WHERE job_name = 'SCHEDULED_TRIGGER_PARTITION_BALANCE'\GA sample query result is as follows:
*************************** 1. row *************************** JOB_NAME: SCHEDULED_TRIGGER_PARTITION_BALANCE JOB_ACTION: DBMS_BALANCE.TRIGGER_PARTITION_BALANCE() START_DATE: 2024-06-14 00:00:00.000000 REPEAT_INTERVAL: FREQ=DAILY; INTERVAL=1 ENABLED: 1 NEXT_RUN_DATE: 2024-06-15 00:00:00.000000 MAX_RUN_DURATION: 7200 COMMENTS: used to auto trigger partition balance 1 row in setThe fields in the query result are described as follows:
JOB_NAME: the name of the scheduled partition balancing job. In this example, the name of the job isSCHEDULED_TRIGGER_PARTITION_BALANCE.JOB_ACTION: the content of the scheduled partition balancing job.START_DATE: the time at which the scheduled partition balancing job is triggered. The default value is00:00every day.REPEAT_INTERVAL: the interval and frequency for triggering the scheduled partition balancing job. By default, the job is triggered once every day.ENABLED: the status of the scheduled partition balancing job. Valid values:1and0. The default value is1.NEXT_RUN_DATE: the time at which the scheduled partition balancing job will be triggered next time.MAX_RUN_DURATION: the timeout period for executing the scheduled partition balancing job, in seconds. The default value is7200.
For more information about the fields in the
DBA_SCHEDULER_JOBSview, see DBA_SCHEDULER_JOBS.