ReadMe - FrontBase 5.x on Mac OS X

1. Introduction
2. The components of a FrontBase configuration
3. The innards of a FrontBase installation
4. Download and installation
5. Post installation
6. sql92 - super brief introduction
7. Getting started
7.1 The MacOSX FrontBaseManager
7.2 The sql92 command line tool
8. Transactions - please read
10. Documentation

1. Introduction

FrontBase is a high performance, scalable, SQL 92 compliant relational database server created in the internet age for universal deployment.

2. The components of the FrontBase configuration for Mac OS X

a) FBExec The FBExec is a service background process that is typically started automatically when the computer is restarted. The FBExec provides status, management and access information to all client applications.
b) FrontBase FrontBase is the actual database server. There is a FrontBase process running for each running database. A FrontBase process is typically started by various management applications, but can also be started from the command line.
c) sql92 A command line tool for managing and accessing databases. sql92 will let you create, start and stop databases, connect to databases, and execute SQL statements.
d) FBTLogs A command line tool for summarizing the transaction log of a database.
e) FBTLog A command line tool for displaying (portions of) the transaction log of a database as SQL statements.
f) FBReplicator The replication daemon distributing transactions from a replication master to its replication clients.
g) FBRAccess A command line tool for inspecting and managing a replication setup.
h) FBKeyGenerator A command line tool for generating encryption keys.
i) FBChangeKey A command line tool for changing the encryption of a database.
j) FBInfoCenter A command line tool which prints out details about your FrontBase installation and your machine.
k) FBCAccess A C library providing the API that allows client applications to administrate and connect to FrontBase databases.
l) FBAccess A Cocoa framework providing the API that allows Cocoa applications to administrate and connect to FrontBase databases.
m) FrontBaseManager A Cocoa application for managing databases, database schemas and content. The FrontBaseManager also contains an "sql92" functionality; i.e. SQL statements can be sent to a FrontBase database for execution. Please note that the FrontBaseManager can manage databases on all hosts in a network with a FrontBase installation.

3. The innards of a FrontBase installation

FrontBase is installed into a number of directories on the target computer system. The core installation directory (FrontBase home directory) for Mac OS X is /Library/FrontBase.

The subdirectory structure of the core installation directory is as follows:

   Backups         Default backup directories, one for each database
   Collations      Collation files
   Databases       Database main files and database specific files like SQL log files, cluster description files, etc
   Library         Files used by the FrontBase server process
   TransactionLogs Transaction log directories, one for each database
   Translations    Translation files
   bin             The executable components
   include         Header files for e.g. the FBCAccess library
   lib             Client side libraries.

The Mac OS X specific components are installed in:

   FrontBaseManager      /Applications
   FBScripAgent          /Applications
   FBUnicodeManager      /Applications
   FBAccess              /Library/Frameworks
   FBCAccess             /Library/Frameworks
   FrontBaseEOAdaptor    /Library/Frameworks

4. Download and installation

The latest version of FrontBase can always be downloaded from the Download area of the FrontBase Web site.

Once you have downloaded the .dmg file, locate the file according to the preferences of your browser. The .dmg file is expanded with the disk utility to a .pkg file, by selecting the .dmg file and double clicking. To install the .pkg, select the file, double click, and the Installer will be launched, ready to install FrontBase. The Installer will provide you with further directions.

Please note that the FBExec is installed to be automatically started when the computer is restarted. The FBExec is also started as part of the installation process, i.e. there is no need to restart the computer after installation.

5. Post installation

Once you have installed FrontBase it is a good idea to include /Library/FrontBase/bin in the search path of the various accounts that will use the FrontBase tools. This step is not necessary, but it can make your command line tool life easier.

There is no need to restart the computer after an installation, but it is a good idea to verify that the FBExec process is running by doing (from a terminal window):

   ps axc | grep FBExec

which should produce output like the following example:

   374 ? S 0:00 FBExec

If for some reason the FBExec isn't running, try to launch it from the command line:

   /Library/FrontBase/bin/FBExec &

In case of problems, you can e-mail support@frontbase.com and ask for help.

6. sql92 - super brief introduction

sql92 is an interactive command line tool which allows you to manage and access all databases in the network. sql92 is launched by issuing the following shell command:

   /Library/FrontBase/bin/sql92

To create and start a database:

   sql92> create database firstdb;

To connect to a database:

   sql92> connect to <database-name> [on <host-name>] [user <user-name>];

If you omit the host name, the current host name is used, and if the user name is omitted, the login name is used.

Always terminate sql92 commands with a ';'.

Quit sql92 by entering quit<enter> or by pressing Ctrl-D.

The sql92 help command:

   sql92> help;

will print a summary of the available sql92 specific commands.

7. Getting started

7.1 The MacOSX FrontBaseManager

Locate the FrontBaseManager application (in /Applications) and double-click on the icon to launch it.

1. Click on the "File" menu, and then "New Database" (File -> New Database).
2. Provide a name for your new database and click "Create".
3. Double click the new database icon which appears in the Monitoring Window (this starts a connection).
4. Click "Open" at the Open Database Window (using the default login settings).
5. In the SQL Interpreter text view which comes up, type: values(server_name);
6. Click the "Execute SQL" button.
7. Close the database connection window.
8. Select your new database in the Monitoring Window and click the "Stop" button. Confirm.
9. Now click the "Delete" button. Confirm.

Congratulations! You have just created a database, connected to it, performed a simple fetch, stopped, and deleted it. It is as simple as that!

7.2 sql92 command line tool

First open a terminal window and launch the sql92 tool:

   /Library/FrontBase/bin/sql92

Enter the following sql92 commands (the semicolons are important):

   create database firstdb;
   connect to firstdb user _system;
   create user test;
   commit;
   disconnect current;
   connect to firstdb user test;
   values(server_name);
   disconnect current;
   connect to firstdb user _system;
   stop database;
   delete database firstdb;

Congratulations! You have just created a database, connected to it three times, created a new user, committed a transaction, and deleted a database. It is as simple as that!

8. Transactions - please read

A transaction is a grouping of a sequence of SQL statements into a unit; execution of the unit as a whole either succeeds completely, or, if one of the commands fails or is a ROLLBACK command, the database is left unchanged.

Transactions are initiated automatically by the server when needed. Most SQL statements need a transaction. A COMMIT or a ROLLBACK command ends the current transaction.

Most of the FrontBase tools use, as default transaction settings, SERIALIZABLE, WRITE, PESSIMISTIC, which has the consequence that access to referenced tables is effectively serialized.

The user may change the defaults according to the SQL 92 specification.

When you are working with the FrontBase tools, you should always remember to COMMIT or ROLLBACK transactions in order not to block access to the database.

If you try to access a table and it seems that your application or tool doesn't do anything, it is most likely waiting for some other session to COMMIT or ROLLBACK an active transaction. Neither your application/tool nor the FrontBase server is hanging!

FrontBase offers a feature called AUTO COMMIT, i.e. a way to tell the server that it should automatically commit each statement that is successfully executed. The sql92 command line tool uses, as default, this feature.

You can control the AUTO COMMIT feature by executing the following statements:

   SET COMMIT FALSE; -- Turns off AUTO COMMIT
   SET COMMIT TRUE;  -- Turns on  AUTO COMMIT

10. Documentation

The documentation for the FrontBase database server can be downloaded from the Documentation area of the FrontBase Web site.

Please take the time to peruse this documentation, so you at least have a good feeling for what's in there.