Re: Obtaining the current size of a database

42 views
Skip to first unread message

Thomas Mueller

unread,
Jun 28, 2012, 5:34:13 PM6/28/12
to h2-da...@googlegroups.com
Hi,

Yes you could use:

select
(select cast(value as bigint)
from information_schema.settings
where name = 'info.PAGE_COUNT') *
(select cast(value as bigint)
from information_schema.settings
where name = 'info.PAGE_SIZE') as fileSize;

Regards,
Thomas

On Thu, Jun 28, 2012 at 11:25 PM, John Hendrikx <john.h...@gmail.com> wrote:
> I'm looking for an equivalent to this postgresql query, which returns the
> size of the database in bytes so it can be kept an eye on (by program or the
> user):
>
> SELECT pg_database_size('mediasystem');
>
> Is this possible with h2?
>
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/h2-database/-/uBZVpZh-lroJ.
> To post to this group, send email to h2-da...@googlegroups.com.
> To unsubscribe from this group, send email to
> h2-database...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/h2-database?hl=en.

John Hendrikx

unread,
Jun 29, 2012, 6:33:02 AM6/29/12
to h2-da...@googlegroups.com
Thanks, that's great!
> h2-database+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages