Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

destroydb(1sql)

copydb(1sql)

createdb(1sql)

intro(1sql)

intro(8sql)

unloaddb(1sql)

Name

unloaddb − create command files for complete unloading and reloading of a database. 

Syntax

unloaddb [options] dbname

Description

The unloaddb command creates a set of command files that can be run by the DBA for a database to unload all components and data in the database. The unloaddb utility works in the same way as the copydb command except that unloaddb also copies all views, integrity constraints, permissions, and system catalogs in the database. Also, unloaddb unloads all user-defined tables, views and so forth in the database of which you are DBA, whereas copydb unloads only objects that you own in the database.  Use unloaddb to completely rebuild a database or to checkpoint the database. The unloaddb utility creates in the current directory two command files that can then be executed by the DBA:

unload.ing Contains commands to read sequentially through the database, copying every user table into its own file in the named directory. 

reload.ing Contains commands to reload the database with the information contained in the files created by the unload.ing command file.

Note that the unloaddb utility does not actually do the unloading or reloading of the database. The command files created by unloaddb must be executed by the DBA to accomplish these tasks. The unloaddb command uses a version of the copydb utility to generate the copy commands in the unload.ing and reload.ing files.  Therefore, all limitations of the copydb command also apply to the unloaddb command (see Restrictions).

Options

−uusername
Allows you to run unloaddb as the user specified by username. 

−cCauses the commands in the generated command files to use a data format that is portable between VAX and RISC systems, which have different internal representations of non-ASCII data.  When you specify the −c option, execution of the unload.ing file copies out all data values as ASCII values, and execution of the reload.ing file then converts the ASCII values to the format appropriate for each table column definition.

−dpath
Stores the unload.ing and reload.ing files in the location specified by path rather than in the current directory. The value for path can be either a full or relative path name. 

Restrictions

Because the files created by unloaddb may have the same names as database tables, the directory specified in the unloaddb command must not be a directory in which a database resides.

Because databases recreated through execution of the reload.ing file are new databases, you should be sure to run the sysmod command after recreating the database in order to establish storage structures needed for optimal performance.

After unloading the database, make sure that you execute the reload.ing file before doing work (for example, creating new tables) in the database.

Examples

Set current directory to the one where you want the procedures and data files used with the empdata database to be stored, execute the unloaddb command to create the procedures, execute the unload.ing procedure to create the data files, destroy the original empdata database, create a new empdata database, execute the reload.ing procedure to load database components and data, and run sysmod on the new database:

cd /usr/mydir/backup
unloaddb empdata
unload.ing
destroydb empdata
createdb empdata
reload.ing
sysmod empdata

Files

$II_DATABASE/ingres/data/default/dbname
Default database directory for dbname. 

See Also

destroydb(1sql), copydb(1sql), createdb(1sql), intro(1sql), intro(8sql)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026