You are viewing an older version of this section. View current production version.
Join the SingleStore Community Today
Get expert advice, develop skills, and connect with others.

SHOW DATABASES

Shows the list of databases that exist on this MemSQL instance.

Syntax

SHOW DATABASES [EXTENDED]
[LIKE 'pattern']

Remarks

  • The EXTENDED suffix is a MemSQL-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 MemSQL Commands).

Output (EXTENDED option)

Column Description
Database Name of a database in the MemSQL instance
Commits Number of committed transactions
Role Database replication role
State Current state (Database States)
Position Current position in the transaction log in memory, formatted as <LogFileId>:<ByteOffsetInLogFile>
Details Optional message about the current state
AsyncSlaves Number of currently attached asynchronous replicas
SyncSlaves Number of currently attached synchronous replicas
ConsensusSlaves Number of currently attached replicas running in consensus mode
CommittedPosition Position up to which each transaction has been committed
HardenedPosition Current position in the transaction log on disk
ReplayPosition Position to which changes have been applied to replica
Term A unique identifier of the current master instance of the database
LastPageTerm 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 (MBs) Memory used by the database
Pending IOs Number of transaction log pages (of size 4KB each) that are waiting to be persisted to disk

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 |
+--------------------+---------+--------+--------+----------+---------+-------------+------------+-----------------+-------------------+------------------+----------------+------+--------------+--------------+-------------+