Migrating an IQ 12 database to IQ 15
Upgrade in place of a simplex database from version 12 to version 15
The method described below is basically an update in place of an existing IQ 12 database and consists of four simple steps. The Sybase documentation is a bit confusing about the IQ 12 version that you need to run before upgrading to IQ 15. At some points it is stated that you can be at either IQ 12.6 ESD 11 or at 12.7 ESD 5. However, the documentation for the iqunload utility states that it can only be used in combination with 12.7 ESD 5. When in doubt, contact Sybase technical support.
Prepare the version 12 server
- Start the IQ server and it's database. Make sure that no users are connected.
- Run these commands
checkpoint; sp_iqcheckdb 'verify database'; commit;
The output of spiqcheckdb can be quite long. In the header it should say “No Errors Detected”. When there are errors found you need to fix them first before proceeding
- Shutdown the IQ 12 server
Make a backup
For rollback purposes you need to make a backup of the existing IQ 12 database. Use your standard backup procedure, like “backup database” or another utility.
Start the upgrade
To upgrade the database you need to use the iqunload utility, as in this example:
iqunload -au -c "dbf=/var/sybase/IQ1/IQ1.db;uid=DBA;pwd=SQL" -o unload.out -v
The meaning of the parameters are:
-au : unload and reload schema
-c : followed by connection string to the IQ 12 database file, username and password.
-o : Ouptut file for messages
-v : Verbose messages
Iqunload will perform these tasks:
- create a new database
- extract the information from the old catalog store (the .db file)
- load the extracted schema into the new database.
- Remove the iq transaction log, and the mirror log when applicable
- A file with extension .lmp is created. It contains some information for licensing purposes.
- An extra file called new_main_store.iq will be created. This is the new IQ_SYSTEM_MAIN. By using the -ms_filename with iqunload you can specify another file name.
Verify and finish the upgrade
When the upgrade is complete, you can check the unload.out file for errors. When there are no errors, start the IQ server in read only mode and verify the database.
start_iq @params.cfg ./IQ1.db -iqro 1
Then start dbisql and run these commands:
checkpoint; sp_iqcheckdb('verify database'); commit;
At the top of the output of sp_iqcheckdb you should see “No Errors Detected”
By running iqunload a few new files have been created: a <dbname>.db.before_schema_reload, a <dbname>.iqmsg.before_schema_reload and a new_main_store.iq. You can remove the <dbname>.db.before_schema_reload and the <dbname>.iqmsg.before_schema_reload. Do not remove new_main_store.iq.
Stop the IQ server and restart in read/write mode
stop_iq start_iq @params.cfg IQ1.db