The Unload utility
142
$ For more information on transaction log management, see "Backup
methods for remote databases in replication installations" on page 660 of the
book ASA User’s Guide.
Connection parameters for source database (–c) For a description of
the connection parameters, see "Connection parameters" on page 64 of the
book ASA User’s Guide. The user ID should have DBA authority, to ensure
that the user has permissions on all the tables in the database.
For example, the following statement unloads the asademo database running
on the sample_server server, connecting as user ID
DBA with password
SQL. The data is unloaded into the
c:\unload
directory.
dbunload -c "eng=sample_server;dbn=asademo;uid=DBA;pwd=SQL" c:\unload
Unload data only (–d) With this option, none of the database definition
commands are generated (CREATE TABLE, CREATE INDEX, and so on);
reload.sql
contains statements to reload the data only.
No data output for listed tables (–e) This switch is accessible only from
the command-line utility. If you wish to unload almost all of the tables in the
database, the
-e command-line switch unloads all tables except the specified
tables.
Internal versus external unloads and reloads
The following switches offer combinations of internal and external
unloads and reloads: -ii, -ix, -xi and -xx. A significant performance
gain can be realized by using internal commands (UNLOAD/LOAD)
versus external commands (Interactive SQL’s INPUT and OUTPUT
statement). However, internal commands are executed by the server, so
file and directory paths are relative to the location of the database server.
Using external commands, file and directory paths are relative to the
current directory of the user.
In Sybase Central, you can specify whether to unload relative to the server
or client.
For more information on filenames and paths for the Unload utility, see
"UNLOAD TABLE statement" on page 635.
Use internal unload, internal reload (–ii) This switch uses the
UNLOAD statement to extract data from the database, and uses the LOAD
statement in the
reload.sql
file to repopulate the database with data. This is
the default.