Types of Configuration Files

Configuration files are used to store sets of configuration options for Zim databases, Zim Server, ZimQt Client and other utilities.

They can be created or modified using any text editor or, in some cases, using the Zim Explore utility.

Types of Configuration Files

There are eight types of configuration files. The following table shows the types of configuration files in Zim, their corresponding file names, locations and whether it is editable in Zim Explore

Note: The table below refers to folders. A folder in MS Windows is equivalent to a directory in Unix/Linux.

Configuration File Type File Name Location Editable in Zim Explore
Zim Server zimconfig.srv Zim installation folder
Zim Databases zimdb.zim Zim installation folder ✔ (implicitly)
Servers Alias zimalias.zim Zim installation folder  
Zim Backup zimbk.zim Zim installation folder  
Database zimconfig.zim Zim database folder
Foreign directories dirs.zim Zim database folder  
Areas areas.zim Zim database folder  

Configuration File Format

If you decide to create or edit a configuration file, you must enter one option on each physical line of the file; if you use ZimExplore, this utility already provides all options and reads and writes the files for you.

If you want to include a comment in a configuration file, start the comment line with a percent sign (%).

Database Configuration File

The database configuration file specifies options that are to be identical for all users of a particular application database. It contains options to describe the way an application is presented, how certain memory parameters have to be dealt, etc.

Each database can have only one database configuration file. This configuration file must be located in the operating system directory where the database resides.

Every time a user starts a Zim session using a particular database, its corresponding database configuration file is read and the existing valid configuration options become available to the running Zim program. Configuration options that either omitted or invalid get their values from the defaults.

This file is optional and does not need to be present in each database because, in most cases, the default options are quite general and apply to most Zim applications.

If you change this configuration file while a Zim session is running, the changes will not affect the session.

All valid database configuration options are described in the section called "Database Configuration Options".

Zim Server Configuration File

The Zim Server configuration file specifies configuration for Zim Server to operate. It must be located in the operating system directory where the Zim software was installed (on Unix, this place is called $ZIM).

The configuration options for Zim Server are taken when Zim Server starts only.

Even though this file is optional and does not need to be present when Zim Server starts, it is a good idea to set its parameters to the specific needs and resources available.

All valid Zim Server configuration options are described in the section called "Zim Server Configuration Options".

Zim Databases Configuration File

The Zim databases configuration file tells Zim Server what are the databases that need to be serviced. It is read when Zim Server starts only and it is located in the operating system directory where the Zim software was installed (on Unix, this place is called $ZIM).

This file is obligatory and must contain at least one reference to a database

Each line of this file contains a reference to a Zim database in this format:

<database number>;<database name>;<location of the database>;

Where:

<database number> is an unique identification number for this database ranging from 1 to 240;

<database name> is an unique name of the database. This is the name that should be used by Zim executables when connecting to a particular database. The rules to create names are the same as Zim uses: maximum 18 characters long, but no special characters. The name is not case sensitive;

<location of the database> is the exact place in the network where the database resides. When Zim Server starts, it checks for the existence of the database and performs some actions before allowing the first user to connect to it.

All three parameters above cannot be repeated in the same configuration file.

An example of zimdb.zim file is:

% 1;MyTest;c:\mytest\xxx    % This database is ignored by Zim Server

22;Example;/usr/zim/example

12;sales;t:\databases\sales

Zim Backup Configuration File

The Zim backup configuration file tells Zim Backup Server what are the databases that are going to be backed up. Its structure is exactly the same as described in the databases configuration file and it is located in the operating system directory where the Zim software was installed (on Unix, this place is called $ZIM).

Foreign Directories Configuration File

The foreign directories configuration file informs where Zim can find a foreign directory in case of an ACCESS command is issued.

This file (dirs.zim) is located in the database directory and is read by Zim Server upon its start only.

Each entry in the foreign directories file has the format:

<dirid> <file number> <path>

where

<dirid> is the DirId of the foreign directory as defined in the entity set Dirs;

