09-status.md 1.4 KB
Newer Older
1 2 3 4 5
---
sidebar_label: Connections & Tasks
title: Manage Connections and Query Tasks
---

6
A system operator can use the TDengine CLI to show connections, ongoing queries, stream computing, and can close connections or stop ongoing query tasks or stream computing.
7 8 9 10 11 12 13 14 15

## Show Connections

```sql
SHOW CONNECTIONS;
```

One column of the output of the above SQL command is "ip:port", which is the end point of the client.

16
## Force Close Connections
17 18 19 20 21 22 23 24 25 26 27 28 29

```sql
KILL CONNECTION <connection-id>;
```

In the above SQL command, `connection-id` is from the first column of the output of `SHOW CONNECTIONS`.

## Show Ongoing Queries

```sql
SHOW QUERIES;
```

30
The first column of the output is query ID, which is composed of the corresponding connection ID and the sequence number of the current query task started on this connection. The format is "connection-id:query-no".
31

32
## Force Close Queries
33 34 35 36 37 38 39 40 41 42 43 44 45

```sql
KILL QUERY <query-id>;
```

In the above SQL command, `query-id` is from the first column of the output of `SHOW QUERIES `.

## Show Continuous Query

```sql
SHOW STREAMS;
```

46
The first column of the output is stream ID, which is composed of the connection ID and the sequence number of the current stream started on this connection. The format is "connection-id:stream-no".
47

48
## Force Close Continuous Query
49 50 51 52 53

```sql
KILL STREAM <stream-id>;
```

S
Sean Ely 已提交
54
The above SQL command, `stream-id` is from the first column of the output of `SHOW STREAMS`.