Server Side Considerations

There are no differences between a database that is accessed by Zim Server and a database that is accessed directly by Zim. In fact, a database can be accessed simultaneously by one or more Database Agent processes and directly by local multi-user Zim applications.

Creating a Server Database

Consequently, the steps for setting up a database for use with Zim Server are the same as for setting up any Zim database. The main steps are

Initialize the Object Dictionary

In this step, you choose a directory in which you wish to store the database. Then you execute the ZIMINIT utility.

Run the Zim Development System

Having created a database in the first step, you now start up the Zim Development System.

Enter the Zim Development Center

You can enter the Development Center by executing the DC command from the command prompt:

> dc

Define and Create EntitySets and Relationships

Using the Development Center, define the various EntitySets and relationships that make up your database. DC automatically creates these objects as you define them.

Load Data

If you have any initial data to be loaded into the database, you can at this point.

 

Once the database has been created, defined and loaded, you can exit the Zim Development System.

Using Existing Databases

Because there are no differences between databases to be accessed by Zim Server and those to be accessed by local Zim applications, existing databases are ready for use with the Server. If a database already exists but is not on the server machine, the database definitions must be moved from one machine to another.

In this case, the task is to set up a Zim database on the server platform with the appropriate database object definitions. Use the following steps:

  1. In the existing database, identify the EntitySets and/or relationships that are to be managed by the server and any roles, forms, variables, or named sets that are referenced in the same commands as server EntitySets and relationships. (The non-database objects are required for Zim Server's integrated execution mode described in the next section.) Also, identify the directories that these objects belong to (if they do not belong to the ZIM directory).
  2. Export the object definitions using the Zim Development Center's Export Wizard available from the Export submenu of DC's Tool pulldown menu.
  3. The Development Center's Export Wizard creates a number of files and places them in the "port" directory located off the database directory. Transfer these files to the server machine (if the server is on a different machine).
  4. On the server machine, create a directory to hold the server database and run ZIMINIT to create it. Place the files described in step 3 to the "port" directory of the server database.
  5. On the server machine, run Zim against the server database. Choose Import Wizard from the Import submenu of the Tools pulldown menu. Choose the Finish button to import everything that was placed in the "port" directory.

Server Configuration

Like other versions of Zim, the Zim Database Agent process reads a config.zim file when it starts. To set up a standard config.zim file that is used by all Database Agent processes, create a file called config.srv in the database directory. This file can be created using any text editor and can contain any configuration entries permitted in config.zim. The Zim Server process uses config.srv to create a specific config.zim for each Database Agent process as it is started.

Logical Database Names

When a Zim application wants to connect to ZIM INTEGRATED SERVER, it uses the CONNECT command and specifies a server machine address and a logical database name. This logical name is passed to the server machine where it is looked up by the Zim Server process in a file called zimdb.zim. This is an ASCII file you should set up (using any text editor) and must be located in the directory pointed at by the ZIM environment variable. Each line in the file is of the form

logical name ; database directory path name

The logical name can be any string as long as it does not contain blanks. The database directory path name is the location of the Zim database that corresponds to the logical name. The two fields are separated by a semicolon. Of course, the database directory can contain an areas.zim file that indicates that certain database files are stored elsewhere.