How to get sql dump in H2DB, like in MySql?

I have some questions about H2DB. I have an H2DB database that stores data in files, I have 3 files test.18.log.db, test.data.db, test.index.db. I want to get the sql dump file, for example, when I use mysqldump. Is it possible?

+56
dump h2
Jul 15 2018-10-15
source share
1 answer

Yes, there are several solutions. One of them is to run the SQL SCRIPT statement:

SCRIPT TO 'fileName' 

Another way is to use the Script tool:

 java org.h2.tools.Script -url <url> -user <user> -password <password> 

In addition, there is a RUNSCRIPT statement and a RunScript tool.

By the way, you should consider upgrading to a later version of H2. In newer versions, two .data.db and .index.db files are combined into a .h2.db file.

+153
Jul 15 '10 at 19:23
source share



All Articles