Databaskonstruktion: 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 we run the clients on Windows machines, but, like most large database management systems, Mimer can be run on a number of operating systems.

If you wish to try out Mimer at home you can go to www.mimer.com and download a Mimer development version for, among other choices, Windows or Linux. If you install this on your own computer at home, you can create your own databases, or you can connect to our Mimer server and do the lab assignments from home.

Your database

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

Getting started on our Windows machines

Log in on a Windows PC with your normal user name.

To connect to a Mimer database, you must first tell the local Mimer installation that the database exists.

Click on Start, then on Program, then on Mimer SQL Engine 9.1, 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

Click on Add, and in the Window that appears, enter the name of the database that you have been given. The Node name should be basen.oru.se. Be sure to uncheck the check box for Create System Data Source.

(You should use the database name dbk, not dbk17 as in the picture!)

The Remote Database Definition window

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

(Remember, you should be using the database name dbk, not dbk17 as in the picture!)

The Mimer Administrator window with the new remote database

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

Running SQL using Mimer's Batch SQL

Click on Start, then on Program, then on Mimer SQL Engine 9.1, then on Utilities, and choose Batch SQL from the menu. You will now get to choose which database to connect to:

(Again: you will connect to the database called dbk, not dbk17 as in the picture!)

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 (which you will get from your teacher), and then type in SQL queries. Queries can span several rows, and end with a semi-colon (;).

(In the picture, the DBA, who has the user name sysadm, has logged in. You should use the name you got from your teacher, for example dbk17.)

The Mimer Batch SQL windows

ODBC Data Sources

In order to use ODBC, and the query builder tool that is described below, you need to define an ODBC data source. This is done in Windows. Click on Start, then on Inställningar (in English: Settings). and choose Kontrollpanelen (in English: Control Panel). In the control panel, choose Administrationsverktyg. In the administration tool, choose Datakällor (ODBC). The ODBC administrator window opens.

(You can also open the ODBC administrator window from the Start meny by clicking on Start, then on Program, then on Mimer SQL Engine 9.1, then on Utilities, and then choose ODBC Administrator from the menu.)

Click on the tab Användar-DSN to create a user data source. A user data source can only be used by the user who created it, as opposite to a system data source, that can be used by anyone.

The ODBC administrator window

Click on Lägg till (in English: Add) to add a new user data source.

You must now choose which driver (Swedish: drivrutin) to use. ODBC allows you to communicate with many types of database management systems, but you must have a driver for each type of DBMS. Since you will be working with a Mimer database, we choose the Mimer driver, and click on Slutför (in English: Finish).

Create a new data source: Choose the driver

We must also give a name to the data source, and choose which of the Mimer databases that we wish this data source to be connected to.

Create a new data source: Choose name and Mimer database

Finally, click OK, and see how the new data source shows up in the ODBC administration window.

The ODBC administrator window, with the new data source

Click on OK to close the window.

QBE Vision Query Builder

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 QBE Vision Query Builder.

(This tool may or may not be installed on the computer you are using. If it isn't, you'll have to use BSQL, or some other tool.)

Start the query builder from the start menu: select Program, then Mimer SQL Engine 9.1, and finally SQL Query Builder. The query builder window opens:

QBE Vision Query Builder

Note that the query builder uses the data sources defined for ODBC, not the databases defined in Mimer Administrator, so to use the query builder you have to create an ODBC data source for your Mimer database. Read more in the section ODBC Data Sources above.

Double-click on the database you want to connect to. You will be asked for a user name (which could be sysadm, or someting else) and a password.

(Remember: The database is called dbk, not dbk17 as in the picture, and the user name is something like dbk17, not sysadm.)

Login dialog in the query builder

Click on OK to login to the selected database.

When you have connected to the database, you can type queries in the editor area to the right, and run them by clicking on the Run button.

Running a query in the query builder

Mimer documentation

Mimer's documentation is available on the Mimer web site.

Among other things, you can look up the exact syntax for each SQL command.


Thomas Padron-McCarthy (Thomas.Padron-McCarthy@tech.oru.se), November 7, 2005