Migrating an IQ 12 database to IQ 15

From SybaseWiki
Revision as of 07:02, 20 October 2009 by Psap (Talk | contribs) (Start the upgrade)

Jump to: navigation, search

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

  • When it is down, start the IQ server and it's database. Make sure that no users are connected. All your Sybase environment variables should still be set for version 12.
  • 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

Before starting the upgrade make sure that all your Sybase environment variables and the search-path are now set to an IQ server 15 installation.

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 file (catalog store)
  • 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