Previous Topic

Next Topic

Unloading and Reloading a Database

Unloaddb creates command files enabling a DBA to completely unload and reload a database. Unloaddb works in the same way as copydb except that unloaddb unloads all objects in the database of which you are the DBA, not just the ones you own.

With unloaddb, you can completely unload a coordinator database and move it to a different place. Ingres Star catalogs can be replicated so that the distributed database is always accessible despite node failure. For a full explanation of unloaddb and all its flags, see the Command Reference Guide. This section explains how unloaddb functionality changes when used with Ingres Star.

The unloaddb command does not do the actual unloading but creates SQL commands in two files in the current directory:

When you use unloaddb with a distributed database, you must use the command twice:

  1. You use unloaddb against the distributed database.

    This unloads the registrations of locally stored tables and views and distributed view definitions. Unloaddb does not unload the actual tables that may be stored anywhere in the distributed environment, only their registrations. In this respect, the unloaddb command works differently when used against a distributed database as compared to a local database. Because of this, you do not need to run unload.ing. You need run only reload.ing against the newly created distributed database.

  2. You use unloaddb against the coordinator database.

    This unloads the user tables and data and the front-end object catalogs.

    The tables that are unloaded are the tables resulting from a create table statement at the Ingres Star level when a local database is not specified for the table's storage and the table is therefore stored in the coordinator database.

Accordingly, using unloaddb twice, you do not get all the tables that Ingres Star points to. You get the tables in the coordinator database, the distributed views in the distributed database, and the registrations in the distributed database that are linked to all the locally stored tables that make up the distributed database, and the front-end catalogs.

Important! Because unloaddb must be run on the distributed database and the coordinator database separately, be careful not to unload the coordinator database in the same location as the distributed database in order to prevent files from being overwritten.

Previous Topic

Next Topic

Example: Unloaddb

The following example shows unloaddb used against a distributed database named distdbname and a coordinator database named iidistdbname:

UNIX:

cd /usr/mydir/iidistdbname
unloaddb iidistdbname
unload.ing

cd /usr/mydir/distdbname
unloaddb distdbname/star

createdb newdistdbname/star

cd /usr/mydir/iidistdbname

Edit reload.ing to replace 'iidistdbname' by 'iinewdistdbname':

reload.ing

cd /usr/mydir/distdbname

reload.ing

VMS:

set def usr_disk:[mydir.iidistdbname]
unloaddb iidistdbname
@unload.ing

set def usr_disk:[mydir.distdbname]
unloaddb distdbname/star

createdb newdistdbname/star

set def usr_disk:[mydir.iidistdbname]

Edit reload.ing to replace 'iidistdbname' by 'iinewdistdbname':

@reload.ing

set def usr_disk:[mydir.distdbname]

Edit reload.ing to replace 'distdbname' by 'newdistdbname':

@reload.ing


© 2007 Ingres Corporation. All rights reserved.