ASA Database Administration Guide
Database Administration Utilities
The Unload utility
dbunload [ options ] [directory ]
Option | Description |
---|---|
-ac "keyword=value; ..." | Supply connection parameters for the reload |
-an database | Creates a database file with the same settings as the database being unloaded, and automatically reloads it |
-ar [directory] | Rebuild and replace database |
-c "keyword=value; ..." | Supply database connection parameters for unload |
-d | Unload data only |
-e table, ... | Do not unload listed tables |
-ea algorithm | Specify which strong encryption algorithm to encrypt your database with: you can choose AES or MDSR |
-ek key | Specify encryption key |
-ep | Prompt for encryption key |
-ii | Internal unload, internal reload (default) |
-ix | Internal unload, external reload |
-j nnn | Repeated unload of view creation statements |
-jr | Ignore Java when unloading or reloading |
-m | Do not preserve user ids for a replicating database |
-n | No data—schema definition only |
-o filename | Log output messages to a file |
-p char | Escape character for external unloads (default "\") |
-q | Quiet mode—no windows or messages |
-r reload-file | Specify name and directory of generated reload Interactive SQL command file (default reload.sql) |
-t table,... | Unload only the listed tables |
-u | Unordered data. Do not use indexes to unload data. |
-v | Verbose messages |
-xi | External unload, internal reload |
-xx | External unload, external reload |
-y | Replace the command file without confirmation |
The directory is the destination directory where the unloaded data is to be placed. The reload.sql command file is always relative to the current directory of the user.
In the default mode, or if -ii
or -ix
is used, the directory used by dbunload to hold the data is relative to the database server, not to the current directory of the user.
For details of how to supply a filename and path in this mode, see UNLOAD TABLE statement.
If the -xi
or -xx
is used, the directory is relative to the current directory of the user.
If no list of tables is supplied, the whole database is unloaded. If a list of tables is supplied, only those tables are unloaded.
Unloaded data includes the column list for the LOAD TABLE statements generated in the reload.sql file. Unloading the column list facilitates easier reordering of the columns in a table. Tables can be dropped or recreated, and then repopulated using reload.sql.
If you want to unload a strongly encrypted database, you will be required to provide the encryption KEY. You can use the EncryptionKey (DBKEY) connection parameter to provide the KEY in the command. Alternatively, if you want to be prompted for the encryption key rather than entering it in plain view, you can use the -ep
option as follows:
dbunload -c "dbf=enc.db;start=dbeng9 -ep"
If you are using dbunload -an
to unload a database and reload into a new one, and you want to use the -ek
or -ep
options to set the encryption password for the new database, keep the following in mind:
If the original database is strongly encrypted, you will need to specify the key for the original database using the EncryptionKey (DBKEY) connection parameter in the -c
option, not using -ek
or -ep
.
Using the -ek
and -ep
options, it is possible to unload an unencrypted database and reload into a new, strongly encrypted database. When you use -ep
and -an
, you must confirm the key correctly or the unload fails.
If the original database is strongly encrypted, but the -ek
and -ep
options are not used, then the new database will be encrypted without requiring a key.
The -ek
and -ep
options are ignored if -an
is not specified.
Exit codes are 0 (success) or non-zero (failure).
For more information about the Unload utility options, see Unload utility options.
There are special considerations for unloading databases involved in replication. For information, see Unloading and reloading a database participating in replication.
For more information about encryption, see -ep server option or the Encryption Key connection parameter [DBKEY].
This utility accepts @filename parameters. For more information, see @filename server option.