Copy Tables
To copy or move data between databases, copy the relevant tables from the current database into another database.
To accomplish these tasks using system commands, use the copydb and sql commands.
In VDBA, use the Generate copy.in and copy.out dialog, invoked from the Copydb command from the Database Generate Scripts submenu. The detailed steps for performing these procedures can be found in VDBA online help.
Example: Move a Table to Another Database
In this example, the DBA moves the customers table, owned by John, from the accounts database to the orders database:
1. Enter the following command at the operating system prompt:
copydb ‑ujohn accounts customers
The copy.in and copy.out scripts are generated.
2. Enter the following commands in sequence:
sql ‑ujohn accounts <copy.out
sql ‑ujohn orders <copy.in
There are now two copies of the customers table: one in the accounts database and one in the orders database.
3. The DBA removes the old table by logging into the Terminal Monitor (sql) as ‑ujohn and issues the following statement:
DROP TABLE customers
Last modified date: 08/14/2024