I have created a HsqlDB database and inserted a lot of data in it already. The tables 开发者_如何学编程were create in default mode, i.e., the table type is MEMORY.
Not I want to switch those tables to CACHED mode since they are getting larger and larger. The HsqlDB 1.8 guide says the cached tables can be created by using command
CREATE CACHED TABEL ...
Is there any way to alter the existing tables into CACHED without losing any data?
For example, when your table name is mytable and you want to change it to cached.
With version 2.x there is a command for this:
SET TABLE mytable TYPE CACHED
With version 1.8.x you need to shutdown the database first. Then edit the .script file and modify the line for the table
CREATE MEMORY TABLE mytable
to CREATE CACHED TABLE mytable
After saving the .script file, open your database as normal.
精彩评论