Mailinglist Archive: opensuse (783 mails)

< Previous Next >
[opensuse] SQL Database sizes query
Hi all,

A little stuck here.

I have a list of database names in an array (databases) in a bash script. I want to get the size of these databases.

I know that this query will return the size of all databases on the server.
SELECT table_schema AS "Database name", SUM(data_length + index_length) / 1024 AS "Size (kb)" FROM information_schema.TABLES GROUP BY table_schema

How can I change this query to get the size of only the databases in the array?


thanks

Paul

--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages