×

Db_map

Once you have created an intermediate database file (.idb) with Vgen, you must first map it into memory with the Db_map utility before you can access it. A shared memory area, containing the event memory (emem) and dynamic memory (dmem), is created for the database during this process. The initial database values are then put into the database. (For information about Vgen, see Chapter 2 Vgen in your Vsystem Vaccess Concepts Guide.)
The Db_map utility also checks whether the database has any running processes connected to it. If there are processes connected, Db_map displays a list of the tasks and exits without mapping the database. You can use the rundown and stop qualifiers to run down and terminate the running processes. You can also use vinfo to check the running status of the processes.
To run Db_map
  • Enter the following at the system prompt:
db_map [qualifiers] [idb filename] [database name]
You may also use the db_map graphical interface, which you can access through one of the following commands:
db_map -win
-or-
db_map
The db_map graphical interface is documented in Db_map Graphical Interface.

Parameters

You may use the following parameters with the db_map command:
idb filename
The idb filename parameter is a required parameter that specifies the intermediate database file, including the directory location if the file is not located in the current directory.
database name
The database name parameter is a required parameter that specifies the name of the database; you will use this name when referring to this database from now on in any of the Vsystem tools.

Qualifiers

You can use the following qualifiers, preceded by a "/" or "-" character, with the db_map command.
diag
Use the diag qualifier to print out diagnostic messages during the mapping process. These messages indicate errors that occur while mapping.
dmem
dmem=<value>
Use the dmem qualifier to specify the amount of dynamic pool memory, in kilobytes, to increase or decrease in the database. For example,
db_map -dmem=100
increases the dynamic pool memory by 100KB.
This qualifier should not be necessary in most cases. This qualifier will increase or decrease any dmem value specified in Vgen.
emem
emem=<value>
Use the emem qualifier to specify the amount of extra event memory, in kilobytes, to increase or decrease in the database. For example,
db_map -emem=-100
decreases the event memory by 100KB.
The amount of event memory needed depends on how many processes are connecting to the database at one time and how many events are generated. This qualifier will increase or decrease any emem value specified in Vgen.
help
Use the help qualifier to display a summary of usage, parameters, and qualifiers for db_map.
initvalue
If an initial value is not defined for a channel in its .adb file, and if the channel is not an array, binary, or string channel, use the initvalue qualifier to put a value of 0 to the channel; any alarms, handlers, and conversions will be updated. If this qualifier is not specified, the put to the channel will not occur and any alarms, handlers, and conversions will not be updated. The channel, however, will still be initialized with a 0.
This qualifier has no effect if an initial value is given for a channel in its .adb file.
lock_mem
Use the lock_mem qualifier to lock the database shared memory into memory. To use this qualifier, you need to have P_SYSOPS privilege on Linux or similar privilege on other platforms.
By locking the database into memory, you prevent the database from being swapped out to disk. A large, locked database, however, may affect the performance of your machine, because programs may have to be swapped more often.
log
Use the log qualifier to create a log file named database.log in the Vsystem hostname log directory. This log file contains diagnostic information, including db_map details, process connections and disconnections, db_rundown details, and so on.
nohandler
Use the nohandler qualifier to prevent the handlers from running during the mapping process.
override
Use the override qualifier to prevent db_map from checking for processes connected to the database during the mapping process.
restart
Use the restart qualifier to use the current database files, if they exist, when restarting processes; otherwise, restart has no effect. This feature is useful if you have to reboot the computer, but want to keep the database image as it was previously mapped.
recover
Use the recover qualifier to use a copy of the database backup files as the current database.
rundown
Use the rundown qualifier to enable the system to disconnect any processes that are connected to the database before mapping the database. However, this qualifier does not exit the running processes. You need to use the stop qualifier to terminate the processes.
stop
Use the stop qualifier, together with the rundown qualifier, to terminate any processes connected to the database you want to map. If the rundown qualifier is unspecified, the stop qualifier has no effect.
timerd
When you map a database, you can also use the timerd qualifier to start the timer daemon. The timerd qualifier can take an optional value, in milliseconds, specifying the delay time. (For detailed information about the timer daemon, refer to Starting the Delayed Events Timer Daemon in your Vsystem Vaccess Concepts Guide.) For example:
db_map -timerd=500 database.idb my_db
user_files
user_files=<shared library>
Use the user_files qualifier to specify shareable libraries that contain user-defined handlers and conversion routines. This qualifier can be used instead of specifying the VDB_USER_FILES environment variable.
version
Use the version qualifier to report the version number for db_map.
win
Use the win qualifier to start the db_map graphical interface, see Db_map graphical interface.