For services that are no longer in use, you can delete them by executing the DELETE SERVICE statement.
Limitations
You cannot execute the DELETE SERVICE statement in a session created based on a service name.
Prerequisites
You have the ALTER SYSTEM privilege to execute the DELETE SERVICE statement.
Procedure
Log in to a user tenant or the
systenant of the cluster as the tenant administrator.Below is an example. Specify the parameters based on your actual environment when connecting.
obclient -h10.xx.xx.xx -P2883 -uroot@sys#obdemo -p***** -ACheck whether the service to be deleted is in the
STOPPEDstate.For more information, see Query the service status.
Based on the query result, if the current service is
STOPPED, you can directly delete it. If the current service is notSTOPPED, you need to manually stop the service first. For details, see Stop a service.Delete the service.
The statement is as follows:
ALTER SYSTEM DELETE SERVICE service_name [TENANT [=] tenant_name];Parameters:
service_name: the name of the service to be deleted.TENANT [=] tenant_name: the name of the tenant for which you want to delete the service. Only thesystenant can specify this parameter. User tenants cannot specify it.
Examples:
Delete the service named
s_hzfor the tenantmysql_tenantin thesystenant.obclient [oceanbase]> ALTER SYSTEM DELETE SERVICE s_hz TENANT = mysql_tenant;Delete the service named
s_hzin a user tenant.obclient > ALTER SYSTEM DELETE SERVICE s_hz;