How to check h2 database health and corruption

倖福魔咒の 提交于 2019-12-02 06:12:46

问题


I'm using h2 database in embedded mode with JavaFX 8 desktop application and I have developed an option for the user to backup and restore the database file.

In the older version of the program I have used SQLite database and checking the database file was quite simple using this command pragma integrity_check.

Using that command with the h2 database always throws an exception.

What is the alternative for that in the h2 database? And is there an explicit or more proper way to check the h2 database file before using it?

Any help or code sample is appreciated,thanks.


回答1:


What you could do is execute the script to command, for example with compression. If that command works, then the database is good. At the same time, you have a backup.



来源:https://stackoverflow.com/questions/32727588/how-to-check-h2-database-health-and-corruption

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!