Previous Topic

Next Topic

unloaddb Command—Create Command Files for Unloading and Reloading a Database

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]

Previous Topic

Next Topic

unloaddb Example: Unload and Reload a Database

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

Previous Topic

Next Topic

unloaddb Example: Unload a Database, Specifying Source and Destination Directories

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'

Previous Topic

Next Topic

unloaddb Example: Unload a Database from the $HOME Directory

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'


© 2007 Ingres Corporation. All rights reserved.