FROM sys.databases
--WHERE name = 'DATABASENAME'
--WHERE database_id = 14
The copy-pastes and explanations blog for SQL code, errors and daily cases! This blog is a 'list' of actions that always good to have available. The copy-paste concept here is short and clear explanations and descriptions (no long stories!) and - of course - the code to take (copy) and use (paste). The blog deals in the database (mostly) and software issues.
Adaptive Server maintains context information for each client connection that accesses the historical tables, and on each successive query on the table returns only rows that the client has not previously received (read here).
The historical monitoring tables are:
The maximum number of statement statistics returned can be tuned with statement pipe max messages.
The historical monitoring tables require the enable monitoring, statement statistics active, per object statistics active, statement pipe max messages, and statement pipe active configuration parameters to be enabled.
Filter the result set with a where clause filters from the "statement pipe max messages" number.
SHOW DATABASES;
SELECT TABLE_SCHEMA,
COUNT(TABLE_NAME) as tableCount,
SUM(Data_Length)/1048576 as tablespaceUsedMB,
SUM(Index_Length)/1048576 as indexMB,
SUM(DATA_LENGTH+INDEX_LENGTH)/1048576 as totalDatabaseSize
FROM INFORMATION_SCHEMA.TABLES GROUP BY TABLE_SCHEMA;
mysql> SHOW VARIABLES;
For specific variables:
mysql> SHOW VARIABLES LIKE 'TEXT';