![]() |
3 The database xml configuration |
---|
Back to TOC |
The cego database stores the most relevant configuration information in a single XML file. Before creating any tablesets for the database, this file must be setup.
Please note : The novice user never should edit the xml file manually, rather it is modified via database console or admin console client commands. Later on, specific database parameters can be configured manually by the advanced user. This requires an understanding of the file structure, so this chapter gives an introduction to it.
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 for the database tag are used to define general tableset independent database parameters. 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 recommended values. For OLTP application, a pagesize of 8k is recommended to achieve a good performance. For application with OLAP requirements, larger values might be useful. This value just can be modified, if still no tablesets have been created. |
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 |
NUMRECSEMA | Number of record semaphores, which are allocated for the database |
NUMSYSPAGESEMA | Number of system page semaphores, which are allocated for the database |
NUMDATAPAGESEMA | Number of data page semaphores, which are allocated for the database |
NUMIDXPAGESEMA | Number of index page semaphores, which are allocated for the database |
NUMRBPAGESEMA | Number of rollback page semaphores, which are allocated for the database |
NUMDATAFILESEMA | Number of data file semaphores, which are allocated for the database |
NUMBUFFERPOOLSEMA | Number of buffer pool semaphores, which are allocated for the database |
MAXFIXTRIES | Range in the bufferpool, where a free slot is searched to fix a page |
CSMODE | Case sensitive mode. If value is set to any value except STR or NONE, identifiers and string values are compared case sensitive. If set to STR, just string values are handled case sensitive. If set to NONE, all comparisons are made case insensitive. Any SQL keywords are handled case insensitive in any case. |
DUPLICATENULL | Allows duplicate null values for unique index objects, either ON or OFF |
QESCMODE | Quote escape mode. If set to ON, quotes also can be escape by a second preceded quote |
MAXTSID | Tableset Id counter. Don't modify this parameter |
PAGEOFFSET | Current pageoffset for the next allocated datafile. Don't modify this parameter |
DATETIMEFORMAT | Date format string ( e.g. DATETIMEFORMAT="%a %b %d %H:%M:%S %Y"). The default data format as represented in query results or XML export files. |
LOGMNGPROG | Program name of the external logmanager to provide log files in the archive log location |
LOGMNGTIMEOUT | Timeout in seconds for the external logmanager to provide the requested archive logfile |
For example, a configuration file might look like
<?xml version="1.0"?> <!DOCTYPE CEGO_DB_CONFIG> <DATABASE NAME="cegodb" PAGESIZE="4096" ADMINPORT="2000" LOGPORT="3000" DBPORT="2200"> ... </DATABASE> |
3.2 User entries
All database users are also stored in the configuration file. Database users are described with the following attributes.
User Parameter | Meaning |
---|---|
NAME | The name of the database user |
PASSWD | The user password in AES encrypted form |
TRACE | Either the value for this tag is set to ON or OFF, depending on the activation of request tracing. If the trace is enabled, all connection and query requests are counted |
NUMREQUEST | The number of performed database connection requests for the user. The values is just set up and increased, if the trace mode is enabled |
NUMQUERY | The number of performed query requests for the user. The values is just set up and increased, if the trace mode is enabled |
ROLE | A comma separated list of roles, which are assigned to the user |
Here we give a sample user entry
... <USER NAME="lemke" PASSWD="da00df214a29217555a08a7cf890d1b8" TRACE="OFF" ROLE="ALL"></USER> ... |
3.3 Role entries
Roles are used by the database to restrict data access for the users. Database roles can be created and assigned by the database administrator. See the role management section for a more detailed description.
Roles are identified by its unique name.
Role Parameter | Meaning |
---|---|
NAME | The name of role |
Any access right of a role are described with permission entries. Permission entries are subtags inside the role tag with the following attributes
Permission Parameter | Meaning |
---|---|
TABLESET | The name of the tableset, for which the permission is valid |
FILTER | A regular expression, which describes the object filter or the "ALL" for all objects |
PERM | The permission type |
PERMID | A unique identifier for the permission |
A sample role entry can look like
... <ROLE NAME="ALL"> <PERM TABLESET="lit" FILTER="ALL" PERM="ALL" PERMID="lit_P"></PERM> </ROLE> ... |
3.4 Date format entries
For date scanning, a list of formats can be specified using the DATETIMEFORMAT tag. Setting up the VALUE attribute for each element specifies the format. Several dateformat entries can be defined.
Scan Date Parameter | Meaning |
---|---|
VALUE | The date format specification |
Sample:
... <DATETIMEFORMAT VALUE="%d.%m.%Y %H:%M:%S"/> <DATETIMEFORMAT VALUE="%d.%m.%Y"/> <DATETIMEFORMAT VALUE="%Y%m%d"/> ... |
3.5 Node entries
If cego operates in distributed mode, all known hosts are registered in the xml file. Since for each node a health checking is performed, the status of the corresponding host is stored to the status attribute. The xml tag has the following form
... <NODE HOSTNAME="dude.local" STATUS="ONLINE"> </NODE> ... |
3.6 Tableset entries
A cego database can contain several tableset configurations. A tableset is a set of database objects with a dedicated transaction and log management.
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 |
SYSNAME | Name of the system space datafile |
TMPSIZE | Size of the tableset temp area in number of database pages |
TMPNAME | Name of the temp space datafile |
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 |
AUTOCORRECT | If this parameter is set to value ON, all index and btree objects will be automatically repaired after crash recovery |
LSN | Last sequence number is automatically increased with each new written log entry to the online redo log files. On checkpoints, the LSN is synchronized to the database xml file |
TID | The transaction id is increased with each started transaction for this tableset |
QUERYCACHE | If set to ON, query cache for this tableset is enabled |
MAXQUERYCACHEENTRY | Maximum managed query cache entries for this tableset |
MAXQUERYCACHESIZE | Maximum query cache result set size for this tableset |
TABLECACHE | If set to ON, table cache for this tableset is enabled |
MAXTABLECACHEENTRY | Maximum managed table cache entries for this tableset |
MAXTABLECACHESIZE | Maximum table cache result set for this tableset |
CHECKPOINT | Time interval in seconds, when the next checkpoint is forced for this tableset |
SYSPAGEOFFSET | Page offset for the system entries for this tableset |
TEMPPAGEOFFSET | Page offset for the rollback segment entries for this tableset |
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.6.1 System files
Each tablesets object information is stored in a tableset dictionary. For this, the tableset system file is used.
Temporary information is stored the the tableset temp space. This space is mainly used for transaction rollback information and sort areas.
Please note, that the size attribute for system and temp space is based on database page units.
3.6.2 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 the corresponding datafile expansion section 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. Datafile can have either APP, SYSor TEMPtype |
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. |
Sample:
... <DATAFILE TYPE="APP" FILEID="11" NAME="./data11.dbf" SIZE="1000"> </DATAFILE> ... |
3.6.3 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"> </LOGFILE> ... |
3.6.4 Counters
Tableset counters can be used to manage any kind of unique identifiers, which are used for the data tables. For performance reasons, counters are also stored to the database xml file in the following manner
Counter Parameter | Meaning |
---|---|
NAME | The unique name of the counter |
VALUE | Current integer value of the counter |
Sample:
... <COUNTER NAME="userid" VALUE="4711" </COUNTER> ... |