Product Documentation

SQL Operations Guide

Previous Topic

Next Topic


Welcome to the FairCom DB database server. You have just installed the same great database technology that powers many of the world’s largest transaction systems. Unlike other complicated database servers that require ongoing administration and extensive hardware resources, FairCom DB is designed to be simple to install with minimal disk and memory requirements and no ongoing maintenance. The FairCom DB database represents the next step in the evolution of FairCom's "c-tree" technology.

The FairCom DB server is the “Core Database Engine” that powers your application. It is easily installed and managed as an operating system service. Once installed, this engine is readily accessible to all applications, either running locally or remotely on other devices or computers (desktop, notebook, phones, handhelds, PDAs, etc.).

FairCom DB is designed for ease of operation and maintenance. Simply set your options and forget about it. FairCom DB will run reliably for long periods of time with little if any administrator attention.

This short guide introduces the most basic features the FairCom DB and is intended to have you up and running in minutes. You are encouraged to review the complete manuals for the most up-to-date information available.

In This Chapter

Up and Running with the FairCom DB Database Engine

FairCom DB SQL Operational Files

Previous Topic

Next Topic

Up and Running with the FairCom DB Database Engine

File Locations

You will find your FairCom Server in the \server directory of your FairCom installation.

You will find your tools and utilities located in the tools\ directory of your FairCom installation.

The License Authorization File is a binary file containing unique licensing information assigned by FairCom. This licensing information permits the FairCom Server technology to operate on a specified operating system, to support specific features, to support a fixed number of concurrent users and/or connections to the FairCom Server technology, and to utilize a fixed number of CPUs on the host machine.

The license file is named ctsrvr-<SN>.lic where <SN> is the unique Serial Number assigned to your server instance and provided by FairCom. This file will need to be properly placed in the same directory where the FairCom Server binary is located, for example:


If this licensing file isn’t present, you'll receive a 960 error in your CTSTATUS.FCS status log upon startup:

"LICENSE ERROR: License initialization failed: Missing license file."

The Developer/Professional edition of the FairCom Server includes a ctsrvr-<SN>.lic file configured to support up to 32 concurrent connections and can operate on up to 2 concurrent CPU cores (as reported by the operating system which may include physical CPUs, CPU cores, or virtual CPUs assigned to a partition).

Development servers are licensed exclusively for development and testing purposes and only by the developer who is the license holder. They are expressly not authorized for production use. Should you need additional licenses for testing or if you wish to test with a license file supporting a greater number of connections or CPUs, please contact your nearest FairCom office.

When purchasing a production FairCom Server license, you will receive a ctsrvr-<SN>.lic file via e-mail, along with a “Proof of Entitlement” document that summarizes the configuration of your FairCom Server license file.

SQL Port and IPv4 vs IPv6

The SQL port defaults to 6597 unless changed via the SQL_PORT keyword in ctsrvr.cfg. This port must be unused and available or you may see "SQL subsystem initialization failed" in the CTSTATUS.FCS file.

Be sure to verify that the server is not trying to set up an IPv6 port when it should be using an IPv4 port (see IPv6 Support).

Starting the FairCom DB

There are many options to start the FairCom DB Server depending on your platform.


  • As a Windows Service
    • The Windows Service Manager - If you installed the FairCom DB on a Microsoft Windows system, it is installed and started by default through the installer. You can verify and manage server operation via the standard Windows service application via your administrative control panel application.

    • The sc start (or net start) command-line function. Use one of the following depending on your product:

    >sc start "FairCom-DB"

    >sc start "FairCom-EDGE"

    >sc start "crteeRTG"

  • As a Console or ToolTray Application - Simply double-click the executable in the ace/bin/sql directory.

    Note: When connecting via a network, be aware that the TCP/IP port should be allowed by any local firewalls. Many modern operating systems include these security features by default. If you cannot connect with remote clients, you may need to specifically allow the FairCom Server port.


Unix, Linux, and Mac OS X users can use the included start scripts.

  • ./startace

This script is provided as a "C" shell script and will work in most Unix shell environments. You are free to modify and tailor it to suit your local requirements.

c-treeACE Scripts

Stopping FairCom DB

By default, the FairCom Database Engine requires an administrator password to initiate a server shutdown. The default (and permanent) administrator account is ADMIN with an initial default password of ADMIN.

The Windows Service does not require the administrator password as it is assumed the FairCom Database Engine is running under administrative privileges.

Note: If the Replication Agent is running on a server, replication should be stopped before trying to stop the server. If replication is running when you attempt to stop the server, you may see error 792 (External server shutdown disabled).


  • FairCom DB Monitor - Use the FairCom Monitor tool for Windows and stop the server.
  • Windows Service - Select and stop the FairCom service via the windows service administrator.
  • ToolTray - Right-click on the tool tray icon and select the appropriate shutdown option.
  • Console - Exit the console application via the menu or the standard Windows "X" in the corner.
  • ctadmn - The FairCom DB Administrator utility provides an option to shut down the server.
  • ctstop - The FairCom DB stop utility can be used to shut down the server.
  • The sc stop (or net stop) command-line function. Use the command for your product:

    >sc stop "FairCom-DB"

    >sc stop "FairCom-EDGE"

    >sc stop "ctreeRTG"

Unix, Linux, and Mac

  • ctadmn - The FairCom Administrator utility provides and option to shut down the server.
  • ctstop - The FairCom stop utility can be used to shut down the server.
  • ./ctstop - A Unix shell script pre-configured to stop the server.
  • Kill the server from a Unix command line. The FairCom Database Engine traps the SIGSTOP signal.

    #kill <FairCom-DB PID>

Links to FairCom DB Manuals

For complete information, view the online manuals:


Previous Topic

Next Topic

FairCom DB SQL Operational Files

There are several key file components unique to the FairCom DB SQL Server when compared to the traditional NoSQL (ISAM) version.

FairCom DB SQL requires additional dictionary files to enable the required relational features of SQL. In particular, sessions and databases are maintained in dictionary files. These files are located in the following hierarchy of the server's operating environment, typically located by default in /bin/ace/sql/data.

  • ctdbdict.fsd - The main session dictionary file. If you remove any SQL databases from the server, you need to either remove this file, or ensure that it is properly updated. The appropriate way to drop a database and ensure the session dictionary is updated is to use the SQL Explorer utility, or the command line ctsqlcdb utility.
  • ctreeSQL.dbs/ - The directory containing the SQL database files and dictionaries. All new tables and indexes associated with this database will be created in this directory. Use the SQL Explorer utility, or the command line ctsqlcdb utility to add new databases.
  • SQL_SYS/ctreeSQL.fdd - This file location is the SQL database dictionary, or also known as the SQL system tables. It is NEVER appropriate to directly modify this file. The system tables are stored as a single c-tree superfile along with the database dictionary.
  • sql_server.log - This file will log specific SQL messages when the appropriate debug flags are enabled. In particular, this file is useful for tracing Java Stored Procedure compile time errors. Java Stored Procedure can also log messages to this file at run time with the err() method.