24-show.md 4.0 KB
Newer Older
G
gccgdb1234 已提交
1
---
2 3
sidebar_label: SHOW Statement
title: SHOW Statement for Metadata
G
gccgdb1234 已提交
4 5
---

6
In addition to running SELECT statements on INFORMATION_SCHEMA, you can also use SHOW to obtain system metadata, information, and status.
G
gccgdb1234 已提交
7 8 9 10 11 12 13

## SHOW ACCOUNTS

```sql
SHOW ACCOUNTS;
```

14
Shows information about tenants on the system.
G
gccgdb1234 已提交
15

16
Note: TDengine Enterprise Edition only.
G
gccgdb1234 已提交
17 18 19 20 21 22 23

## SHOW APPS

```sql
SHOW APPS;
```

24
Shows all clients (such as applications) that connect to the cluster.
G
gccgdb1234 已提交
25 26 27 28 29 30 31

## SHOW BNODES

```sql
SHOW BNODES;
```

32
Shows information about backup nodes (bnodes) in the system.
G
gccgdb1234 已提交
33 34 35 36 37 38 39

## SHOW CLUSTER

```sql
SHOW CLUSTER;
```

40
Shows information about the current cluster.
G
gccgdb1234 已提交
41 42 43 44 45 46 47

## SHOW CONNECTIONS

```sql
SHOW CONNECTIONS;
```

48
Shows information about connections to the system.
G
gccgdb1234 已提交
49 50 51 52 53 54 55

## SHOW CONSUMERS

```sql
SHOW CONSUMERS;
```

56
Shows information about all active consumers in the system.
G
gccgdb1234 已提交
57 58 59 60 61 62 63

## SHOW CREATE DATABASE

```sql
SHOW CREATE DATABASE db_name;
```

64
Shows the SQL statement used to create the specified database.
G
gccgdb1234 已提交
65 66 67 68 69 70 71

## SHOW CREATE STABLE

```sql
SHOW CREATE STABLE [db_name.]stb_name;
```

72
Shows the SQL statement used to create the specified supertable.
G
gccgdb1234 已提交
73 74 75 76 77 78 79

## SHOW CREATE TABLE

```sql
SHOW CREATE TABLE [db_name.]tb_name
```

80
Shows the SQL statement used to create the specified table. This statement can be used on supertables, standard tables, and subtables.
G
gccgdb1234 已提交
81 82 83 84 85 86 87

## SHOW DATABASES

```sql
SHOW DATABASES;
```

88
Shows all user-created databases.
G
gccgdb1234 已提交
89 90 91 92 93 94 95

## SHOW DNODES

```sql
SHOW DNODES;
```

96
Shows all dnodes in the system.
G
gccgdb1234 已提交
97 98 99 100 101 102 103

## SHOW FUNCTIONS

```sql
SHOW FUNCTIONS;
```

104
Shows all user-defined functions in the system.
G
gccgdb1234 已提交
105 106 107 108 109 110 111 112

## SHOW LICENSE

```sql
SHOW LICENSE;
SHOW GRANTS;
```

113
Shows information about the TDengine Enterprise Edition license.
G
gccgdb1234 已提交
114

115
Note: TDengine Enterprise Edition only.
G
gccgdb1234 已提交
116 117 118 119 120 121 122

## SHOW INDEXES

```sql
SHOW INDEXES FROM tbl_name [FROM db_name];
```

123
Shows indices that have been created.
G
gccgdb1234 已提交
124 125 126 127 128 129 130

## SHOW LOCAL VARIABLES

```sql
SHOW LOCAL VARIABLES;
```

131
Shows the working configuration of the client.
G
gccgdb1234 已提交
132 133 134 135 136 137 138

## SHOW MNODES

```sql
SHOW MNODES;
```

139
Shows information about mnodes in the system.
G
gccgdb1234 已提交
140 141 142 143 144 145 146

## SHOW MODULES

```sql
SHOW MODULES;
```

147
Shows information about modules installed in the system.
G
gccgdb1234 已提交
148 149 150 151 152 153 154

## SHOW QNODES

```sql
SHOW QNODES;
```

155
Shows information about qnodes in the system.
G
gccgdb1234 已提交
156 157 158 159 160 161 162

## SHOW SCORES

```sql
SHOW SCORES;
```

163
Shows information about the storage space allowed by the license.
G
gccgdb1234 已提交
164

165
Note: TDengine Enterprise Edition only.
G
gccgdb1234 已提交
166 167 168 169 170 171 172

## SHOW SNODES

```sql
SHOW SNODES;
```

173
Shows information about stream processing nodes (snodes) in the system.
G
gccgdb1234 已提交
174 175 176 177 178 179 180

## SHOW STABLES

```sql
SHOW [db_name.]STABLES [LIKE 'pattern'];
```

181
Shows all supertables in the current database. You can use LIKE for fuzzy matching.
G
gccgdb1234 已提交
182 183 184 185 186 187 188

## SHOW STREAMS

```sql
SHOW STREAMS;
```

189
Shows information about streams in the system.
G
gccgdb1234 已提交
190 191 192 193 194 195 196

## SHOW SUBSCRIPTIONS

```sql
SHOW SUBSCRIPTIONS;
```

197
Shows all subscriptions in the current database.
G
gccgdb1234 已提交
198 199 200 201 202 203 204

## SHOW TABLES

```sql
SHOW [db_name.]TABLES [LIKE 'pattern'];
```

205
Shows all standard tables and subtables in the current database. You can use LIKE for fuzzy matching.
G
gccgdb1234 已提交
206 207 208 209 210 211 212

## SHOW TABLE DISTRIBUTED

```sql
SHOW TABLE DISTRIBUTED table_name;
```

213
Shows how table data is distributed.
G
gccgdb1234 已提交
214 215 216 217 218 219 220

## SHOW TAGS

```sql
SHOW TAGS FROM child_table_name [FROM db_name];
```

221
Shows all tag information in a subtable.
G
gccgdb1234 已提交
222 223 224 225 226 227 228

## SHOW TOPICS

```sql
SHOW TOPICS;
```

229
Shows all topics in the current database.
G
gccgdb1234 已提交
230 231 232 233 234 235 236

## SHOW TRANSACTIONS

```sql
SHOW TRANSACTIONS;
```

237
Shows all running transactions in the system.
G
gccgdb1234 已提交
238 239 240 241 242 243 244

## SHOW USERS

```sql
SHOW USERS;
```

245
Shows information about users on the system. This includes user-created users and system-defined users.
G
gccgdb1234 已提交
246 247 248 249 250 251 252 253

## SHOW VARIABLES

```sql
SHOW VARIABLES;
SHOW DNODE dnode_id VARIABLES;
```

254
Shows the working configuration of the parameters that must be the same on each node. You can also specify a dnode to show the working configuration for that node. 
G
gccgdb1234 已提交
255 256 257 258 259 260 261

## SHOW VGROUPS

```sql
SHOW [db_name.]VGROUPS;
```

262
Shows information about all vgroups in the system or about the vgroups for a specified database.
G
gccgdb1234 已提交
263 264 265 266 267 268 269

## SHOW VNODES

```sql
SHOW VNODES [dnode_name];
```

270
Shows information about all vnodes in the system or about the vnodes for a specified dnode.