This topic describes the obshell trash commands, which are used to manage attributes in the recycle bin of an OceanBase cluster. The OceanBase cluster must be initialized before you use these commands. You can configure the -h/--help option in a command to view the help information, or configure the -v/--verbose option when an error occurs to view the detailed execution process of the command.
Note
Currently, the only subcommand group in this command group is tenant.
obshell recyclebin tenant purge
You can use this command to purge a specified tenant from the recycle bin. This will also clear the resource pool of the tenant.
${home_path}/bin/obshell recyclebin tenant purge {tenant_name | object_name} [-y]
# example
/home/admin/oceanbase/bin/obshell recyclebin tenant purge t1 -y
/home/admin/oceanbase/bin/obshell recyclebin tenant purge '__recycle_$_1_1720679549921648'
home_path is the installation directory of OceanBase Database. By default, obshell is located in the bin directory of the installation directory of OceanBase Database. You need to specify tenant_name as the original name of the tenant to be cleared. Alternatively, you can specify object_name as the object name of the tenant in the recycle bin. Either tenant_name or object_name is sufficient.
In the example, t1 is the original name of the tenant to be cleared from the recycle bin, and __recycle_$_1_1720679549921648 is the object name of the tenant in the recycle bin.
You can use the -y/--yes option to specify not to prompt for confirmation. This option does not require a value.
obshell recyclebin tenant flashback
You can use this command to restore a specified tenant from the recycle bin.
${home_path}/bin/obshell recyclebin tenant flashback {tenant_name | object_name} [-n]
# example
/home/admin/oceanbase/bin/obshell recyclebin tenant flashback t1 -n t2
/home/admin/oceanbase/bin/obshell recyclebin tenant flashback __recycle_$_1_1720679549921648
home_path is the installation directory of OceanBase Database. By default, obshell is located in the bin directory of the installation directory of OceanBase Database. You need to specify tenant_name as the original name of the tenant to be restored. Alternatively, you can specify object_name as the object name of the tenant in the recycle bin. Either tenant_name or object_name is sufficient.
In the example, t1 is the original name of the tenant to be restored from the recycle bin, and __recycle_$_1_1720679549921648 is the object name of the tenant in the recycle bin.
You can use the -n/--new_name option to specify the new name of the tenant after it is restored from the recycle bin. If you do not specify this option, the tenant is restored with its original name.
obshell recyclebin tenant show
You can use this command to display a specified tenant or all tenants in the recycle bin.
${home_path}/bin/obshell recyclebin tenant show [tenant_name | object_name]
# example
obshell recyclebin tenant show t1
obshell recyclebin tenant show '__recycle_$_1_1720679549921648'
obshell recyclebin tenant show
home_path is the installation directory of OceanBase Database. By default, obshell is located in the bin directory of the installation directory of OceanBase Database. You need to specify tenant_name as the original name of the tenant to be displayed. Alternatively, you can specify object_name as the object name of the tenant in the recycle bin. Either tenant_name or object_name is sufficient. If you do not specify tenant_name or object_name, all tenants in the recycle bin will be displayed.
In the example, t1 is the original name of the tenant to be displayed, and __recycle_$_1_1720679549921648 is the object name of the tenant in the recycle bin.
