The unloaddb command creates command files that the DBA uses to unload the data from a database and reload the data into a new, empty database.
Use unloaddb when a database must be totally rebuilt, or for checkpointing the database. The unloaddb command unloads all objects in the database, including tables, views, integrity constraints, permissions, forms, graphs, and report definitions.
Two command files are created:
On Windows the file names are unload.bat and reload.bat. On UNIX, the file names are unload.ing and reload.ing.
The DBA must execute these files to accomplish the unloading and reloading of the database. It is important that the database be recreated with the reload file before doing any work (for example, creating tables, forms, and reports) in the new database.
The unloaddb command uses a version of the copydb command to generate the copy commands in the unload and reload files. Consequently, all limitations of the copydb command apply to the unloaddb command.
Note: If overflow occurs, you may need to edit the unload and reload files to specify another flag, for example, N instead of F in the default floating point specification.
Note: To optimize performance, run the sysmod and optimizedb commands after recreating the database.
Note: When unloaddb is run from an Ingres 2006 Release 2 installation against an older version of Ingres, the command file generated will contain the data type INGRESDATE instead of DATE for any date columns in create table statements.
For additional information on unloading a database, see the Database Administrator Guide.
The unloaddb command has the following format:
unloaddb dbname|vnode::dbname[/server_class] [-c] [-ddirname] [-source=dirname]
[-dest=dirname] [-P] [-uusername] [-Ggroupid] [-row_labels] [-parallel]
[-journal] [-with_sequences]
Specifies the name of the database, and if required, the vnode and server_class, as described in Standard Flags and Parameters.
Creates printable data files, which is useful for transporting databases between computer systems whose internal representations of non-ASCII data differ.
Unloaddb cannot create printable files if (1) binary data is stored in varchar columns, or (2) tables contain user-maintained logical keys.
Stores the unload and reload files in the location specified by dirname instead of the default current directory. The specification can be either a full or relative directory specification.
The dirname must not be the actual database directory, because the files created by unloaddb may have the same names as the tables in the database. The actual database directory is: $II_DATABASE/ingres/data/default/dbname. (On VMS, the directory is: II_DATABASE:[INGRES.DATA.DBNAME].)
Specifies the source directory from which the database will be reloaded. An empty dirname specification ("") denotes the current directory. The -source specification overrides a -d specification for the reload file.
If a source is specified without a destination (no -d or -dest), then the default unload directory is used.
The source directory specification is not checked for validity or existence. This allows the scripts to be moved to another machine for reloading.
Specifies the destination directory into which the database will be unloaded. An empty dirname specification (".") denotes the current directory. The -dest specification overrides a -d specification for the unload file.
If a destination is specified without a source (no -source) then the default reload directory is used.
The destination directory specification is not checked for validity or existence. This allows the scripts to be moved to another machine for unloading.
Prompts for password if the session requires a password.
Specifies the effective user for the session, as described in Standard Flags and Parameters.
Specifies a group identifier, as described in Standard Flags and Parameters.
On VMS, enclose this parameter in double quotation marks ("-Ggroupid").
Copies the row labels.
Creates indexes using the parallel index creation syntax (to build multiple indexes concurrently).
Replaces the "set nojournaling" statement in the unload scripts with the "set journaling" statement, and disables specifying the "with nojournaling" option on each create table statement in the unload script.
Print statements related to sequences only.
The following commands unload and reload the empdata database:
Windows:
cd\mydir\backup
unloaddb empdata
unload
destroydb empdata
createdb empdata
reload
sysmod empdata 
UNIX:
cd /mydir/backup
unloaddb empdata
unload.ing
destroydb empdata
createdb empdata
reload.ing
sysmod empdata 
VMS:
set default [mydir.backup]
unloaddb empdata
@unload.ing
destroydb empdata
createdb empdata
@reload.ing
sysmod empdata 
This command unloads the empdata database, specifying separate source and destination directories:
unloaddb empdata -source="misc/loaddir/" -dest="misc/dumpdir"
Copy statements in the reload script would have the form:
copy emps () from 'misc/loaddir/emps.bob'
Copy statements in the unload script would have the form:
copy emps () into 'misc/dumpdir/emps.bob'
This command unloads the empdata database from the $HOME directory, specifying the current directory as the source and destination directories:
unloaddb empdata -source="" -dest=""
Copy statements in the reload script would have the form:
copy emps () from 'emps.bob'
Copy statements in the unload script would have the form:
copy emps () into 'emps.bob'