Creating an Empty Database

Every MIM is equipped with a program which will create an empty database. From the LIM DBA home directory (normally /home/lim), run the command:

$ make_db_dirs [database name]

where database name is the name of the empty database to be built. Generally, custom database names follow the format of data. and then company name. So, for Widgets Incorporated, the database name would be data.widgets.

Create the database data.widgets in the LIM DBA home directory (normally /home/lim) using the following command:

$ xmim/bin/make_db_dirs data.widgets

Once you have created the new data.widgets database directory, the MIM server will need to be able to access its contents. This is done via the .xmimrc file, located in the LIM DBA home directory.[1]

$ cd 
$ vi .xmimrc

A typical .xmimrc file’s contents look similar to this:

#!/bin/sh
echo "license:        $LIMHOME/license/xmim.ids"
echo "database:        $LIMHOME/data/xmim.mim"
echo "database:        $LIMHOME/data.cust/xmim.mim"
echo "database:        $LIMHOME/data.gii/xmim.mim"
echo "datesDir:        $LIMHOME/dates/user"
echo "holidayDir:    $LIMHOME/dates/holidays"
echo "tempDir:        $LIMHOME/tmp"
echo "entitlements:    no"
echo "read_lock:    yes"
if [ "$XMIMHOME" = "" ]
then
    XMIMHOME="$LIMHOME/xmim"
    XMIMSLAVESERVERPATH=$XMIMHOME
    export XMIMHOME
fi
echo "libraryDir:    $XMIMHOME/library"
for file in $LIMHOME/.xmimrc.local $LIMHOME/xmimrc/xmimrc.format.???
do
    if [ -f "$file" ]
    then
        cat $file

Each line that begins with echo is a database that the MIM server is currently reading. Insert a line with your new database beneath the $LIMHOME/data/xmim.mim in the .xmimrc file and save it. Adding the data.widgets database then looks like this:

The following example assumes that data was loaded into $LIMHOME.

#!/bin/sh
echo "license:        $LIMHOME/license/xmim.ids"
echo "database:        $LIMHOME/data/xmim.mim"
echo "database:        $LIMHOME/data.widgets/xmim.mim"
echo "database:        $LIMHOME/data.cust/xmim.mim"
echo "database:        $LIMHOME/data.gii/xmim.mim"
echo "datesDir:        $LIMHOME/dates/user"
echo "holidayDir:    $LIMHOME/dates/holidays"
echo "tempDir:        $LIMHOME/tmp"
echo "entitlements:    no"
echo "read_lock:    yes"
if [ "$XMIMHOME" = "" ]
then
    XMIMHOME="$LIMHOME/xmim"
    XMIMSLAVESERVERPATH=$XMIMHOME
    export XMIMHOME
fi
echo "libraryDir:    $XMIMHOME/library"
for file in $LIMHOME/.xmimrc.local $LIMHOME/xmimrc/xmimrc.format.???
do
    if [ -f "$file" ]
    then
        cat $file

Now that the empty database is created and the .xmimrc file is altered, restart your server so that it can read the new database. Verify that no users are running any queries or are using the database as restarting it will kill any user sessions. Do this by issuing the following command:

$ xmim_svr_info

This command will show which slave servers are running. If there are no slave servers running then it is free of users.

You will also need to verify that your database is not loading data when you reboot it. If you restart your server while load_updates.sh is running, you can cause serious data corruption. The load_updates.sh process is slave port 4091, and you can check to see if the writing slave process is running by issuing the following command:

$ ps –ef | grep 4091

If it returns processes for your MIM server (there could be multiple servers on multiple machines), then wait until the processes complete. If nothing is returned then the server may be restarted:

$ start.server

To verify that the server is reading the database, run the following command:

The following example assumes the user is using port 0.

$ xmim_svr_info –p 0

The header will show the database list:

master server 4 on database is running
        process id:     29411
        owner:          lim
        log_level:      0
        log_file:       /home/lim/tmp/.xmim_server_4.log
        database 0:     /home/lim/data/xmim.mim
        database 1:     /home/lim/data.widgets/xmim.mim
        database 2:     /home/lim/data.cust/xmim.mim
        database 3:     /home/lim/data.gii/xmim.mim
        license:        /home/lim/license/xmim.ids
        version:        Version 4.4.13 Compiled Mon Mar 22 15:50:35 CST 2004


[1] This example uses the “vi” text editor. For assistance editing the .xmimrc file, please contact a LIM Support Representative.