HSQLDB 2.3.3 database properties file - hsqldb

I am new to hsqldb and I am trying to upgrade an existing hsqldb database server from version 1.8 to 2.3.3. I want to copy the database properties from old db.properties to the new one, but it gets overwritten everytime I restart the db server. I have tried setting the db properties using sql commands but it does not show up in the new db.properties file. Please tell me how to set properties for the hsqldb database.

HSQLDB does not store the general database settings in the .properties files. Instead, it stores the settings as a series of SET ... statements in the .script file. The relevant properties of the old database are converted to the new settings when you upgrade.
http://hsqldb.org/doc/2.0/guide/management-chapt.html#mtc_database_settings

Related

Creating New Odoo Instance From Existing Odoo Database

I'm trying to create a new Odoo instances using data that exists in the postgres database of an already running instance.
I'm planning on using an SQL dump from the existing DB or setting a template DB in odoo configurations.
The problem is that I get an internal server error when odoo starts because the database contains information on installed modules, but the new instance would not have those modules installed.
What's a good way to get around this?
Would it be possible to remove that data from the database or sql dump file beforehand and would that make the issue go away?
If you are setting up running Odoo database with same version, then make sure you have same addons / module version, postgres version and mentioned addons-path in same sequence as in production/running system. Like addons, custom-addons, oca-addons, link-addons etc
If you are setting up running Odoo database with upper version, then you have to migrate the database and source code.

H2 Database : how unlock a database file for backup copy?

I'm using h2database version 1.4.200 with hibernate for saving in database file.
My programs needs to regulary save backup and I don't care about corruption's file's problems.
After looking the documentation : http://h2database.com/html/features.html#database_file_locking
I decided to use parameter LOCK_FILE=NO. I saved my models and keeped the entity manager opened. When I tryed to copy the db file "data.mv.db", my database file was always locked even if I used Lock_FILE=NO.
Parameter LOCK_FILE=NO, does it work correctly ?
There is a alternative for copying speedly my db-file in java ?
Any attempt to copy the file when database is in use is a way to get a possibly corrupted backup.
H2 has BACKUP command for online backups.
BACKUP TO 'filename.zip'
This command creates a ZIP archive with a consistent copy of the database file.

Filestream feature is disabled while recreating the database

While I recreate a MS SQL Server database it gives me the following error.
"Filestream feature is disabled."
I really need that feature and it was previously enabled on the existing copy if the database but since I am trying to recreate it how is it possible to enable a feature on a database that is still not created?
Thanks.

How to automate deployment of entity model changes to database?

Currently I use Visual Studio Database Project, so I can deploy changes to database with one click and keep data in database.
Now I want to be able to create model in Entity Framework and deploy with one click.
So I got sql script to create database from Entity Framework. I can run this script to create database, but I want to keep my data in database.
Is there any way to do that ? Any tool that will do that ? Should I generate it on my own with T4 ?
I use CI so I need to be able to deploy often. I want something similar to Visual Studio Database Project deployment, but with Entity Framework generated database.
Liquibase is a database change management tool. It's implemented in Java but a command-line version is available to control your database upgrades (.NET version is under development).
If you need some modelling tool support then
Power architect can be used with liquibase.
The problems associated with managing database schema upgrades are subtle. For some background reading I would recommend:
Evolutionary Database Design
Get your database under version control
Update
Create a file called liquibase.properties to hold the database details:
url=jdbc:sqlserver://localhost:1433;databaseName=test
username=myuser
password=mypass
driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
classpath=C:\\Program Files\\Microsoft SQL Server 2005 JDBC Driver\\sqljdbc_1.2\\enu\\sqljdbc.jar
changeLogFile=database-changelog.xml
When using liquibase against an existing database you can run the following commands:
liquibase generateChangeLog
liquibase changelogSync
The first command will create an XML file called database-changelog.xml containing the extracted data model.
The second command is optional, but useful if you want to apply new changes to the current database. It marks the extracted changesets as already executed in the database.
Now that you have a starting point, you can proceed to add new changesets to the database-changelog.xml file. To apply these new changes just run the following command:
liquibase update
This is the same command that you use for brand new databases. During an update operation liquibase will compare the changesets in the XML file to the changesets already applied to the target database.
For more advanced usecases I suggest reading the liquibase documentation and the following answer may also help:
comparing databases and genrating sql script using liquibase
To be able to generate Visual Studio Database Project from Entity Framework Model You need to install Entity Designer Database Generation Power Pack.
You need to add Database Project to Your solution and then create edmx model with the same name. Then right click on edmx workspace and select Generate Database from Model and from generation menu Sync Database Project.
You can then deploy this Sql project from Visual Studio to Sql Server.

HSQLDB creating database with properties in server.properties file

I want to create a database on server startup with certain properties. I have the following in my server.properties file:
server.database.0=file:db;check_props=true;sql.enforce_names=true;sql.pad_spaces=false;hsqldb.default_table_type=cached;hsqldb.tx=locks;hsqldb.tx_level=serializable;hsqldb.write_delay=false
server.dbname.0=ssi
I don't see these reflected in the resulting db.properties file. How should I do this?
These properties are for HSQLDB 2.2.9. The properties file for version 2.x does not contain such properties. The .script file contains the equivalent SQL setting statements.
Most URL properties, including those you have used, do not apply to an existing database.
There is also an issue check_props=true, which wrongly flags the sql.pad_space property.