SHOW

2023-10-24 09:23:03  Updated

Purpose

You can use this statement to display information about database objects.

Syntax

SHOW {
    TABLE STATUS
    VARIABLES [like 'variable_name']
    CHARSET  CHARACTER SET  
    COLLATION
    PARAMETERS
    TABLEGROUPS
    CREATE TABLEGROUP tablegroup_name
    CREATE TABLE table_name
    CREATE VIEW view_name
    ERRORS
    GRANTS
    PRIVILEGES
    RECYCLEBIN
    PROCESSLIST
};

Parameters

Parameter Description
TABLE STATUS The details about all tables of the current user.
VARIABLES [like 'variable_name'] The information about a variable. If like 'variable_name' is not specified, the information about all system variables is displayed. variable_name indicates the name of a variable.
CHARSET CHARACTER SET The supported character set.
COLLATION The supported collation.
PARAMETERS All system parameters.
TABLEGROUPS The table groups.
CREATE TABLEGROUP tablegroup_name The statement for creating a table group. tablegroup_name indicates the name of the table group.
CREATE TABLE table_name The statement for creating a table. table_name indicates the name of the table.
CREATE VIEW view_name The statement for creating a view. view_name indicates the name of the view.
ERRORS The errors.
GRANTS The privileges of the current user.
PRIVILEGES The description of privileges.
RECYCLEBIN The recycle bin.
PROCESSLIST The process list.

Examples

  • View the information about the creation of the tbl1 table.

    obclient> SHOW CREATE TABLE tbl1;
    +-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
     TABLE  CREATE TABLE                                                                                                                                                                          
    +-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
     TBL1   CREATE TABLE "TBL1" (
      "COL1" NUMBER(38),
      "COL2" NUMBER(38)
    ) COMPRESS FOR ARCHIVE REPLICA_NUM = 2 BLOCK_SIZE = 16384 USE_BLOOM_FILTER = FALSE TABLET_SIZE = 134217728 PCTFREE = 0 
    +-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    1 row in set
    
  • Check whether the recycle bin is enabled.

    obclient> SHOW VARIABLES LIKE 'recyclebin';
    +---------------+-------+
     VARIABLE_NAME  VALUE 
    +---------------+-------+
     recyclebin     ON    
    +---------------+-------+
    1 row in set
    
  • View the objects in the recycle bin.

    obclient> SHOW RECYCLEBIN;
    +-----------------------------------+---------------+-------+------------------------------+
     OBJECT_NAME                        ORIGINAL_NAME  TYPE   CREATETIME                   
    +-----------------------------------+---------------+-------+------------------------------+
     RECYCLE_$_100004_1634807168766392  TBL1           TABLE  21-OCT-21 05.06.08.767109 PM 
     RECYCLE_$_100004_1634807177792816  V1             VIEW   21-OCT-21 05.06.17.791967 PM 
    +-----------------------------------+---------------+-------+------------------------------+
    2 rows in set
    

Contact Us