2.3 Example of How to Add Mimer SQL
The following is an example of how you can include the Mimer SQL RPM file and the dbinstall script in your application's installation script to silently install Mimer SQL.
Note: Any script that is written to install Mimer SQL must be executed by root.. . # ------------- # Installation part for Mimer SQL # # Define a log file and abort actions LOG=$$mimsqlilog trap "stty echo; rm $LOG; exit" 2 3 15 # Execute rpm to install software. OK if log file is empty rpm -i MimerSQL-8.2.3B-3.i386.rpm > $LOG 2>&1 if [ $? -ne 0 ] then echo "Mimer SQL installation failed: rpm -i: `cat $LOG`" exit 1 fi # Installing the initial Mimer SQL database server # Database name is: appdb # Password: Given as argument to script ($1) # Home is: /usr/local/opt/MimerSQL # Transdb directory: /disk1 # Logdb directory: /disk2 # Sqldb directory: same as home # Database operator: root # PASSWD=$1 /usr/bin/dbinstall -s appdb $PASSWD /usr/local/opt/MimerSQL /disk1 /disk2 "" root > $LOG 2>&1 if [ $? -ne 0 ] then echo "Mimer SQL installation failed: dbinstall: `cat $LOG`" exit 1 fi # # Mimer SQL installation done, ready to continue! # ----------- . . .
2.3.1 Licensing Mimer SQL
By default, dbinstall installs a free, built-in Test & Development license key.
However, if you want to use Mimer SQL in production, you must have a production license key. Contact Upright Database Technology, see www.mimer.com for details on how to acquire the configuration file which contains the production license key.
Once you have the file, you must edit your application's installation script to install the configuration file.
The following is an example of how to edit your application's installation script. appdb_key.cfg is the configuration file used.. . . # Execute mimlicense to update the key file /usr/bin/mimlicense -f appdb_key.cfg > $LOG 2>&1 # Verify the mimlicense session if [ $? -ne 0 ] then echo "mimlicense failed, `cat $LOG`" exit 1 fi . . .
For more information on mimlicense, see the Mimer SQL System Management Handbook.
2.3.2 Loading Application Data
At this stage, the Mimer SQL database server is running and ready for multi-user access.
If you need to load application data you can do so by using the read command in the BSQL tool.
The following example shows how to load data using a shell script:. . . # Execute bsql to create schema and load application data /usr/bin/bsql <<-% > $LOG sysadm $PASSWD READ 'appsschema.sql'; READ 'appdata.sql'; EXIT; % # Verify the bsql session if [ $? -ne 0 ] then echo "bsql failed, `cat $LOG`" rm $LOG exit fi . . .
Note: In the example above, we are assuming that database is the system default database. If it is not, you must specify the database name as an argument in BSQL.
You can use the command: "mimhosts -d database_name" to set a database as the system default.
Upright Database Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40