Purpose
This statement is used to display information about database objects.
Syntax
SHOW {
| TABLE STATUS
| [FULL] PROCESSLIST
| RECYCLEBIN
| VARIABLES [LIKE 'pattern']
| PARAMETERS
| CHARSET | CHARACTER SET
| COLLATION
| CREATE TABLEGROUP tablegroup_name
| CREATE TABLE table_name
| CREATE VIEW view_name
| GRANTS
| PRIVILEGES
| ERRORS
| TRACE [FORMAT='JSON']
};
Parameters
| Parameter | Description |
|---|---|
| TABLE STATUS | Displays detailed information about all tables in the current user. |
| VARIABLES [like 'variable_name'] | Displays variable information. If you do not specify like 'variable_name', it displays all system variable information. variable_name is the variable name. |
| CHARSET | CHARACTER SET | Displays supported character sets. |
| COLLATION | Displays supported collations. |
| PARAMETERS | Displays all system configuration items. |
| TABLEGROUPS | Displays table group information. |
| CREATE TABLEGROUP tablegroup_name | Displays the statement for creating a table group. tablegroup_name is the name of the table group. |
| CREATE TABLE table_name | Displays the statement for creating a table. table_name is the table name. |
| CREATE VIEW view_name | Displays the statement for creating a view. view_name is the view name. |
| ERRORS | Displays error information. |
| GRANTS | Displays the privileges of the current user. |
| PRIVILEGES | Displays descriptions of various privileges. |
| RECYCLEBIN | Displays the recycle bin. |
| [FULL] PROCESSLIST | Displays the process list of the current tenant. Details are as follows:
NoteTo query the number of sessions and session IDs in the current database using the |
| TRACE [FORMAT='JSON'] | Displays the execution status of SQL statements. You can choose to output in JSON format. |
Examples
View the creation information of the
tbl1table.obclient> CREATE TABLE employees ( emp_id INT PRIMARY KEY, emp_name VARCHAR(50) NOT NULL, hire_date DATE, salary NUMBER(10,2), department VARCHAR(30) ); obclient> SHOW CREATE TABLE employees;View whether the recycle bin is enabled.
obclient> SHOW VARIABLES LIKE 'recyclebin';View the contents of the recycle bin.
obclient> SHOW RECYCLEBIN;Use
SHOW TRACEto view the execution information of a specific SQL statement and output it in JSON format.obclient> SET ob_enable_show_trace = 1; obclient> CREATE TABLE space_travelers ( astronaut_id INT PRIMARY KEY, mission_code VARCHAR(50) NOT NULL, launch_date DATE, flight_hours NUMBER(10,2), space_station VARCHAR(30) ); obclient> INSERT INTO space_travelers VALUES(1, 'APOLLO-11', TO_DATE('1969-07-16', 'YYYY-MM-DD'), 195.5, 'MOON'); obclient> INSERT INTO space_travelers VALUES(2, 'ISS-EXP-1', TO_DATE('2000-11-02', 'YYYY-MM-DD'), 4320.8, 'ISS'); obclient> SELECT/*+PARALLEL(2)*/ COUNT(*) FROM space_travelers; obclient> SHOW TRACE FORMAT='JSON'\G