Purpose
You can use this statement to cancel an ongoing cloning job.
Limitations and considerations
- After this statement is executed, the status of the cloning job changes to
CANCELED, and all resources allocated to the cloning job will be automatically released. - If the new tenant has been created and switched to the normal service state, this statement will not be executed.
Required privileges
Only the root user of the sys tenant (root@sys) can execute this statement.
Syntax
ALTER SYSTEM CANCEL CLONE new_tenant_name;
Parameters
| Parameter | Description |
|---|---|
| new_tenant_name | The name of the new tenant. |
Examples
Query the ongoing cloning job.
SELECT * FROM oceanbase.DBA_OB_CLONE_PROGRESS\GThe return 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 setCancel the cloning job.
ALTER SYSTEM CANCEL CLONE clone_mysql001;Query the cloning job again.
SELECT * FROM oceanbase.DBA_OB_CLONE_PROGRESS\GThe return result is as follows:
Empty setQuery the cloning job history.
SELECT * FROM oceanbase.DBA_OB_CLONE_HISTORY WHERE CLONE_TENANT_NAME = 'clone_mysql001'\GThe return 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 columns in the views, see DBA_OB_CLONE_PROGRESS and DBA_OB_CLONE_HISTORY.