The command copydb creates command files enabling you to copy objects owned by you out of a database and restore it. For a full explanation of copydb and all its flags, see the Command Reference Guide.
The copydb command does not copy the database but creates two SQL command files in the current directory for doing the actual copying:
The copydb command works slightly differently when you use it against a distributed database. If you run copydb against a distributed database, it only copies out registration statements of local tables and views registered in the distributed database and distributed view definitions.
The SQL instructions in copy.out copy data out into files that can be accessed by the SQL instructions in copy.in. Because copying the distributed database involves executing registration statements and not copying data, you need run only copy.in.
The following example shows copydb used against a distributed database named distdbname and a coordinator database named iidistdbname:
UNIX:
cd /usr/mydir/iidistdbname
copydb iidistdbname
sql iidistdbname <copy.out
cd /usr/mydir/distdbname
copydb distdbname/star
createdb newdistdbname/star
cd /usr/mydir/iidistdbname
Edit copy.in to replace 'iidistdbname' by 'iinewdistdbname':
sql iinewdistdbname <copy.in
cd /usr/mydir/distdbname
Edit copy.in to replace 'distdbname' by 'newdistdbname':
sql newdistdbname <copy.in
VMS:
set def usr_disk:[mydir.iidistdbname]
copydb iidistdbname
sql iidistdbname <copy.out
set def usr_disk:[mydir.distdbname]
copydb distdbname/star
createdb newdistdbname/star
set def usr_disk:[mydir.iidistdbname]
Edit copy.in to replace 'iidistdbname' by 'iinewdistdbname':
sql iinewdistdbname <copy.in
set def usr_disk:[mydir.distdbname]
Edit copy.in to replace 'distdbname' by 'newdistdbname':
sql newdistdbname <copy.in