Creating the Example Database
BSQL input files are included in the Mimer SQL distribution which will create and then manipulate data in an example database.
The "crehotdb.sql" file creates the data structure for the example database and the "examples.sql" file contains various operations to manipulate data in the example database.
Before the data structure in the example database can be constructed, the initial database environment must be created according to the instructions given earlier in this chapter.
In the examples below the database named "HOTEL" will be the database wherein the example environment will be created:
On VMSBSQL HOTEL Username: SYSADM Password: SQL> READ 'MIMEXAMPLES8:CREHOTDB.SQL'; SQL> EXIT;
On UNIXbsql hotel Username: SYSADM Password: SQL> read 'crehotdb.sql'; SQL> exit;
Note: On UNIX, the command mimexampledb is available for creating the example environment (see the mimexampledb man-page).
On Windowsbsql hotel Username: SYSADM Password: SQL> read 'crehotdb.sql'; SQL> exit;
The "examples.sql" file contains various SQL and PSM statements which may be examined and executed interactively, statement by statement, in order to follow the operations being performed.
Many of the operations are presented as examples in the accompanying Mimer SQL User's Manual so they may be studied interactively in conjunction with reading the manual. See also the "cjdate.sql" file.
Removing a Database
To remove a database, perform the following steps:
- Check that no one is using the database, and that no database server is started against the database you are going to remove.
- Create a list of all databank files by doing the following:$ bsql -s database Username: SYSADM Password: xxxxxx SQL> SELECT DATABANK_FILENAME FROM SYSTEM.DATABANKS; SQL> EXIT;
UNIX: For a UNIX installation, databanks can be located in any directory specified in the path list given for the local database definition in:
- Using the list generated in the previous step, locate and delete all the physical databank files. If no directory is specified, the directory will be the home directory of the database, see The Local Database. Delete any directories that have been specifically created to hold databank files for the database.
- Remove the database from the list of accessible databases, see Making the Database Accessible. This will involve deleting it from the list of local databases on the node where it resides and deleting the remote database definition created for it on each other network node from which it was made accessible.
- If any database-specific commands have been added to a system startup or shutdown file, these should be removed.
Upright Database Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40