Purpose
This statement is used to cancel a clone task.
Limitations and considerations
- This statement cancels an ongoing clone task by explicitly changing its status to
CANCELED. When the clone task is canceled, all resources it requested are automatically released. - If the new clone tenant has already completed the clone operation and is in a normal service state before this statement is executed, the statement will not be executed.
Privilege requirements
Only the root user of the sys tenant (root@sys) can cancel a clone task.
Syntax
ALTER SYSTEM CANCEL CLONE new_tenant_name;
Parameters
| Parameter | Description |
|---|---|
| new_tenant_name | The name of the new clone tenant. |
Examples
View the current clone tasks.
SELECT * FROM oceanbase.DBA_OB_CLONE_PROGRESS\GThe result is as follows:
*************************** 1. row *************************** CLONE_JOB_ID: 1706251714452555625 TRACE_ID: YB42AC1E87C9-00060F1AD6DF026E-0-0 SOURCE_TENANT_ID: 1002 SOURCE_TENANT_NAME: mysql001 CLONE_TENANT_ID: 0 CLONE_TENANT_NAME: clone_mysql001 TENANT_SNAPSHOT_ID: 1706251714488180931 TENANT_SNAPSHOT_NAME: _inner_snapshot$1706251714488176014 RESOURCE_POOL_ID: 1007 RESOURCE_POOL_NAME: clone_mysql001_resource_pool UNIT_CONFIG_NAME: unit001 RESTORE_SCN: 18446744073709551615 STATUS: CLONE_SYS_WAIT_CREATE_SNAPSHOT CLONE_JOB_TYPE: FORK CLONE_START_TIME: 2024-01-26 14:48:34.452344 CLONE_FINISHED_TIME: NULL RET_CODE: NULL ERROR_MESSAGE: NULL 1 row in setStart canceling the clone task.
ALTER SYSTEM CANCEL CLONE clone_mysql001;View the current clone tasks again.
SELECT * FROM oceanbase.DBA_OB_CLONE_PROGRESS\GThe result is as follows:
Empty setView the historical clone tasks.
SELECT * FROM oceanbase.DBA_OB_CLONE_HISTORY WHERE CLONE_TENANT_NAME = 'clone_mysql001'\GThe result is as follows:
*************************** 1. row *************************** CLONE_JOB_ID: 1706251714452555625 TRACE_ID: YB42AC1E87C9-00060F1AD6DF026E-0-0 SOURCE_TENANT_ID: 1002 SOURCE_TENANT_NAME: mysql001 CLONE_TENANT_ID: 1014 CLONE_TENANT_NAME: clone_mysql001 TENANT_SNAPSHOT_ID: 1706251714488180931 TENANT_SNAPSHOT_NAME: _inner_snapshot$1706251714488176014 RESOURCE_POOL_ID: 1007 RESOURCE_POOL_NAME: clone_mysql001_resource_pool UNIT_CONFIG_NAME: unit001 RESTORE_SCN: 1706251715526121333 STATUS: CLONE_SYS_CANCELED CLONE_JOB_TYPE: FORK CLONE_START_TIME: 2024-01-26 14:48:34.452344 CLONE_FINISHED_TIME: 2024-01-26 14:49:00.186963 RET_CODE: -4072 ERROR_MESSAGE: clone job has been canceled in CLONE_SYS_WAIT_TENANT_RESTORE_FINISH status 1 rows in set
For more information about the fields of the views, see DBA_OB_CLONE_PROGRESS and DBA_OB_CLONE_HISTORY.
