Outdated Version
You are viewing an older version of this section. View current production version.
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 |
Examples
SHOW DATABASES;
****
+--------------------+
| Database |
+--------------------+
| cluster |
| information_schema |
| memsql |
| memsql_demo |
+--------------------+
SHOW DATABASES EXTENDED;
****
+--------------------+---------+--------+--------+----------+---------+-------------+------------+-----------------+-------------------+------------------+----------------+---------+--------------+--------------+
| Database | Commits | Role | State | Position | Details | AsyncSlaves | SyncSlaves | ConsensusSlaves | CommittedPosition | HardenedPosition | ReplayPosition | Term | LastPageTerm | Memory (MBs) |
+--------------------+---------+--------+--------+----------+---------+-------------+------------+-----------------+-------------------+------------------+----------------+---------+--------------+--------------+
| cluster | 46 | master | online | 0:78 | | 2 | 0 | 0 | 0:78 | 0:78 | NULL | 1650185 | 0 | 0.00 |
| information_schema | 87 | master | online | 0:10 | | 0 | 0 | 0 | 0:10 | 0:10 | NULL | 1 | 0 | 0.00 |
| memsql | 21 | master | online | 0:1132 | | 0 | 0 | 0 | 0:1132 | 0:1132 | NULL | 1 | 0 | 0.00 |
| memsql_demo | 19 | master | online | 0:15513 | | 0 | 2 | 0 | 0:15513 | 0:15513 | NULL | 1650185 | 0 | 0.13 |
+--------------------+---------+--------+--------+----------+---------+-------------+------------+-----------------+-------------------+------------------+----------------+---------+--------------+--------------+