Moving a table between computers with the onunload and onload utilities

You can use the onunload and onload utilities to move a table from one computer to another.

Procedure

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 2 KB on certain UNIX systems and 4 KB on Windows.)
  2. Decide where to store the unloaded data.
  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.

    For details on the syntax of the onunload command, see Syntax of the onunload command.

  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.

    For details on the syntax of the onload command, see Syntax of the onload command.

  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 that are not preserved, and synonyms for the table, run the dbschema utility or recreate these objects manually.

    Constraints such as primary keys or default values are preserved, even for a single table. Foreign keys, access privileges, SPL routines and synonyms are not preserved.