Moving a table using object save and restore commands
You can move a table from another system using the Save Object (SAVOBJ) and Restore Object (RSTOBJ) commands. The save commands save database files on tape or in a save file. The save file can be distributed to another system through communications.
The save and restore commands used to save and restore tables or files include:
- Save Library (SAVLIB) command saves one or more collections or libraries
- Save Object (SAVOBJ) command saves one or more objects (including database tables and views)
- Save Changed Object (SAVCHGOBJ) command saves any objects that have changed since either the last time the collection or library was saved or from a specified date
- Restore Library (RSTLIB) command restores a collection or library
- Restore Object (RSTOBJ) command restores one or more objects (including database tables and views)
For example, if two dealerships are merging, the save and restore commands can be used to save collections and tables for one relational database, which are then restored on the remaining system's relational database. To accomplish this, an administrator would:
- Use the Save Library (SAVLIB) command on system A to save a collection, or use the Save Object (SAVOBJ) command on system A to save a table.
- Specify whether the data is saved to a save file, which can be distributed using SNADS, or saved on tape.
- Distribute the save file to system B, or send the tape to system B.
- Use the Restore Library (RSTLIB) command on system B to restore a collection, or use the Restore Object (RSTOBJ) command on system B to restore a table.
A consideration when you use the save and restore commands is the ownership and authorizations to the restored object. A valid user profile for the current object owner should exist on the system where the object is restored. If the current owner's profile does not exist on this system, the object is restored under the QDFTOWN default user profile. User authorizations to the object are limited by the default user profile parameters. A user with QSECOFR authority must either create the original owner's profile on this system and make changes to the restored object ownership, or specify new authorizations to this object for both local and remote users.
Parent topic:
Moving data from one system to another
Related concepts
Backup and recovery
Related reference
Restore Library (RSTLIB) command
Restore Object (RSTOBJ) command
Save Changed Object (SAVCHGOBJ) command
Save Library (SAVLIB) command
Save Object (SAVOBJ) command