Troubleshooting
In a complex application scenario, connections and query tasks may enter an erroneous state or take too long to finish, necessitating methods to terminate these connections or tasks.
Terminate Connection
KILL CONNECTION conn_id;
conn_id can be obtained through SHOW CONNECTIONS.
Terminate Query
KILL QUERY 'kill_id';
kill_id can be obtained through SHOW QUERIES.
Terminate Transaction
KILL TRANSACTION trans_id;
trans_id can be obtained through SHOW TRANSACTIONS.
Reset Client Cache
RESET QUERY CACHE;
If metadata synchronization issues occur in a multi-client environment, this command can be used to forcibly clear the client cache, after which the client will pull the latest metadata from the server.
Shared Storage Migration
SSMIGRATE DATABASE db_name;
Migrates the data of the specified database to shared storage. All of the following conditions must be met to execute this statement:
- The
ssEnabledconfiguration is enabled (off by default); - The deployment holds the shared-storage enterprise license;
- The executing user holds the
SSMIGRATEprivilege on the database (onlySYSDBAhas it by default).
Migration task progress can be viewed through SHOW SSMIGRATES and tasks can be terminated through KILL SSMIGRATE.