Understanding iqunload

iqunload is a fully automated migration tool that recreates the catalog store and reloads it with the existing database schema metadata. Only the catalog is recreated; the IQ data and temp dbspaces are not changed.

iqunload has two working modes:
  • schema unload - unloads a 12.x database schema.

  • migration - migrates a 12.x database to Sybase IQ 15.

Syntax

iqunloadoptions ]  directory [ @data ]

data:[ environment variable | file ]

Parameters

The iqunload utility takes one or more parameters.

iqunload parameters

Option

Description

-ap <size>

(Optional) Set the page size for the new catalog store.

-au

(Required, except when specifying -n) Migrate the database.

You can specify-au or-n as an argument, but not both.

-ckeyword=value;...”

(Required) Supply database connection parameters. You must specify a DBF parameter to specify the name of the database file for migration. The file path is either absolute or relative to the server startup directory.

-dc

(Optional) Recalculate computed columns in the database.

-ms_filename

-ms_filename is optional for a simplex migration, but required for a multiplex migration.

Specify filename for new empty IQ_SYSTEM_MAIN store created during database migration. If not specified, the default new main store is a file system file called new_main_store.iq

-ms_reserve

(Optional) Size of new IQ_SYSTEM_MAIN reserve, in MB. If unspecified, defaults to zero.

-ms_size

(Optional) Size of new IQ_SYSTEM_MAIN store, in MB, based on the database size. The minimum, assuming a default page size, is 200MB. If the user specifies an –ms_size value smaller than the computed value, IQ uses the computed value; otherwise the user–specified value is used.

-n

(Optional, except for schema unload.) Unload schema definition only. You can specify-au or-n as an argument, but not both.

Note:

You must use Sybase IQ 12.7 ESD 5 or later to use this option.

-new_startline

(Optional) Specify startup switches for the new Sybase IQ 15.3 server that is the migration target. For a complete list of server startup switches, see the Utility Guide.

-o <file>

(Optional) Log output messages to file.

-q

(Optional) Suppress messages and windows.

-r <file>

(Optional) Specify name of generated the reload.sql command file.

-t <list>

(Optional) Output listed tables only. Can specify OwnerName.TableName, or TableName alone.

-v

(Optional) Return verbose messages.

-y

(Optional) Replace existing reload schema SQL script with new output without confirmation.

Example 1

Migrate a simplex database to 15.x server:
iqunload –au –c
“UID=DBA;PWD=SQL;DBF=/mydevice/test_dir/test2.db” 

Example 2

Unload schema from database and rename the reload.sql file to test2_reload.sql:
iqunload –n -c
“UID=DBA;PWD=SQL;DBF=/test_dir/test2/test2.db;ENG=
 myserver_test2” –r “/test_dir/unload_dir/test2_reload.sql”

Example 3

Migrate database test3.db. The START connection parameter specifies switches for starting the database being reloaded. The –new_startline parameter specifies switches for starting the utility_db to create the new catalog store.
iqunload –au –c
"UID=DBA;PWD=SQL;DBF=test3.db;START=–ch 128M –iqmc 50" –new_startline "–ch 256M –iqtc 400"

Do not include -iqnotemp XYZ in the new start line or else migration will fail. As part of the migration process, temp files will be added to IQ_SYSTEM_TEMP. If the server is started with iqnotemp then the iqunload will NOT be able to add these temp files.

Example 4

Migrate the database asiqdemo.db using a raw device for a new IQ_SYSTEM_MAIN store:
iqunload –au –c
"UID=DBA;PWD=SQL;DBF=asiqdemo.db" –ms_filename "/dev/rdsk/c4t0d0s3"
iqunload –au –c 
"UID=DBA;PWD=SQL;DBF=asiqdemo.db" -ms_filename \\\\.\\PhysicalDrive2

Usage

For schema unloads, the iqunload requires the following minimum server versions:
  • Sybase IQ version 12.6 ESD #11

  • Sybase IQ version 12.7 ESD #5

For schema unload, start your existing 12.6 or 12.7 server and specify the -n parameter on the iqunload command. Schema unload creates schema load scripts and output files in the current directory.

Permissions

DBA authority is required.