Home | Previous Page | Next Page   Data Migration Utilities > The onunload and onload Utilities >

Steps for Using onunload and onload

This section describes the procedure for using onunload and onload to move a database. You can use these commands to move either a complete database or a table from one computer to another. The syntax and description of the onunload utility starts on page Syntax of the onunload Command. The syntax and description of the onload utility starts on page Syntax of the onload Command.

To move a database from one computer to another
  1. Make sure that the page size, numeric representations, and byte alignment on structures and unions are the same on both computers.

    (The page size is two kilobytes on certain UNIX systems and four kilobytes on Windows NT.) The page size is an Informix characteristic. For information about page size, see your IBM Informix: Administrator's Guide. The numeric representation and the byte alignment are characteristics of your operating system. For information about numeric representation and byte alignment, refer to the manuals for your operating systems.

  2. Decide where to store the unloaded data:
    • On disk. Create an empty file for onunload to hold the data. Make sure that you have write permission for the file.
    • On tape. Use the tape device and characteristics specified in the ONCONFIG configuration file by either TAPEDEV or LTAPEDEV or specify another tape device. Make sure that the tape device that you specify is available for onunload .
  3. Run the oncheck utility to make sure that your database is consistent.

    For information about oncheck, see your IBM Informix: Administrator's Guide.

  4. Run the onunload utility to unload the data from the database.
  5. If necessary, transfer the storage medium (tape or disk) to the new computer.

    If the two computers are on the same network, you can read or write the data remotely.

  6. Run the onload utility to load the data into the new database.
  7. Set the desired logging status for the new database.

    For information about logging status, see your IBM Informix: Administrator's Guide.

  8. If necessary, change the DBA privileges of the database.
  9. If you want to restore the triggers, access privileges, SPL routines, defaults, constraints, and synonyms for the tables in the database, run the dbschema utility.
  10. Create a level-0 backup of the new database.
To move a table from one computer to another
  1. Make sure that the page size, numeric representations, and byte alignment on structures and unions are the same on both computers. (The page size is two kilobytes on certain UNIX systems and four kilobytes on Windows NT.)
  2. Decide where to store the unloaded data. (See step 2 of the previous section.)
  3. Run the oncheck utility to make sure that your database is consistent.
  4. If you want to save the triggers, access privileges, SPL routines, defaults, constraints, and synonyms for the table, run the dbschema utility.
  5. Run the onunload utility.
  6. If necessary, transfer the storage medium to the new computer.
  7. If the table includes simple large objects that are stored in blobspaces, decide where to store the simple large objects. If necessary, create new blobspaces.
  8. Turn off logging.

    When you are loading a table, logging on the target database must be turned off. (When you are creating and loading an entire database, the logging status does not matter.)

  9. Run the onload utility.
  10. Create a level-0 backup of the modified database.
  11. Turn logging back on, if you want logging.
  12. If you want to restore the triggers, access privileges, SPL routines, defaults, constraints, and synonyms for the table, run the dbschema utility or create them manually.
To move a table from one dbspace to another dbspace on the same computer
  1. Run the onunload utility to unload the table.
  2. Turn off logging.

    When you are loading a table, logging on the target database must be turned off.

  3. Run the onload utility.

    Specify a new table name and new dbspace name in the onload statement.

  4. If the data loads successfully, delete the old table in the old dbspace and rename the new table to the old table name.
  5. Create a level-0 backup of the modified database.
  6. Turn logging back on, if you want logging.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]