!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> Databasteknik: Getting started with Mimer

Databasteknik: Getting started with Mimer

We have a Mimer server set up and running for use in this database course. The Mimer server happens to run on a Linux machine, and the clients at the university run on Windows computers, but, like most large database management systems, Mimer can be run on a number of operating systems: Linux, Windows, macOS and some others.

Installing the Mimer software

Mimer is already installed on the lab machines at the university, but if you wish to use Mimer on your own computer, either from home or at the university, you can go to developer.mimer.com and download a Mimer development version for, among other choices, Windows, macOS or Linux. If you install this on your own computer at home, you can do the lab assignments from home, either by connecting to our Mimer server or by creating your own local database and using that.

To download the Mimer software, you will have to fill in your e-mail address, and they will then send you a download link.

I have experienced that the Mimer web sites mimer.com and developer.mimer.com can be extremely slow in Firefox. When I turned off tracking protection for both sites, it worked better.

Your database

We have created a database called dbk on the server. Each student will receive a login name (for example dbtek74) and a password.

Note: Some details, such as Mimer's version number, can be different here from what you will see on your computer.

Getting started on a Windows machine

This was tested on November 23, 2023 with Mimer SQL 11.0.7B Windows (64-bit) on Windows 10 Pro.

For running Mimer on a Mac, see the notes below.
For running Mimer on Linux, see the notes below.

If you are using the University's lab machines, Mimer is already installed. If you are using your own Windows computer, you must first download and install Mimer, as usual with Windows applications. The installation file I used here was called MimerSqlX64Windows1107b.exe.

To connect to a Mimer database, such as the one on our server basen.oru.se, you must tell the local Mimer installation that the database exists.

Click on the Windows symbol to open up the "start menu", scroll down to Mimer SQL 11.0.7B (but maybe with the version you have installed, instead of 11.0.7B) and choose Mimer Administrator from the menu. When Mimer Administrator has started, choose the tab Remote to register a remote database:

The Mimer Administrator window

That the database is "remote" means that it is stored on a server, and not locally on the same machine.

The database dbk may already be listed, but if it isn't, you have to add it. Click on File and then on Add:

The Mimer Administrator window

In the Window that appears, enter the name of the database (dbk). The Node name should be basen.oru.se. If you are doing this on the university computers, you might not have permission to create system data sources, and in that case uncheck the check box for Create System Data Source.

The Mimer Administrator window

You can click Test to test that the server can be reached and is responding, but then click OK.

When you click OK, the new database will show up in the Mimer Administrator window. You can now close that window.

The Mimer Administrator window

If you get an error message saying Error creating data source something, you forgot to uncheck Create System Data Source. Mimer will work anyway.

Creating a local database

The section above describes how to create a remote database. That is fairly simple, since the database already exists on the server, and all we do is tell Mimer that it is there. We can also create a local database, on the same machine. That is more complicated, since we actually have to create the database.

The Mimer Administrator window

Click on File and then on Add:

The Mimer Administrator window

In the Window that appears, enter the name of the database (dbk). The Home Directory should be a directory (or "folder") on your machine that Mimer will use to store the data in the database.

The Mimer Administrator window

Keep clicking Yes and Next to everything, until you get to Finish and the process is finished. The final window will look like this:

The Mimer Administrator window

Now you can connect to the database and start giving SQL commands. There are two ways to connect to a Mimer database using SQL:

Running SQL using Mimer's Batch SQL

Click on the Windows symbol to open up the "start menu", scroll down to Mimer SQL 11.0.7B (but maybe with the version you have installed, instead of 11.0.7B) and choose Batch SQL from the menu. You will now get to choose which database to connect to:

Choosing a database for Mimer Batch SQL

Choose the correct database, and click on OK. A text window will open, where you can enter your user name and your password for that thatabase, and then type in SQL queries. Queries can span several rows, and must end with a semi-colon (;).

The Mimer Batch SQL windows

On macOS and on Linux, you should instead open a terminal window, and give the command bsql in that Window. Add the database name as argument to bsql:

The Mimer Batch SQL windows

DbVisualizer

Mimer's Batch SQL is good for batch use, when you have a file of SQL commands that you want to run, but it is a bit cumbersome for interactive use, especially with large queries that don't fit on one row. An alternative is to use DbVisualizer, which is a Java-based tool that simplifies the interaction with the database.

On Windows, start DbVisualizer from the start menu: Click on the Windows symbol, scroll down to Mimer SQL 11.0.7B, and choose DbVisualizer from the menu. (For Mac, see below. For Linux, see below.)

The DbVisualizer window looks like this:

DbVisualizer

Since DbVisualizer is a Java-based program, you might have to install the Java runtime environment. In that case, a window similar to this will open the first time you start DbVisualizer:

DbVisualizer

Click Install, and complete the Java installation.

The first time you start DbVisualizer (or later if you deliberately run it) the New Connection Wizard will open, to help you configure DbVisualizer for connecting to a database:

DbVisualizer

Enter the name of the database connection (for example dbk) and click Next.

You also need to select which "JDBC driver" (a plugin program that helps a Java program connect to the datbase) to use for this connection. If this is the first time you have started DbVisualizer, it probably runs the "JDBC Driver Finder" automatically, showing up in a separate window looking like this:

DbVisualizer

You can just close that window. The connection wizard has a step where you select which driver to use:

DbVisualizer

The driver is specific to each DBMS, and you should use the one for Mimer. If you are using the standard DbVisualizer that is included with the Mimer download, that is the only driver available.

