A Cego database can contain several tableset configurations. A tableset is a set of database objects with a dedicated transaction
and log management. In this sense, creating a database is reduced to creating a tableset.
A convenient way to create a tableset can be done using the cgadm program. See section cgadm for a more detailed discussion of the admin program.
By defining a tableset will create the corrsponding entries in the database XML file automatically.
For a better understanding of the required XML file entries, the tableset XML structure is described more detailed in the following.
Before a tableset can be created, the requirements of the database should be clear.
Several parameters influence the behaviour in terms of performance, memory and diskspace resources but also
database administration.
Each of the available configuration parameters are explained in the following.
Cego databases are managed using a single XML file for each database. Before creating the database, this file
must be customized in an appropriate way. Since several database runtime information is stored to the XML file,
the file should be NOT modified after the database has been created.
3.1 General attributes
The XML file starts with the standard header version declaration and is defined with the document type
CEGO_DB_CONFIG
<?xml version="1.0"?>
<!DOCTYPE CEGO_DB_CONFIG>
|
This declaration is followed by a root element tag called DATABASE
Several attributes of the database tag are used to define general database parameters.
These values are valid for all tableset configurations, the database contains.
In the following, a table is given for the description of the available parameters.
| Database Parameter |
Meaning |
| NAME |
The identification of the database |
| PAGESIZE |
Number of bytes for a single database page. Data is read and written from and to disk in units of database pages. Pagesizes of 8192 ( 8k ) up to 131072 ( 128k ) are common |
| HOSTNAME |
The hostname, where the database daemon is running on.
This can be either an IPv4 or IPv6 hostname |
| ADMINPORT |
Network port number, where admin connections are served on |
| LOGPORT |
Network port number, where log connection for the redo logshipping are served on |
| DBPORT |
Network port number, where database client connection are served on |
| PIDFILE |
Path to a filename, where the daemon process id is stored |
Sample:
<?xml version="1.0"?>
<!DOCTYPE CEGO_DB_CONFIG>
<DATABASE NAME="cegodb" PAGESIZE="4096" ADMINPORT="2000" LOGPORT="3000" DBPORT="2200">
...
</DATABASE>
|
3.2 Tableset configuration
As subtags of the DATABASE tag, several XML tags of name TABLESET can be used to specify tablesets. A Cego tableset contains all required information to ensure a transaction based query handling. So each of these components must be described in the tableset section
| Tableset Parameter |
Meaning |
| NAME |
The identification of the tableset |
| TSID |
The TSID is a unique id used for internal identification of the tableset and tableset system file |
| TSROOT |
The root path for the database system and log files |
| TMPFID |
Unique file Id for the tableset temp space file |
| SYSSIZE |
Size of the tableset system area in number of database pages |
| TMPSIZE |
Size of the tableset temp area in number of database pages |
| SORTAREASIZE |
Size of the sort area in the tableset for a single session. Temporary order and grouping data is allocated on demand and can be limited by setting the ordersize attribute to an appropriate value ( in bytes ) |
| LSN |
The LSN attribute is used at database runtime to store the last sequence number of the last written log entry. After tablset creation, this value is reset to zero automatically. |
| PRIMARY |
In terms of the Cego role concept, the primary host node is specified. For Cego version 1.0 this value must be set to the output of the unix hostname command |
| SECONDARY |
In terms of the Cego role concept, the secondary host node is specified. For Cego version 1.0 this value must be set to the output of the unix hostname command |
| MEDIATOR |
In terms of the Cego role concept, the mediator host node is specified. For Cego version 1.0 this value must be set to the output of the unix hostname command |
| ARCHMODE |
If this value is set to TRUE, archiving mode is enabled and all complete written logfiles are archived to the defined archive log paths |
Sample:
...
<TABLESET NAME="TS1" TSROOT="/usr/local/cegodb" TSID="1" TMPFID="10" SYSSIZE="200" TMPSIZE="200" LSN="26"
PRIMARY="geek" SECONDARY="geek" MEDIATOR="geek">
...
<TABLESET>
|
3.2.1 Host connection parameters
Tableset connection parameters are used from Cego Version 2.0 and up. Set the entries for primary, secondary and mediator host
to the output of the hostname command.
3.2.2 System files
Each tablesets object information is stored in a tableset dictionary. For this, the tableset system file is used.
You have to provide a unique file id ( TSID attribute ) and size ( SYSSIZE attribute ) at creation time.
Temporary information is stored the the tableset temp space. This sapce is mainly used for transaction rollback information
and sort areas. A dedicated temp file must be provided for this with a unique file id ( TMPFID attribute ) and siez ( TMPSIZE attribute ) at creation time.
Please note, that the size attribute for system and temp space is based on database page units.
3.2.3 Data files
Depending on the size of the database, an appropriate number of datafiles should be defined.
Once a datafile is created, it can not be resized. To increase the database, a new database must be added.
After initial creation of the database, datafiles are added using one of the the Cego administration utilities.
See section cgadm and the CegoAdm ( Java admin Client ) documentation
for more information.
At creation time, any number of datafiles can be defined. Using the DATAFILE subtag entries beyond the
TABLESET tag, datafiles are described.
Tag attributes for datafiles are
| Datafile Parameter |
Meaning |
| TYPE |
The type of the database file. Actually this must be set to APP |
| FILEID |
The unique fileId for the datafile. Please note that any fileId's must be unique database wide |
| NAME |
The full pathname of the datafile. Relative pathnames are allowed but recommended just for tests and samples. |
| SIZE |
The size of the datafile in database pages.
Please note : Cego datafiles are fixed size, no resize is possible |
Sample:
...
<DATAFILE TYPE="APP" FILEID="11" NAME="./data11.dbf" SIZE="1000">
...
|
3.2.4 Log files
Database logfiles are used to store query information for any modification queries ( create, insert, update, delete ).
Logfiles have fixed sizes and they are written sequentially in a cyclic way. This means, if the end of one logfile has reached
a logfile switch to the next defined logfile is done. At this time, the bufferpool is synched to the datafiles and the current written
log entry number is written as LSN value to the XML-file
Furthermore, if a logfile is completely written and archive mode is enabled, the logfile is released for backup in the
offline log area.
See section Archive log mode for more information how to enable log mode. At creation time, the number of ( online ) redolog files must be defined.
Tag attributes for logfiles are
| Logfile Parameter |
Meaning |
| NAME |
The full pathname of the logfile. Relative pathnames are allowed but recommended just for tests and samples. |
| SIZE |
The size of the logfile in bytes |
| STATUS |
This attribute is used at database runtime to identify the current active logfile. After database creation, the first available logfile is set to active automatically |
Sample:
...
<LOGFILE NAME="./redolog11.log" SIZE="300000" STATUS="ACTIVE">
...
|
If all required values in the database XML file have been set up correctly, the file can be used to create the database.
During this process, the database system, application and log files are created and the required size of each file is allocated.
Furthermore, some of the XML attribute values are initialized.
Please note, that the XML configuration file is not just used at creation time but also at runtime for several runtime information. So the file should be NOT edited while the database is running