Purpose
This statement is used to display information about database objects.
Syntax
SHOW {
[EXTENDED] [FULL] TABLES [{FROM | IN} database_name] [like_or_where_clause]
| {DATABASES | SCHEMAS} [STATUS] [like_or_where_clause]
| [EXTENDED] [FULL] {COLUMNS | FIELDS} {FROM | IN} rel_name [{FROM | IN} database_name] [like_or_where_clause]
| TABLE STATUS [{FROM | IN} database_name] [like_or_where_clause]
| PROCEDURE STATUS [{FROM | IN} database_name] [like_or_where_clause]
| FUNCTION STATUS [{FROM | IN} database_name] [like_or_where_clause]
| {GLOBAL | SESSION | LOCAL} VARIABLES [like_or_where_clause]
| {CHARSET | CHARACTER SET} [like_or_where_clause]
| TRACE [FORMAT='JSON']
| COLLATION [like_or_where_clause]
| PARAMETERS [like_or_where_clause] tenant_name
| [EXTENDED] {INDEX | INDEXES | KEYS} {FROM | IN} table_name [{FROM | IN} database_name] WHERE opt_hint_value expr
| [FULL] PROCESSLIST
| TABLEGROUPS [like_or_where_clause]
| {GLOBAL | SESSION | LOCAL} STATUS [like_or_where_clause]
| TENANT [STATUS]
| CREATE TENANT tenant_name
| CREATE TABLEGROUP tablegroup_name
| CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] database_name
| CREATE TABLE table_name
| CREATE VIEW view_name
| CREATE PROCEDURE proc_name
| CREATE FUNCTION func_name
| WARNINGS [LIMIT N | LIMIT N,M]
| ERRORS [LIMIT N | LIMIT N,M]
| COUNT(*) WARNINGS
| COUNT(*) ERRORS
| GRANTS opt_for_grant_user
| [STORAGE] ENGINES
| PRIVILEGES
| RECYCLEBIN
| SEQUENCE [like_or_where_clause]
| FUNCTION CODE func_name
| PROCEDURE CODE proc_name
| ENGIN engine_name {STATUS | MUTEX}
| OPEN TABLES [{FROM | IN} db_name] [LIKE 'pattern' | WHERE expr]
| CREATE CATALOG external_catalog_name
| CATALOGS
| CREATE LOCATION location_name
| LOCATIONS
| FILES IN LOCATION @location_name['/path'] [PATTERN = 'regex_pattern']
| SENSITIVE RULES show_sensitive_rule_option
}
like_or_where_clause:
LIKE like_str [ESCAPE] esc_str
| WHERE expr
opt_for_grant_user:
FOR CURRENT USER
| FOR user_name
show_sensitive_rule_option:
[ like_or_where_clause ]
| { FROM | IN } relation_factor [ { FROM | IN } database_name ] [ like_or_where_clause ]
| { FROM | IN } DATABASE database_name [ like_or_where_clause ]
Parameters
| Parameter | Description |
|---|---|
| [EXTENDED] [FULL] TABLES {FROM | IN} database_name | Displays all tables in the database_name database.
|
| {DATABASES | SCHEMAS} [STATUS] | Displays all databases in the current tenant. The STATUS keyword is used to display the read/write attributes of the databases. |
| [EXTENDED] [FULL] {COLUMNS | FIELDS} {FROM | IN} rel_name | Displays the columns of the relation rel_name.
|
| TABLE STATUS [{FROM | IN} database_name] | Displays detailed information about all tables in the database_name database. |
| PROCEDURE STATUS [{FROM | IN} database_name] | Displays detailed information about all stored procedures in the database_name database. |
| FUNCTION STATUS [{FROM | IN} database_name] | Displays detailed information about all functions in the database_name database. |
| {GLOBAL | SESSION | LOCAL} VARIABLES | Displays system variables. |
| {CHARSET | CHARACTER SET} | Displays supported character sets. |
| TRACE [FORMAT='JSON'] | Displays the execution status of an SQL statement. You can choose to output the result in JSON format. |
| COLLATION | Displays supported collations. |
| PARAMETERS [like_or_where_clause] tenant_name | Displays system configuration items. |
| [EXTENDED] {INDEX | INDEXES | KEYS} {FROM | IN} rel_name [{FROM | IN} database_name] | Displays indexes or keys on the relation rel_name. The EXTENDED keyword is used to display information about hidden indexes used internally by the database. |
| [FULL] PROCESSLIST | Displays the process list of the current tenant. Details are as follows:
NoteTo query the number of sessions and their IDs in the current database, see View tenant sessions. |
| TABLEGROUPS | Displays table group information. |
| {GLOBAL | SESSION | LOCAL} STATUS | Displays the session status. |
| TENANT [STATUS] | Displays the name of the current tenant. The STATUS keyword is used to display the read/write status of the tenant. |
| CREATE TENANT tenant_name | Displays the statement for creating a tenant. The sys tenant can view the creation statements of all tenants. A business tenant can only view its own creation statement. |
| CREATE TABLEGROUP tablegroup_name | Displays the statement for creating a table group. |
| CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] database_name | Displays the statement for creating a database. The IF NOT EXISTS keyword is used to add IF NOT EXISTS to the creation statement. |
| CREATE TABLE table_name | Displays the statement for creating a table. |
| CREATE VIEW view_name | Displays the statement for creating a view. |
| CREATE PROCEDURE proc_name | Displays the statement for creating a stored procedure. |
| CREATE FUNCTION func_name | Displays the statement for creating a function. |
| WARNINGS [LIMIT N | LIMIT N,M] | Displays alerts. |
| COUNT(*) WARNINGS | Displays the number of alerts. |
| ERRORS [LIMIT N | LIMIT N,M] | Displays errors. |
| COUNT(*) ERRORS | Displays the number of errors. |
| GRANTS opt_for_grant_user | Displays the privileges of the specified user. If no username is specified, it displays the privileges of the current user. The current user can view their own privileges. To view the privileges of another specified user, you must have the SELECT privilege on mysql.user. |
| [STORAGE] ENGINES | Displays the storage engines. The storage engine of OceanBase Database is OceanBase. |
| PRIVILEGES | Displays the descriptions of various privileges in MySQL. |
| RECYCLEBIN | Displays the recycle bin. |
| SEQUENCE | Displays the created sequences. |
| PROCEDURE CODE proc_name | Displays the internal implementation of the stored procedure proc_name.
NoticeThis keyword is supported only in the current version, and the feature is not effective. |
| FUNCTION CODE func_name | Displays the internal implementation of the stored function func_name.
NoticeThis keyword is supported only in the current version, and the feature is not effective. |
| ENGIN engine_name | Displays the operation information of the storage engine.
NoticeThis keyword is supported only in the current version, and the feature is not effective. |
| OPEN TABLES | Displays the tables and their status information that are currently open on the server.
NoticeThis keyword is supported only in the current version, and the feature is not effective. |
| CREATE CATALOG external_catalog_name | Displays the statement for creating a catalog. |
| CATALOGS | Displays the catalogs of the current tenant. |
| CREATE LOCATION location_name | Displays the statement for creating a location object.
NoteThis syntax is supported in OceanBase Database V4.4.x starting from V4.4.1. |
| LOCATIONS | Displays the location objects of the current tenant.
NoteThis syntax is supported in OceanBase Database V4.4.x starting from V4.4.1. |
| FILES IN LOCATION @location_name['/path'] [PATTERN = 'regex_pattern'] | Displays the files in the location.
Note
|
| SENSITIVE RULES show_sensitive_rule_option | Displays the sensitive column protection rules of the current tenant. Optional: you can use LIKE/WHERE to filter the rules; or use FROM | IN to specify relation_factor (tables), and optionally follow with FROM | IN database_name to limit the database; or use FROM | IN DATABASE database_name to filter by database. For more information about the rules, see CREATE SENSITIVE RULE. |
Examples
View the sensitive column rules in the current tenant.
obclient> SHOW SENSITIVE RULES;obclient> SHOW SENSITIVE RULES FROM db1.t1;obclient> SHOW SENSITIVE RULES IN DATABASE db1 LIKE 'r%';View all databases in the current tenant.
obclient> SHOW DATABASES;+--------------------+ | Database | +--------------------+ | oceanbase | | information_schema | | mysql | | SYS | | LBACSYS | | ORAAUDITOR | | test | | db1 | +--------------------+View the supported character sets.
obclient> SHOW CHARSET;+---------+-----------------------+--------------------+--------+ | Charset | Description | Default collation | Maxlen | +---------+-----------------------+--------------------+--------+ | binary | Binary pseudo charset | binary | 1 | | utf8mb4 | UTF-8 Unicode | utf8mb4_general_ci | 4 | | gbk | GBK charset | gbk_chinese_ci | 2 | | utf16 | UTF-16 Unicode | utf16_general_ci | 2 | | gb18030 | GB18030 charset | gb18030_chinese_ci | 4 | | latin1 | cp1252 West European | latin1_swedish_ci | 1 | +---------+-----------------------+--------------------+--------+ 6 rows in setView the supported collations.
obclient> SHOW COLLATION;+--------------------+---------+-----+---------+----------+---------+ | Collation | Charset | Id | Default | Compiled | Sortlen | +--------------------+---------+-----+---------+----------+---------+ | utf8mb4_general_ci | utf8mb4 | 45 | Yes | Yes | 1 | | utf8mb4_bin | utf8mb4 | 46 | | Yes | 1 | | binary | binary | 63 | Yes | Yes | 1 | | gbk_chinese_ci | gbk | 28 | Yes | Yes | 1 | | gbk_bin | gbk | 87 | | Yes | 1 | | utf16_general_ci | utf16 | 54 | Yes | Yes | 1 | | utf16_bin | utf16 | 55 | | Yes | 1 | | utf8mb4_unicode_ci | utf8mb4 | 224 | | Yes | 1 | | utf16_unicode_ci | utf16 | 101 | | Yes | 1 | | gb18030_chinese_ci | gb18030 | 248 | Yes | Yes | 1 | | gb18030_bin | gb18030 | 249 | | Yes | 1 | | latin1_swedish_ci | latin1 | 8 | Yes | Yes | 1 | | latin1_bin | latin1 | 47 | | Yes | 1 | +--------------------+---------+-----+---------+----------+---------+ 13 rows in setView the current session status.
obclient> SHOW SESSION STATUS;+-------------------+--------+ | Variable_name | Value | +-------------------+--------+ | Threads_connected | 16 | | Uptime | 945571 | +-------------------+--------+View the meanings of the privileges.
obclient> SHOW PRIVILEGES;+----------------+---------------------------------------+-------------------------------------------------------+ | Privilege | Context | Comment | +----------------+---------------------------------------+-------------------------------------------------------+ | Alter | Tables | To alter the table | | Create | Databases,Tables,Indexes | To create new databases and tables | | Create user | Server Admin | To create new users | | Create view | Tables | To create new views | | Delete | Tables | To delete existing rows | | Drop | Databases,Tables | To drop databases, tables, and views | | Grant option | Databases,Tables,Functions,Procedures | To give to other users those privileges you possess | | Index | Tables | To create or drop indexes | | Insert | Tables | To insert data into tables | | Process | Server Admin | To view the plain text of currently executing queries | | Select | Tables | To retrieve rows from table | | Show databases | Server Admin | To see all databases with SHOW DATABASES | | Show view | Tables | To see views with SHOW CREATE VIEW | | Super | Server Admin | To use KILL thread, SET GLOBAL, CHANGE MASTER, etc. | | Update | Tables | To update existing rows | | Usage | Server Admin | No privileges - allow connect only | +----------------+---------------------------------------+-------------------------------------------------------+View the recycle bin.
obclient> SHOW RECYCLEBIN;+---------------------------------+---------------+-------+----------------------------+ | OBJECT_NAME | ORIGINAL_NAME | TYPE | CREATETIME | +---------------------------------+---------------+-------+----------------------------+ | __recycle_$_10_1629093637659648 | t1 | TABLE | 2021-08-16 14:00:37.660550 | | __recycle_$_10_1629093721748992 | t1 | TABLE | 2021-08-16 14:02:01.748691 | +---------------------------------+---------------+-------+----------------------------+View the sequences that you have created.
obclient> CREATE SEQUENCE IF NOT EXISTS s3 ORDER CACHE 100 INCREMENT BY 3 MAXVALUE 99999999999;obclient> SHOW SEQUENCE LIKE 's%'; +------------------------+ | Sequences_in_test (s%) | +------------------------+ | s1 | | s2 | | s3 | +------------------------+ 3 rows in set ```sql obclient> SHOW SEQUENCE WHERE sequence_name='s3';+-------------------+ | Sequences_in_test | +-------------------+ | s3 | +-------------------+ 1 row in set
obclient> SHOW SEQUENCE;+-------------------+ | Sequences_in_test | +-------------------+ | a2 | | s1 | | s2 | | s3 | +-------------------+ 4 rows in setUse
SHOW TRACEto view the execution information of a specific SQL statement and output the information in JSON format.obclient> SET ob_enable_show_trace = 1; obclient> CREATE TABLE t1(c1 INT,c2 INT,c3 INT); obclient> INSERT INTO t1 VALUES(1,1,1); obclient> INSERT INTO t1 VALUES(2,2,2); obclient> SELECT/*+PARALLEL(2)*/ COUNT(*) FROM t1;+----------+ | COUNT(*) | +----------+ | 2 | +----------+ 1 row in setobclient> SHOW TRACE FORMAT='JSON'\G*************************** 1. row *************************** ShowTraceJSON: [{"logs": null, "tags": [[{"sess_id": 3221487676}, {"action_name": ""}, {"module_name": ""}, {"client_info": ""}, {"receive_ts": 1686734801498147}, {"log_trace_id": "YB42AC1E87DE-0005FDE675EF77C4-0-0"}]], "elapse": 4716, "end_ts": "2023-06-14 17:26:41.502925", "parent": "0005fe13-8cac-6fd6-8035-4c299e621239", "span_id": "0005fe13-8cac-7061-6648-1148424d99fa", "start_ts": "2023-06-14 17:26:41.498209", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "com_query_process", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 4698, "end_ts": "2023-06-14 17:26:41.502914", "parent": "0005fe13-8cac-7061-6648-1148424d99fa", "span_id": "0005fe13-8cac-7068-d79c-9a1e3df2f09f", "start_ts": "2023-06-14 17:26:41.498216", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "mpquery_single_stmt", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": [[{"sql_text": "SHOW TRACE FORMAT='JSON'"}], [{"sql_id": "D2A6E68D54F4B888F9443FD4EABB490C"}, {"database_id": 500001}, {"plan_hash": 13465692160314901852}], [{"hit_plan": false}]], "elapse": 2623, "end_ts": "2023-06-14 17:26:41.500858", "parent": "0005fe13-8cac-7068-d79c-9a1e3df2f09f", "span_id": "0005fe13-8cac-707b-84fc-7259f7a5afa4", "start_ts": "2023-06-14 17:26:41.498235", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "sql_compile", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 5, "end_ts": "2023-06-14 17:26:41.498244", "parent": "0005fe13-8cac-707b-84fc-7259f7a5afa4", "span_id": "0005fe13-8cac-707f-c009-4663739d39ed", "start_ts": "2023-06-14 17:26:41.498239", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "pc_get_plan", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 2543, "end_ts": "2023-06-14 17:26:41.500841", "parent": "0005fe13-8cac-707b-84fc-7259f7a5afa4", "span_id": "0005fe13-8cac-70ba-5c5c-1dbf433776e1", "start_ts": "2023-06-14 17:26:41.498298", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "hard_parse", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 27, "end_ts": "2023-06-14 17:26:41.498327", "parent": "0005fe13-8cac-70ba-5c5c-1dbf433776e1", "span_id": "0005fe13-8cac-70bc-91c6-d074e4c11eb8", "start_ts": "2023-06-14 17:26:41.498300", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "parse", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 777, "end_ts": "2023-06-14 17:26:41.499126", "parent": "0005fe13-8cac-70ba-5c5c-1dbf433776e1", "span_id": "0005fe13-8cac-70ed-8482-917a5e0c16e7", "start_ts": "2023-06-14 17:26:41.498349", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "resolve", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 855, "end_ts": "2023-06-14 17:26:41.500028", "parent": "0005fe13-8cac-70ba-5c5c-1dbf433776e1", "span_id": "0005fe13-8cac-7425-2af1-497b7573f962", "start_ts": "2023-06-14 17:26:41.499173", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "rewrite", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 477, "end_ts": "2023-06-14 17:26:41.500522", "parent": "0005fe13-8cac-70ba-5c5c-1dbf433776e1", "span_id": "0005fe13-8cac-778d-5e60-51648fcad206", "start_ts": "2023-06-14 17:26:41.500045", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "optimize", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 176, "end_ts": "2023-06-14 17:26:41.500712", "parent": "0005fe13-8cac-70ba-5c5c-1dbf433776e1", "span_id": "0005fe13-8cac-7978-2ba6-2d656301eaef", "start_ts": "2023-06-14 17:26:41.500536", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "code_generate", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 1980, "end_ts": "2023-06-14 17:26:41.502845", "parent": "0005fe13-8cac-7068-d79c-9a1e3df2f09f", "span_id": "0005fe13-8cac-7ac1-2183-d9f0749c518d", "start_ts": "2023-06-14 17:26:41.500865", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "sql_execute", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 21, "end_ts": "2023-06-14 17:26:41.500887", "parent": "0005fe13-8cac-7ac1-2183-d9f0749c518d", "span_id": "0005fe13-8cac-7ac2-cc2b-a9dcea52ac30", "start_ts": "2023-06-14 17:26:41.500866", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "open", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 1874, "end_ts": "2023-06-14 17:26:41.502770", "parent": "0005fe13-8cac-7ac1-2183-d9f0749c518d", "span_id": "0005fe13-8cac-7ae0-063a-65a2b4aefdd6", "start_ts": "2023-06-14 17:26:41.500896", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "response_result", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 44, "end_ts": "2023-06-14 17:26:41.500947", "parent": "0005fe13-8cac-7ae0-063a-65a2b4aefdd6", "span_id": "0005fe13-8cac-7ae7-2357-70f9191525f2", "start_ts": "2023-06-14 17:26:41.500903", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "do_local_das_task", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": [[{"sql_id": "7F33FD22651F99E8AB2BAC5428623BCD"}, {"database_id": 201001}], [{"sql_text": "START TRANSACTION WITH CONSISTENT SNAPSHOT"}], [{"hit_plan": false}]], "elapse": 95, "end_ts": "2023-06-14 17:26:41.501466", "parent": "0005fe13-8cac-7ae0-063a-65a2b4aefdd6", "span_id": "0005fe13-8cac-7cbb-24eb-6fd68edef4b3", "start_ts": "2023-06-14 17:26:41.501371", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "sql_compile", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 5, "end_ts": "2023-06-14 17:26:41.501378", "parent": "0005fe13-8cac-7cbb-24eb-6fd68edef4b3", "span_id": "0005fe13-8cac-7cbd-d28e-243bd51c8f52", "start_ts": "2023-06-14 17:26:41.501373", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "pc_get_plan", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 53, "end_ts": "2023-06-14 17:26:41.501456", "parent": "0005fe13-8cac-7cbb-24eb-6fd68edef4b3", "span_id": "0005fe13-8cac-7cdb-6744-4e35d589f69e", "start_ts": "2023-06-14 17:26:41.501403", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "hard_parse", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 14, "end_ts": "2023-06-14 17:26:41.501418", "parent": "0005fe13-8cac-7cdb-6744-4e35d589f69e", "span_id": "0005fe13-8cac-7cdc-d22e-b917f1f800ac", "start_ts": "2023-06-14 17:26:41.501404", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "parse", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 10, "end_ts": "2023-06-14 17:26:41.501446", "parent": "0005fe13-8cac-7cdb-6744-4e35d589f69e", "span_id": "0005fe13-8cac-7cfc-a422-4419ea2a8f67", "start_ts": "2023-06-14 17:26:41.501436", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "resolve", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 32, "end_ts": "2023-06-14 17:26:41.501531", "parent": "0005fe13-8cac-7ae0-063a-65a2b4aefdd6", "span_id": "0005fe13-8cac-7d3b-4877-b72cd0df1355", "start_ts": "2023-06-14 17:26:41.501499", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "open", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 22, "end_ts": "2023-06-14 17:26:41.501522", "parent": "0005fe13-8cac-7d3b-4877-b72cd0df1355", "span_id": "0005fe13-8cac-7d3c-4373-3698da80bc1d", "start_ts": "2023-06-14 17:26:41.501500", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "cmd_open", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": [[{"trans_id": 0}]], "elapse": 1, "end_ts": "2023-06-14 17:26:41.501502", "parent": "0005fe13-8cac-7d3c-4373-3698da80bc1d", "span_id": "0005fe13-8cac-7d3d-8ba4-00096f64fb96", "start_ts": "2023-06-14 17:26:41.501501", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "end_transaction", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 2, "end_ts": "2023-06-14 17:26:41.501552", "parent": "0005fe13-8cac-7ae0-063a-65a2b4aefdd6", "span_id": "0005fe13-8cac-7d6e-608e-1f9e19e7615d", "start_ts": "2023-06-14 17:26:41.501550", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "close", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 536, "end_ts": "2023-06-14 17:26:41.502144", "parent": "0005fe13-8cac-7ae0-063a-65a2b4aefdd6", "span_id": "0005fe13-8cac-7da8-8fe7-73d23fcb23bf", "start_ts": "2023-06-14 17:26:41.501608", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "inner_execute_read", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": [[{"sql_text": "SELECT svr_ip, svr_port, tenant_id, trace_id, request_id, span_id, parent_span_id, span_name, ref_type, start_ts, end_ts, tags, logs FROM __all_virtual_trace_span_info WHERE tenant_id = 1002 AND trace_id = '0005fe13-8bf2-47d5-2cdd-5d819739c997'"}], [{"sql_id": "9B307250A34F95FE531FDC05F9F87300"}, {"database_id": 201001}, {"plan_hash": 13345609059733987708}, {"hit_plan": true}]], "elapse": 96, "end_ts": "2023-06-14 17:26:41.501714", "parent": "0005fe13-8cac-7da8-8fe7-73d23fcb23bf", "span_id": "0005fe13-8cac-7db2-b9c2-ef1bdb1e916b", "start_ts": "2023-06-14 17:26:41.501618", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "sql_compile", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 68, "end_ts": "2023-06-14 17:26:41.501687", "parent": "0005fe13-8cac-7db2-b9c2-ef1bdb1e916b", "span_id": "0005fe13-8cac-7db3-0fc7-6c76f9923e90", "start_ts": "2023-06-14 17:26:41.501619", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "pc_get_plan", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 5, "end_ts": "2023-06-14 17:26:41.501730", "parent": "0005fe13-8cac-7da8-8fe7-73d23fcb23bf", "span_id": "0005fe13-8cac-7e1d-fffd-bb0c14004d0b", "start_ts": "2023-06-14 17:26:41.501725", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "open", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 35, "end_ts": "2023-06-14 17:26:41.501788", "parent": "0005fe13-8cac-7da8-8fe7-73d23fcb23bf", "span_id": "0005fe13-8cac-7e39-e47b-68b94d34b9f2", "start_ts": "2023-06-14 17:26:41.501753", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "do_local_das_task", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 32, "end_ts": "2023-06-14 17:26:41.502270", "parent": "0005fe13-8cac-7ae0-063a-65a2b4aefdd6", "span_id": "0005fe13-8cac-801e-95e9-f013f18e58ae", "start_ts": "2023-06-14 17:26:41.502238", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "close", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 12, "end_ts": "2023-06-14 17:26:41.502253", "parent": "0005fe13-8cac-801e-95e9-f013f18e58ae", "span_id": "0005fe13-8cac-8021-a2b8-efb5ea82362a", "start_ts": "2023-06-14 17:26:41.502241", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "close_das_task", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 131, "end_ts": "2023-06-14 17:26:41.502419", "parent": "0005fe13-8cac-7ae0-063a-65a2b4aefdd6", "span_id": "0005fe13-8cac-8050-4e15-2c08b254c1a5", "start_ts": "2023-06-14 17:26:41.502288", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "inner_commit", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": [[{"sql_text": "COMMIT"}], [{"sql_id": "1D0BA376E273B9D622641124D8C59264"}, {"database_id": 201001}]], "elapse": 50, "end_ts": "2023-06-14 17:26:41.502344", "parent": "0005fe13-8cac-8050-4e15-2c08b254c1a5", "span_id": "0005fe13-8cac-8056-1325-2808b1b2c771", "start_ts": "2023-06-14 17:26:41.502294", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "sql_compile", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 43, "end_ts": "2023-06-14 17:26:41.502338", "parent": "0005fe13-8cac-8056-1325-2808b1b2c771", "span_id": "0005fe13-8cac-8057-68cd-3b71b27d0efc", "start_ts": "2023-06-14 17:26:41.502295", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "hard_parse", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 6, "end_ts": "2023-06-14 17:26:41.502302", "parent": "0005fe13-8cac-8057-68cd-3b71b27d0efc", "span_id": "0005fe13-8cac-8058-f520-2ec9b2347039", "start_ts": "2023-06-14 17:26:41.502296", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "parse", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 9, "end_ts": "2023-06-14 17:26:41.502328", "parent": "0005fe13-8cac-8057-68cd-3b71b27d0efc", "span_id": "0005fe13-8cac-806f-120c-2d223c5cafed", "start_ts": "2023-06-14 17:26:41.502319", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "resolve", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 31, "end_ts": "2023-06-14 17:26:41.502381", "parent": "0005fe13-8cac-8050-4e15-2c08b254c1a5", "span_id": "0005fe13-8cac-808e-48e0-16311abf387d", "start_ts": "2023-06-14 17:26:41.502350", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "open", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 26, "end_ts": "2023-06-14 17:26:41.502376", "parent": "0005fe13-8cac-808e-48e0-16311abf387d", "span_id": "0005fe13-8cac-808e-d038-2dd226a767c8", "start_ts": "2023-06-14 17:26:41.502350", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "cmd_open", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": [[{"trans_id": 638124}]], "elapse": 15, "end_ts": "2023-06-14 17:26:41.502366", "parent": "0005fe13-8cac-808e-d038-2dd226a767c8", "span_id": "0005fe13-8cac-808f-c5be-0aea9943a94e", "start_ts": "2023-06-14 17:26:41.502351", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "end_transaction", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 1, "end_ts": "2023-06-14 17:26:41.502394", "parent": "0005fe13-8cac-8050-4e15-2c08b254c1a5", "span_id": "0005fe13-8cac-80b9-b0dc-197d3c4b2ffd", "start_ts": "2023-06-14 17:26:41.502393", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "close", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 55, "end_ts": "2023-06-14 17:26:41.502838", "parent": "0005fe13-8cac-7ac1-2183-d9f0749c518d", "span_id": "0005fe13-8cac-823f-9393-a4c4d9ef623d", "start_ts": "2023-06-14 17:26:41.502783", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "close", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 5, "end_ts": "2023-06-14 17:26:41.502789", "parent": "0005fe13-8cac-823f-9393-a4c4d9ef623d", "span_id": "0005fe13-8cac-8240-73a1-98f019c5455a", "start_ts": "2023-06-14 17:26:41.502784", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "close_das_task", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": [[{"trans_id": 0}]], "elapse": 3, "end_ts": "2023-06-14 17:26:41.502828", "parent": "0005fe13-8cac-823f-9393-a4c4d9ef623d", "span_id": "0005fe13-8cac-8269-cc9b-b89fe9a1cda3", "start_ts": "2023-06-14 17:26:41.502825", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "end_transaction", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}] 1 row in setUse
SHOW COLUMNSto view the column information of thetbl2table.obclient> SHOW COLUMNS FROM tbl2;The query result is as follows:
+-------+---------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+---------+------+-----+---------+-------+ | a | int(11) | YES | | NULL | | | b | int(11) | YES | | NULL | | +-------+---------+------+-----+---------+-------+ 2 rows in setUse
SHOW EXTENDED COLUMNSto view the hidden column information of thetbl2table.obclient> SHOW EXTENDED COLUMNS FROM tbl2;The query result is as follows:
+----------------+-----------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------------+-----------------+------+-----+---------+-------+ | a | int(11) | YES | | NULL | | | b | int(11) | YES | | NULL | | | __pk_increment | bigint unsigned | NO | PRI | NULL | | +----------------+-----------------+------+-----+---------+-------+ 3 rows in setUse
SHOW INDEXto view the index information of thetbl2table.obclient> SHOW INDEX FROM tbl2;The query result is as follows:
+-------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+-----------+---------------+---------+------------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Visible | Expression | +-------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+-----------+---------------+---------+------------+ | tbl2 | 1 | tbl2_index | 1 | a | A | NULL | NULL | NULL | YES | BTREE | available | | YES | NULL | | tbl2 | 1 | tbl2_index | 2 | b | A | NULL | NULL | NULL | YES | BTREE | available | | YES | NULL | +-------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+-----------+---------------+---------+------------+ 2 rows in setUse
SHOW EXTENDED INDEXto view the hidden index information of thetbl2table.obclient> SHOW EXTENDED INDEX FROM tbl2;The query result is as follows:
+-------+------------+------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+-----------+---------------+---------+------------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Visible | Expression | +-------+------------+------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+-----------+---------------+---------+------------+ | tbl2 | 0 | PRIMARY | 1 | __pk_increment | A | NULL | NULL | NULL | | BTREE | available | | YES | NULL | | tbl2 | 0 | PRIMARY | 2 | a | A | NULL | NULL | NULL | | BTREE | available | | YES | NULL | | tbl2 | 0 | PRIMARY | 3 | b | A | NULL | NULL | NULL | | BTREE | available | | YES | NULL | | tbl2 | 1 | tbl2_index | 1 | a | A | NULL | NULL | NULL | YES | BTREE | available | | YES | NULL | | tbl2 | 1 | tbl2_index | 2 | b | A | NULL | NULL | NULL | YES | BTREE | available | | YES | NULL | | tbl2 | 1 | tbl2_index | 3 | __pk_increment | A | NULL | NULL | NULL | | BTREE | available | | YES | NULL | +-------+------------+------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+-----------+---------------+---------+------------+ 6 rows in setView the Location objects in the current tenant.
obclient> SHOW LOCATIONS;The query result is as follows:
+---------------------+ | Location | +---------------------+ | test_location_local | +---------------------+ 1 row in setView the statement used to create the Location objects.
obclient> SHOW CREATE LOCATION test_location_local;The query result is as follows:
+---------------------+--------------------------------------------------------------------------+ | Location | Create Location | +---------------------+--------------------------------------------------------------------------+ | test_location_local | CREATE LOCATION `test_location_local` URL = 'file://home/admin/test_csv' | +---------------------+--------------------------------------------------------------------------+ 1 row in set
