SHOW DATABASES
On this page
Shows the list of databases that exist on this SingleStore instance.
Syntax
SHOW DATABASES [EXTENDED]
[LIKE 'pattern']Remarks
- 
        
The
EXTENDEDsuffix is a SingleStore-only extension that displays extra information about each database. - 
        
This command must be run on the master aggregator or a child aggregator node (see Node Requirements for SingleStore Commands).
 - 
        
See the Permission Matrix for the required permission.
 
Output (EXTENDED option)
| 
             Column  | 
             Description  | 
|---|---|
| 
             
                | 
             Name of a database in the SingleStore instance  | 
| 
             
                | 
             Number of committed transactions  | 
| 
             
                | 
             Database replication role  | 
| 
             
                | 
             Current state (Database States)  | 
| 
             
                | 
             Current position in the transaction log in memory, formatted as   | 
| 
             
                | 
             Optional message about the current state  | 
| 
             
                | 
             Number of currently attached asynchronous replicas  | 
| 
             
                | 
             Number of currently attached synchronous replicas  | 
| 
             
                | 
             Number of currently attached replicas running in consensus mode  | 
| 
             
                | 
             Position up to which each transaction has been committed  | 
| 
             
                | 
             Current position in the transaction log on disk  | 
| 
             
                | 
             Position to which changes have been applied to replica  | 
| 
             
                | 
             A unique identifier of the current master instance of the database  | 
| 
             
                | 
             Term of the master that wrote the contents of the most recent page in the log that the secondary instance is aware of the database  | 
| 
             
                | 
             Memory used by the database  | 
| 
             
                | 
             Number of transaction log pages (of size 4KB each) that are waiting to be persisted to disk  | 
Database States
Within a SingleStore instance, users can create one or more databases.
The SHOW DATABASES command with the EXTENDED option adds extra information per-database on top of the standard SHOW DATABASES output.state column conveys the state of each database with respect to replication and recovery.
| 
               State  | 
               Description  | 
|---|---|
| 
               
                  | 
               The database is available for read and write queries.  | 
| 
               
                  | 
               Not available for read or write queries.  | 
| 
               
                  | 
               Available for read but not write queries.  | 
| 
               
                  | 
               Not available for read or write queries.  | 
| 
               
                  | 
               Not available for read or write queries.  | 
| 
               
                  | 
               Not available for read or write queries.  | 
| 
               
                  | 
               Not available for read or write queries.  | 
| 
               
                  | 
               Databases and partitions are not available for write queries, and are in the process of transitioning to their metadata state.  | 
Examples
SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| cluster            |
| memsql_demo        |
| information_schema |
| memsql             |
+--------------------+SHOW DATABASES EXTENDED;
+--------------------+---------+--------+--------+----------+---------+-------------+------------+-----------------+-------------------+------------------+----------------+------+--------------+--------------+-------------+
| Database           | Commits | Role   | State  | Position | Details | AsyncSlaves | SyncSlaves | ConsensusSlaves | CommittedPosition | HardenedPosition | ReplayPosition | Term | LastPageTerm | Memory (MBs) | Pending IOs |
+--------------------+---------+--------+--------+----------+---------+-------------+------------+-----------------+-------------------+------------------+----------------+------+--------------+--------------+-------------+
| cluster            |       0 | master | online | 0:130    |         |           1 | 0          |               0 | 0:130             | 0:130            | NULL           |   24 |            0 |         0.00 |           0 |
| memsql_demo        |       0 | master | online | 0:269    |         |           1 | 0          |               0 | 0:269             | 0:269            | NULL           |   21 |            0 |         0.00 |           0 |
| information_schema |       0 | master | online | 0:1      |         |           0 | 0          |               0 | 0:1               | 0:1              | NULL           |    2 |            0 |         0.00 |           0 |
| memsql             |       0 | master | online | 0:408    |         |           0 | 0          |               0 | 0:408             | 0:408            | NULL           |   24 |            0 |         0.00 |           0 |
+--------------------+---------+--------+--------+----------+---------+-------------+------------+-----------------+-------------------+------------------+----------------+------+--------------+--------------+-------------+Last modified: March 21, 2023