The Cego database system

Users guide ( covers cego version 2.6.12 )

by Bjoern Lemke, 05.09.2010

Cego comes under the GNU Copyright
(C)opyright 2006,2007,2008,2009,2010 by Bjoern Lemke


Cego implements a multithreaded, relational and transactional database system with support for a SQL query language and several client access interfaces.
Beyond the most known traditional features of any traditional transaction based database system ( including several high end administration features ), Cego furthermore supports a distributed multinode concept for performance and failover reasons.
In any kind, Cego is easy to configure and easy to use. The database administrator is supported in a way to set up a complete database system in a few minutes.
For the unpatient user, the section Getting Started describes an easy setup of a single node database configuration. To get in touch with the basics, single node configurations are described first without any distributed database aspects.
The Cego SQL language features are described the the section Cego SQL language . For the more advanced database programmer, the DBD Driver , the PHP cego extension , the JDBC Driver , the C API and C++ API could be interesting sections.
Chapter Multinode Environments discusses the aspects of the Cego database mode in more detail.
For a more detailed view of the several Cego components, please refer to the corresponding section in this manual.

Table of Contents (TOC)

1 Overview
2 Getting Started
2.1 ... Creating a first tableset
2.2 ... Using the first tableset
3 The database xml configuration
3.1 ... General attributes
3.2 ... Tableset configuration
3.2.1 ...... Host connection parameters
3.2.2 ...... System files
3.2.3 ...... Data files
3.2.4 ...... Log files
3.3 ... Creating an admin user
3.4 ... Creating a tableset user
3.5 ... Creating a tableset
4 Running the database
4.1 ... cego - Database backend
4.1.1 ...... Admin user setup mode
4.1.2 ...... DB user setup mode
4.1.3 ...... Tableset define mode
4.1.4 ...... Tableset create mode
4.1.5 ...... Tableset import/export mode
4.1.6 ...... Batch mode
4.1.7 ...... Daemon mode
4.1.8 ...... General options
4.2 ... cgclt - Console database client
4.2.1 ...... Batch file processing
4.2.2 ...... Single command processing
4.2.3 ...... Flow control
4.3 ... cgblow - Load simulation client
4.4 ... cglog - Log reader
4.5 ... Localization
4.6 ... Logging
4.7 ... Compatibility attributes
4.8 ... Tuning attributes
5 The Cego SQL language
5.1 ... Fundamentals
5.1.1 ...... Datatypes
5.1.2 ...... Language Tokens
5.1.3 ...... Base productions
5.2 ... Creating a table
5.3 ... Inserting into a table
5.4 ... Attribute value handling
5.4.1 ...... Integer and long values
5.4.2 ...... String values
5.4.3 ...... Boolean values
5.4.4 ...... Datetime values
5.4.5 ...... Arbitrary integer values
5.4.6 ...... Float values
5.4.7 ...... Double values
5.4.8 ...... Decimal values
5.4.9 ...... Fixed values
5.4.10 ...... Small integer values
5.4.11 ...... Tiny integer values
5.4.12 ...... Blob values
5.5 ... Selecting from a table
5.5.1 ...... Selection
5.5.2 ...... Alias
5.5.3 ...... Joins
5.5.4 ...... Conditions
5.5.5 ...... Ordering
5.5.6 ...... Grouping
5.5.7 ...... Having
5.5.8 ...... Nested Query
5.5.9 ...... Inner Join
5.5.10 ...... Outer Join
5.5.10.1 ...... Left outer Join
5.5.10.2 ...... Right outer Join
5.5.11 ...... Numeric functions
5.5.12 ...... String functions
5.5.13 ...... Date functions
5.5.14 ...... Arithmetic functions
5.5.15 ...... Case when clause
5.5.16 ...... Execution plan
5.5.17 ...... System tables
5.6 ... Updating a table
5.7 ... Deleting from a table
5.8 ... Dropping a table
5.9 ... Altering a table
5.10 ... Using indexes
5.10.1 ...... Index check
5.11 ... Using foreign keys
5.12 ... Using check constraints
5.13 ... Views
5.14 ... Procedures
5.14.1 ...... Procedure sample 1 - Simple table copy
5.14.2 ...... Procedure sample 2 - Insert with id counter
5.14.3 ...... Procedure sample 3 - Exception Handling
5.15 ... Counter
5.15.1 ...... Adding a counter
5.15.2 ...... Listing counters
5.15.3 ...... Using a counter
5.15.4 ...... Setting a counter
5.15.5 ...... Dropping a counter
5.16 ... Tableset information commands
5.16.1 ...... show
5.16.2 ...... list
5.16.3 ...... tableinfo
5.16.4 ...... desc
5.16.5 ...... sync
5.17 ... Reorganisation
5.18 ... Append mode
6 Transactions
6.1 ... Starting a transaaction
6.2 ... Committing a transaaction
6.3 ... Aborting a transaaction
6.4 ... Autocommit
6.5 ... Isolation level
7 Database administration with cgadm
7.1 ... Connecting to the database
7.2 ... Retrieving database information
7.2.1 ...... Pool information
7.2.2 ...... Lock information
7.2.3 ...... Thread administration
7.3 ... Retrieving tableset information
7.3.1 ...... Datafile information
7.3.2 ...... Online Redo Log information
7.3.3 ...... Archive Log information
7.3.4 ...... Transaction information
7.4 ... Basic tableset administration
7.4.1 ...... Defintion
7.4.2 ...... Creation
7.4.3 ...... User administration
7.4.4 ...... Start and stop
7.4.5 ...... Drop
7.4.6 ...... Remove
7.4.7 ...... Datafile expansion
7.4.8 ...... Tableset verification
7.5 ... Backup administration
7.5.1 ...... Import and export
7.5.2 ...... Archive log mode
7.5.3 ...... Archive log location
7.5.4 ...... Online backup mode
7.5.5 ...... Tableset recovery
8 Backup and recovery
8.1 ... Offline backup
8.2 ... Online backup
8.2.1 ...... External backup
8.2.2 ...... Internal backup
8.3 ... Tableset recovery
8.4 ... Log tracing with cglog
9 Multinode environments ( Cego mode )
9.1 ... Roles
9.2 ... Administration
9.2.1 ...... Creating a multinode database
9.2.2 ...... Tableset Copy
9.2.3 ...... Tableset Startup
9.2.4 ...... Tableset Switch
9.2.5 ...... Relocating Tableset Secondary
9.3 ... Distributed queries
10 Using the DBD Driver
10.1 ... DBD connection string
10.2 ... Executing statements immediately
10.3 ... Executing prepared statements
10.4 ... Fetching data
11 Using the JDBC Driver
11.1 ... Loading the JDBC driver
11.2 ... JDBC connection string
11.3 ... Using statements
11.4 ... Using prepared statements
11.5 ... Using callable statements
12 Using the C++ API
12.1 ... Connecting to the database
12.2 ... Executing a query
12.3 ... Fetching data
12.4 ... Retrieving query results
12.5 ... Class Reference
12.5.1 ...... CegoNet
12.5.2 ...... CegoField
12.5.3 ...... CegoFieldValue
12.5.4 ...... CegoProcVar
13 Using the C Wrapper API
13.1 ... Connecting to the database
13.2 ... Executing a query
13.3 ... Tuple fetching
13.4 ... Prepared Statements
13.5 ... Function Reference
14 Using the PHP extension
14.1 ... Connecting to the database
14.2 ... Preparing a query
14.3 ... Executing a query
14.4 ... Tuple fetching
14.5 ... Parameter binding
14.6 ... Function Reference
15 Database Tuning
15.1 ... Incompiled parameters
15.2 ... Configuration parameters