DbVisualizer

Finally, fill in the database server (basen.oru.se if you are using the university's server and not your own local database), the database (dbk), and the user name (for example dbtek42) and password that you have received:

DbVisualizer

You can click Ping Server to test that the connection works:

DbVisualizer

Finally, click Finish to complete the configuration of the database connection. Now you can use DbVisualizer's main window:

DbVisualizer

The green arrow with a plus sign creates a new "SQL commander tab", which is a frame where you can type and run SQL queries. In the free version of DbVisualizer, you can only have one at a time.

The three green arrows below are used to run the query in the SQL commander tab. You can keep the mouse still over them ("hover") to get help pop-ups that tell what they do.

DbVisualizer

ODBC Data Sources

In order to use ODBC, you need to define an ODBC data source.

(The images in this sections are from an older version of Mimer, but more recent versions are very similar.)

Click on Start, then on All Programs, then on Mimer SQL Engine 10.0, and choose Mimer Administrator from the menu. When Mimer Administrator has started, choose the tab User DSN to create a data source:

The Mimer Administrator window

A user data source can only be used by the user who created it, as opposite to a system data source, which can be used by anyone.

Click on the Add to create a new user data source.

The Mimer ODBC Data Source Setup window

Finally, click OK, and see how the new data source shows up:

The Mimer Administrator window

ODBC data sources can also be managed centrally in Windows, using the ODBC Data Source Administrator in the control panel. The newly created data source shows up there too:

The ODBC Data Source Administrator window

Mimer documentation

There are more manuals than you ever wanted at Mimer's developer web site, among them the full documentation for Mimer SQL 11.0 and 10.1 (which we still run on basen.oru.se), plus a number of specific articles, such as "Getting Started on Windows" and "Getting Started on Linux". Among other things, you can look up the exact syntax for each SQL command.

On Windows, you can get the documentation in a standard Windows help window. Click on the Windows symbol to open up the start menu, scroll down to Mimer SQL 11.0.7B, and click on Mimer SQL Documentation.

There is an FAQ list too.

Mimer on macOS

When I write this (January 2024), you can use both remote and local databases on a Mac, and you can use both Batch SQL and DbVisualizer to connect to them. DbVisualizer might require some extra work before it works.

This was tested on January 19, 2024 with Mimer SQL 11.0.8B on a Mac Mini with an M1 processor and macOS Sonoma 14.2.1. It is supposed to work on older x86 macs too, but I haven't tested that yet.

On a Mac, start by downloading and then installing Mimer, as usual with Mac applications. The installation file I used here was called mimersql1108-11.0.8B-43512_macos.pkg.

If macOS refuses to open the installation file, with a warning that this app is not verified, you can hold down the Control key when clicking.

To let your local Mimer installation know of the University's database server at basen.oru.se, open Terminal and give this command:

sudo mimhosts -r dbk basen.oru.se

You can then connect to this database, for example starting Batch SQL with the command bsql dbk in a Terminal window. It does not work to start Batch SQL using the normal graphical interface, with Spotlight or by clicking on icons. You can then connect to this database, for example starting Batch SQL with the command bsql dbk.

After this, you can also create a local database, which is stored an managed on your own computer, and no connection to basen.oru.se is needed. Use this command:

dbinstall lokaltestbas

You can then connect to this database, for example starting Batch SQL with the command bsql lokaltestbas.

This command does not create a "databank", where Mimer stores its tables and data, so you must also log in as sysadm with the password you entered to dbinstall, and create a databank:

CREATE DATABANK mybank OF 1000 PAGES IN 'mybank.dbf' WITH LOG OPTION;

Instead of Batch SQL, you can use the tool DbVisualizer, but I had to download a version from www.dbvis.com instead of the one that came with Mimer:

Dbvisualizer on a Mac

Mimer on Linux

This was tested on November 23, 2023 with Mimer SQL 11.0.7D on Ubuntu 22.04.3 LTS.

On a Linux machine, start by downloading and then installing Mimer. If you are on a Debian-based Linux distribution, such as Ubuntu, it is probably easiest to download the .deb package file. The one I have used here was called mimersql1107_11.0.7D-40465_amd64-openssl3.deb.

To install Mimer, give this command in a shell window, after having changed to the directory where you placed the downloaded file:

sudo dpkg -i mimersql1107_11.0.7D-40465_amd64-openssl3.deb

To let your local Mimer installation know of the University's database server at basen.oru.se, give this command:

sudo mimhosts -r dbk basen.oru.se

You can then connect to this database, for example starting Batch SQL with the command bsql dbk.

After this, you can also create a local database, which is stored an managed on your own computer, and no connection to basen.oru.se is needed. Use this command:

dbinstall lokaltestbas

You can then connect to this database, for example starting Batch SQL with the command bsql lokaltestbas.

This command does not create a "databank", where Mimer stores its tables and data, so you must also log in as sysadm with the password you entered to dbinstall, and create a databank:

CREATE DATABANK mybank OF 1000 PAGES IN 'mybank.dbf' WITH LOG OPTION;

Instead of Batch SQL, you can use the tool DbVisualizer. You can start it with this command:

dbvis-mimer-1107

DbVisualizer is a Java program, so you may have to install a Java environment first, for example with these commands:

sudo apt update
sudo apt upgrade
sudo apt install openjdk-17-jre


Thomas Padron-McCarthy (thomas.padron-mccarthy@oru.se), January 19, 2024