db_mgr - Database Manager - create, remove, dump, and restore CIToolkit configuration databases




db_mgr [--help] [--man] [--describe [<db>]] [--new <db> [--force]] [--copy [<db1>] <db2> [--force]] [--destroy <db>] [--dump [<db>]] [--restore <db> [--force]] [--diff [<db1>] <db2>] [--patch <db> [--reverse]] [--types] [--find]


This tool is used to manage instances of the CIToolkit configuration database. It can be used to create new databases, remove existing ones, or make a duplicate copy of the database. It includes the capability of dumping to and restoring from a text-only format. Finally, it can be used to display some summary information about a given database instance.


Some options (listed below) require that the database connection string be specified. This string is of the form ``TYPE:SPEC'', where TYPE is the database type to access, and SPEC is the associated info required to access a particular database of the type specified.

  For GDBM, the syntax is "GDBM:path_name",
  where path_name.db is the GDBM_File to use.
  For LDAP, the syntax is "LDAP:host:port:dbname".
  If the datasource is not given, B<db_mgr> will act
  on the database specified in the file.

--new <datasource> Initialize a new instance of the cluster configuration database. No action is taken if the DB already exists, unless the --force option is used, in which case all current data will be lost.

--destroy <datasource> Completely remove an instance of the cluster configuration database. Does not check that the DB is empty, so use with care!

--dump Print the contents of the database in text format to STDOUT

--restore <datasource> Fill a cluster config database from dumped text, via STDIN. Implies --new if the db does not exist already. No action is taken if the DB already exists AND IS NOT EMPTY. This behavior can be overridden with the --force in which case the text will be merged into the new database, overwriting any objects which already exist in the database.

--copy [<source>] <dest> Duplicate the database. The source and destination databases may be of entirely different types. Implies --new of the new database, including taking no action if the DB already exists, unless the --force option is used.

  A special case is where the source and destination
  connection strings are the same.  In this case, the
  database will be "refreshed" in place, without
  the need of the --force option.

--describe Report information about the database. Useful in getting the connection string for the default database, and for verifying that a given DB exists and is accessible. Also reports the number of objects in the DB.

--force Take action, even if it means existing data may be lost. Applies to --new, --restore, and --copy.

--help Print extended usage information

--man Print this manpage.


--dump writes to STDOUT. --restore reads from STDIN.

So, here is one (architecture independent) way for copying a database from another machine: # ssh otherhost ``db_mgr --dump'' | db_mgr --restore GDBM:/cluster/config/cluster

To restore a local copy of a database: # db_mgr --restore GDBM:/cluster/config/cluster <alaska_db.txt


The default paths for location of the cluster configuration database, cloned directories, supporting libraries, and other settings are recorded in the config file. Set the environment variable CLUSTER_CONFIG to the location of, or use the default of /cluster/config


device_mgr, collection_mgr, alias_mgr, lookup