Store in-memory database to disk

144 views
Skip to first unread message

nemo

unread,
May 6, 2010, 4:59:46 AM5/6/10
to H2 Database
How to store in-memory database to disk like normal database?

--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
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.

Ryan How

unread,
May 6, 2010, 7:20:26 PM5/6/10
to h2-da...@googlegroups.com
You can use the Script command to dump it to a file. Then start a new
connection to a file database and use Runscript to recreate your database.

So just like backing up and restoring using script / runscript, but when
backing up use your in memory database, and when restoring use a file
database.

Not sure if there are other ways, but this should work.

Cheers, Ryan

Thomas Mueller

unread,
May 8, 2010, 7:20:53 AM5/8/10
to h2-da...@googlegroups.com
Hi,

> How to store in-memory database to disk like normal database?

Yes, you could you SCRIPT TO.

But why don't you use a regular database with a large cache?

Regards,
Thomas

Nimi

unread,
Jun 4, 2010, 1:55:18 AM6/4/10
to H2 Database
Hi,
How to store disk type databse like mssql into memory database
of H2DB?

On May 8, 4:20 pm, Thomas Mueller <thomas.tom.muel...@gmail.com>
wrote:

Thomas Mueller

unread,
Jun 6, 2010, 4:45:38 AM6/6/10
to h2-da...@googlegroups.com
Hi,

>       How to store disk type databse like mssql into memory database of H2DB?

I don't understand the question, sorry. Do you mean how to convert a
MS SQL Server database to an in-memory H2 database? This is no
different than converting to a regular (persistent) H2 database. One
way is to create a SQL script from the MS SQL Server database, and
then run this script in H2 using RUNSCRIPT FROM.

Regards,
Thomas

Nimi...

unread,
Jun 12, 2010, 4:26:11 AM6/12/10
to h2-da...@googlegroups.com
Thanks Thomas. That fixed my problem. but one problem still persist. i.e. I need to enable remote access of my h2 database. I am using following command line
java -cp h2*.jar org.h2.tools.Server -tcp -tcpport 8082 -tcpAllowOthers. but still not able to make connection from other pc to this server. Can you please tell me where I m wrong?
 
 
Thanks in Advance.


Regards,
Thomas

--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To post to this group, send email to h2-da...@googlegroups.com.
To unsubscribe from this group, send email to h2-database...@googlegroups.com.

Thomas Mueller

unread,
Jun 14, 2010, 1:19:41 AM6/14/10
to h2-da...@googlegroups.com
Hi,

> java -cp h2*.jar org.h2.tools.Server -tcp -tcpport 8082 -tcpAllowOthers

This fails for me because of the "tcpport". Are you sue you are
running exactly this statement?

What is your JDBC URL, and what exception do you get?

Regards,
Thomas

Reply all
Reply to author
Forward
0 new messages