Generating the Mimer SQL System Databanks
The Mimer SQL system databanks SYSDB, TRANSDB, LOGDB and SQLDB are generated by the SDBGEN program.
SDBGEN will load the system tables, see Data Dictionary Tables, and defines the data dictionary views detailed in the Mimer SQL Reference Manual.
Note: A databank created for one SYSDB cannot be accessed by using a different SYSDB even if identical data dictionary definitions are created in it.
Setting the Initial Size
The initial size for each of the Mimer SQL system databanks can be specified.
The size for the databanks is specified in Mimer SQL pages. The size of a Mimer SQL page is 2 kilobytes.
Setting Password for System Administrator
The database administration ident SYSADM is also created and a password (passwords are case-sensitive) must be specified for this ident.
For security reasons, the password specified for SYSADM is not echoed on the screen when it is entered. It should be chosen carefully and changed at appropriate intervals using Mimer SQL with the ALTER IDENT statement.
UNIX: A local database is set up on a UNIX node by running the dbinstall command (see the dbinstall man-page) and SDBGEN is started automatically when required.
The databank files are by default created in the database home directory which is not the ideal arrangement from a security and performance point of view, see Re-creating TRANSDB, LOGDB and SQLDB for guidelines relating to placement and organization.
If there is more than one disk available on the system, it is recommended that directories be created on those disks specifically for locating databanks. When created, the LOCAL definition for the database should be updated in the
/etc/sqlhosts file by changing the single home directory path to a directory path list that includes these directories. The list is colon separated as can be seen in the following example:
VMS: In order to create the Mimer SQL system databanks for a local database on an OpenVMS node, an entry for the database must be specified in the SQLHOSTS file. SDBGEN should then be executed to create the actual database. See SDBGEN Syntax for information on how to run SDBGEN.
Win: You set up a local database on a Windows node by running the Mimer Administrator. The Mimer Administrator invokes the SDBGEN program in order to create the system databanks when required.
The SDBGEN command has two purposes. Either to create a new set of system databank files, or to upgrade database files created in an earlier version of Mimer SQL to version 9.2.
The SDBGEN program is controlled by flagged information specified on the command-line.
The syntax (expressed in VMS-style) for creating databank files is as follows:SDBGEN [/PASSWORD=passw] [dbase] [syssz] [tfn] [tsz] [lfn] [lsz] [sfn] [ssz]
sdbgen Command-line Arguments
When creating databanks files:
Password for SYSADM Database name Size of SYSDB Filename for TRANSDB Size of TRANSDB Filename for LOGDB Size of LOGDB Filename for SQLDB Size of SQLDB
If the password parameter is omitted, the SDBGEN command will prompt for all parameters that are missing, including the password for the SYSADM user.
If the password parameter is given, the SDBGEN command will not prompt for any missing parameters, but use default values.
If the dbase parameter is missing, the environment variable MIMER_DATABASE is used to determine which database the databank files should be created for.
The SDBGEN program syntax (expressed in VMS-style) for upgrading databank files to Mimer SQL version 9.2 is as follows:SDBGEN /UPGRADE [dbase]
Establishing the Ident and Data Structure
Once the local database environment has been created for a Mimer SQL database (database name, server parameters, system databanks, the SYSADM ident plus the system tables and views), the data structure for the database (idents, user databanks, tables, and so on) can be created using Mimer SQL data definition statements.
Mimer BSQL allows the execution of a sequential file which can then be used as a permanent record of the CREATE statements used to create the database objects, see the Mimer SQL User's Manual, Mimer BSQL.
Mimer BSQL also supports the saving of input and/or output to a log file (using the LOG command), so this facility could be used to create a permanent record of an interactive Mimer BSQL session which could be run again at a later date. Mimer BSQL, however, only has limited support for error handling.
An application program using embedded SQL (ESQL), JDBC or ODBC can also be used, but this requires more work on the part of the programmer and it provides a less concise record of the ident and data structure in the database.
Third party SQL tools are also available which may be used to create the database data structure.Caution: A sequential file intended for non-interactive execution in Mimer BSQL can include user name and password information relating to any CONNECT statements used. For security reasons, such a file should be well protected in the operating system, preferably with any user name and password edited out of any permanent copy of the file.
The Example Database
An example database is delivered with Mimer SQL. It is owned by the ident MIMER_STORE and contains various objects to be able to describe and demonstrate functionality in Mimer SQL. For details about the example database see the feature description `The Example Database' on the Mimer SQL developer site,
The example database is based on a store that sells music and books, available in various formats, for example a music album may be available in Audio CD, Cassette, DVD Audio, and Vinyl. The store also has a web site, through which users can place orders. SQL stored procedures (SQL/PSM) support various aspects of the business logic.
The example database forms as the basis for examples given in the Mimer SQL documentation Set
The example database can be created manually by using the exload program, described in the next section.
The exload program
By using the exload program the example database can be created or removed. (The example database can also be removed by dropping the MIMER_STORE ident from any SQL command tool).
When the example database is installed default values are provided for passwords on idents and for databank file names. These default values can be changed by using the ALTER command after the installation is completed or by explicitly give names as command line arguments to the exload command, see the exload syntax below.
The exload syntax
The exload syntax (expressed in Unix-style) files is as follows:usage:exload [-s|-m] [-f|-r] [-p SYSADM-password] [database] -s Single-user mode database access -m Multi-user mode database access -f Forced install (overwrites existing environment) -r Remove the example environment -p passw Password for SYSADM database Name of database to access When creating the example database it is possible to change the default values for passwords and filenames. This is done by adding parameters after the 'database' parameter (that must be given in this case). These optional parameters must be added in the following order: [MIMER_STORE-password [MIMER_ADM-password [MIMER_USR-password [MIMER_WEB-password [MIMER_STORE-databank-filename [MIMER_ORDERS-databank-filename [MIMER_BLOBS-databank-filename]]]]]]]
Exload Command-line Arguments
Single-user mode database access Multi-user mode database access Remove the example database Install the example database even if it already exists. The old environment is dropped. Password for SYSADM Database name Password for MIMER_STORE ident Password for MIMER_ADM ident Password for MIMER_USR ident Password for MIMER_WEB ident Filename for MIMER_STORE databank Filename for MIMER_ORDERS databank Filename for MIMER_BLOBS databank
All parameters to exload are optional.
If no command line arguments are given when using exload, the following will happen:
- A SYSADM password is needed and will be prompted for.
- Access mode and database name will be taken from MIMER_MODE and MIMER_DATABASE, respectively.
- If the example environment already is installed a question about how to continue will be raised.
- Default values are used for all example database passwords and filenames. The values used are displayed when the exload program is executed.
Mimer Information Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40