Upgrading CoraDB
Upgrading CoraDB has two parts: installing the new software and, when the database format changed, migrating the databases.
Before you upgrade
Section titled “Before you upgrade”- Back up every database with backupdb.
- Save the configuration: the files in
$CORADB/conf(coradb.conf,coradb_broker.confand the others you changed) and$CORADB_DATABASES/databases.txt. - Check reserved words: identifiers that became reserved words in the new version must be renamed or quoted.
- Locales: if your databases use locales other than en_US, list them in
$CORADB/conf/coradb_locales.txtof the new installation and compile them withmake_localebefore creating or migrating databases; see Locale setting. - Drivers: plan to update the drivers of your applications to the new version; the broker and the database server must have the same version.
Migrating a database
Section titled “Migrating a database”When the database format changed, or to move a database to another machine, migrate it with unloaddb and loaddb. The example migrates testdb.
| Step | Linux | Windows |
|---|---|---|
| 1. Stop CoraDB | coradb service stop |
Stop CoraDB with the Service Tray, or coradb service stop |
| 2. Unload the database with the old version, into a separate directory | coradb unloaddb -S testdb |
same |
3. Keep the unload files (testdb_schema, testdb_objects, testdb_indexes, testdb_trigger), databases.txt and the configuration files in a safe place |
||
| 4. Delete the old database | coradb deletedb testdb |
same |
| 5. Install the new version | See Installing CoraDB | same |
| 6. Create the database with the same locale as before | coradb createdb testdb en_US.utf8 |
same |
| 7. Load the unloaded files | coradb loaddb -u dba -s testdb_schema -d testdb_objects -i testdb_indexes --trigger-file=testdb_trigger testdb |
same |
| 8. Back up the new database | coradb backupdb -S testdb |
same |
| 9. Restore your settings in the new configuration files and start CoraDB | coradb service start, coradb server start testdb |
Service Tray > Service Start, or the same commands |
- Create the database with the same language and charset as the old one; the charset decides how strings are stored and cannot be changed later. See Charsets, collations & locales.
- Copy parameter values from the old configuration files instead of replacing the new files with the old ones, so that new parameters keep their defaults. See System parameters and Broker configuration.
- Triggers are unloaded to a separate file,
testdb_trigger, which loaddb loads after the data with--trigger-file, so that the triggers do not fire while the rows are loaded.
After the upgrade
Section titled “After the upgrade”- Java stored procedures: load the Java classes into the new installation again with loadjava and start the Java SP server; see Enabling the Java SP server.
- Statistics: update the optimizer statistics of large tables with UPDATE STATISTICS so that plans are based on the new data.
- Applications: test the applications with the new drivers; query results can change when the behavior of statements or functions changes between versions.