<file number> is the number of the file that corresponds to the directory in the host database (i.e. nnnn to zimnnnn);

<path> is the location where this directory can be found together with the correspondent zimnnnn.ws directory.

For example, the entry

23 126 \usr\tools

means that the directory whose DirId is 23 can be found in the file \usr\tools\zim0126

Areas Configuration File

The areas configuration file enables the distribution of Zim database files within the limits of the network. Its main purpose is to relocate files to places different from where the database is sitting. A good example is to move a very large Zim file to another disk drive, thus spreading disk activity to more than one physical disk.

Zim files that can be referenced by the areas configuration file are those corresponding to entity sets, relationships, directories and compiled application programs.

The areas file areas.zim is located in the database directory and it is read by Zim Server upon its start only.

Entries in the areas file indicate the locations to which particular files were distributed, one entry per line, and each entry must take the form:

<nnnn> <path>

where

<nnnn> is the number taken from the file name (i.e. ZIMnnnn) of the file that corresponds to the desired directory, entity set or relationship.

<path> is the name of the operating system directory where file ZIMnnnn is to be found. If ZIMnnnn is a file that stores a Zim directory, then <path> is also the location where the operating system sub-directory for compiled application programs (ie ZIMnnnn.WS) is found.

<path> can be preceded by three of the same special relocation prefixes used with document file names (see special document file names). The table below describes the meaning of the prefixes when used with path.

Prefix and Path Interpretation
)path The user's work directory path is added to the front of path.
"path The user's database directory is added to the front of path. This choice is useful when you are working with foreign directories.
#path The directory defined by the Zim environment variable in the registry.

It's only needed to specify entries for Zim files that need to be relocated. Zim files not referenced will be assumed to be in the usual place, that is, the database directory.

An example of areas.zim file:

0103 c:\databases\example   % the file is found in c:\databases\example\zim0103

0250 "                      % the file is found in <database directory>\zim0250

Servers Alias Configuration File

Zim enables you to connect to more than one SQL server at the same time. This allows you to do join operations between different databases on different machines managed by different database servers. No support for distributed concurrency control is available; updates which span multiple servers, though permitted, should be performed with care.

As shipped, Zim is configured to support one connection to each server type (either ZIMSERV or JDBCSAM) by default. You can re-configure Zim to enable multiple concurrent connections to different instances of the same server type like the following examples.

In an environment with two different machines where each one is servicing one or more Zim databases via ZimServer, if a Zim application needs to retrieve data from both servers at the same time, it would have to connect to both servers with different connection parameters. For Zim, both servers would have the same "ZIMSERV" identification which would be misleading. In this case, one of the servers could still be identified as "ZIMSERV" whereas the other one would receive an alias name like "ZIMSERV2" or any other proper name. Now, both connections can be performed at the same time and data retrieval will be correctly performed.

The same line of thought happens when there are a mixture of more than one SQL database servers and/or ZIM Servers.

This file is a regular text file that can be maintained by any regular text editor where each line of the file contains the following information:

 

Option Interpretation
server number Any number between 2 and 255 with the exception of 15 and 16 for backwards compatibility.
server type The type of the server: it can be either  "ZIMSERV" or "JDBCSAM".
alias name name other than "ZIM", "ZIMSERV" and "JDBCSAM" to identify the alias of a server.

 

At ZIM installation, this file does not exist but it is assumed to have the following three fixed entries (that is why 1, 15 and 16 cannot be used for a new alias):

 1 ZIM     ZIM
15 ZIMSERV ZIMSERV
16 JDBCSAM JDBCSAM

If a new alias should be created, a single line can be placed in "zimalias.zim" like this:

25 ZIMSERV ZIMSERV2
33 JDBCSAM MYJDBC

In the examples above, the string "ZIMSERV2" is the alias for "ZIMSERV" and the string "MYJDBC" is an alias for "JDBCSAM".

If the entries 1, 15 and 16 are also placed there, they will be ignored.

Notice that each information is separated by spaces and, therefore, no information can contain spaces in it. The server type and alias name strings cannot exceed 8 characters in length.