System
System
System Guide
Version 6.8.1.83
September 10, 2015
Contents
2 Transbase-Packages 4
2
CONTENTS 3
7 Account Logging 33
7.1 Introduction to Transbase Account Logging . . . . . . . . . . . . . 33
7.2 Layout of the Database Accounting File . . . . . . . . . . . . . . . 33
7.3 Database Events and Associated Information . . . . . . . . . . . . 34
8 Database Administration 36
8.1 The Database File ”f.db” . . . . . . . . . . . . . . . . . . . . . . . 36
8.2 Structure of a Database Directory . . . . . . . . . . . . . . . . . . 37
8.3 Space Allocation for a Database . . . . . . . . . . . . . . . . . . . . 38
8.3.1 The Scratchfile Container . . . . . . . . . . . . . . . . . . . 38
8.3.2 The Bfimfile Container . . . . . . . . . . . . . . . . . . . . . 40
8.3.3 The Diskfile Container . . . . . . . . . . . . . . . . . . . . . 40
8.3.4 Database Size and Database Extension . . . . . . . . . . . 40
8.3.5 Dedication of Diskfiles for Binary Large Objects . . . . . . 41
8.3.6 Moving Diskfiles after Database Creation . . . . . . . . . . 42
8.3.7 Read-only Diskfiles . . . . . . . . . . . . . . . . . . . . . . . 42
8.3.8 Jukebox Support . . . . . . . . . . . . . . . . . . . . . . . . 42
8.3.9 The Romfile Container . . . . . . . . . . . . . . . . . . . . . 43
8.4 TBADMIN Command Line Options . . . . . . . . . . . . . . . . . 43
8.4.1 tbadmin -b . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
8.4.2 tbadmin -s . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
8.4.3 tbadmin -r . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
8.4.4 tbadmin -i . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
8.4.5 tbadmin -c . . . . . . . . . . . . . . . . . . . . . . . . . . 47
8.4.6 tbadmin -a . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
CONTENTS 5
8.4.7 tbadmin -d . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
8.4.8 tbadmin -C . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
8.4.9 tbadmin -M . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
8.4.10 tbadmin -drec . . . . . . . . . . . . . . . . . . . . . . . . . . 54
8.5 Account Logging Administration . . . . . . . . . . . . . . . . . . . 56
8.5.1 The Account Logging File . . . . . . . . . . . . . . . . . . . 57
8.5.2 Switching Account Logging On and Off . . . . . . . . . . . 57
8.5.3 Activating and Deactivating Accounting Events . . . . . . . 57
8.6 Code Pages and Locale Setting . . . . . . . . . . . . . . . . . . . . 58
8.6.1 Code Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
8.6.2 Locale Setting . . . . . . . . . . . . . . . . . . . . . . . . . 59
8.7 Case Sensitivity in Transbase Databases . . . . . . . . . . . . . . . 59
8.7.1 Principles . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
8.7.2 Delimiter Identifiers in CI databases . . . . . . . . . . . . . 60
8.7.3 Migration from Case Sensitive to Case Insensitive . . . . . 60
8.8 Using tbadmin on MS Windows . . . . . . . . . . . . . . . . . . . . 60
10 Tools 66
10.1 Archiving, Restoring, Schema Report . . . . . . . . . . . . . . . . . 66
10.1.1 The tbarc Command . . . . . . . . . . . . . . . . . . . . . . 67
10.1.2 The tbtar Commands . . . . . . . . . . . . . . . . . . . . . 68
10.1.3 The tbtape Command . . . . . . . . . . . . . . . . . . . . . 71
10.2 Tbcheck - Correctness Test and Statistics of a Database . . . . . . 72
10.3 Tbdiff - Difference between two Databases . . . . . . . . . . . . . . 73
10.4 Cleaning Log Records for Distributed Transactions . . . . . . . . . 74
12 Installation of Transbase 82
12.1 Installation under UNIX . . . . . . . . . . . . . . . . . . . . . . . . 82
12.1.1 System Resources . . . . . . . . . . . . . . . . . . . . . . . 82
12.1.2 Installation Procedure . . . . . . . . . . . . . . . . . . . . . 82
12.1.3 Runtime Environment . . . . . . . . . . . . . . . . . . . . . 84
12.1.4 Boot Script . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
12.2 Installation under Windows . . . . . . . . . . . . . . . . . . . . . . 86
12.2.1 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . 86
12.2.1.1 Localisation of Parameters . . . . . . . . . . . . . 87
12.2.1.2 Transbase Parameters . . . . . . . . . . . . . . . . 87
12.2.1.3 Operating System . . . . . . . . . . . . . . . . . . 89
CONTENTS 7
12.2.1.4 Communication . . . . . . . . . . . . . . . . . . . 89
12.3 Installation on Novell Netware . . . . . . . . . . . . . . . . . . . . 90
12.3.1 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . 90
12.3.1.1 Localisation of Parameters . . . . . . . . . . . . . 90
12.3.1.2 Transbase Parameters . . . . . . . . . . . . . . . . 91
12.3.1.3 Communication . . . . . . . . . . . . . . . . . . . 91
13 Trouble Shooting 93
B Availability 97
B.1 Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
B.2 Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Getting Started This manual is a quick introduction into some basic function-
ality and concepts of Transbase.
System Guide This manual describes the commands and tools for the Transbase
Database Administrator and many internal functions and concepts .
SQL Reference Manual Contains the complete TB/SQL kernel language defi-
nition.
Transbase Embedded SQL Describes the standardized Embedded SQL pro-
gramming interface (EXEC SQL ...) in a C language environment.
Programming Interface TBX Describes the native C programming interface
to Transbase provided by the library tbx.a and tbx.dll, resp.
TransbaseCD Guide Comprises the description of the unique Transbase CD-
ROM Databases. Described are the preparation, processing and tuning (e.g.
loading and compression) of CD-ROM databases.
Command Control Language CCL An easy-to-learn yet powerful program-
ming languange which offers a comfortable SQL interface to the Transbase
kernel.
Transbase Interactive Interface TBI Describes the line oriented interactive
interface TBI and its table editor reledit.
Transbase Query Optimization and Locking Guide Describes to a far ex-
tent how the Transbase query optimizer works and how it can be influenced
by commands and additional language features.
UFI User’s Guide (only Unix Platforms) Describes the screen oriented in-
teractive interface UFI.
8
Chapter 2
Transbase-Packages
Each of these packages is installed with a separate license number which can be
acquired from TransAction Software and is requested during the installation.
For Windows platforms three other packages are available:
9
Chapter 3
Overview of Transbase
Platforms
Transbase is available for various Unix platforms. The updated list can be ordered
at Transaction Software GmbH in Munich, Germany.
This chapter presents an overview about the supported Windows platforms, the
Transbase software packages and the implemented communication protocols. It
also introduces notations used in the more detailed representations of the succes-
sive chapters.
3.2.1 Overview
The 32 bit variant of Transbase runs on Win32S based on Windows 3.1 (WIN32) or
Windows for Workgroups 3.11(WfW32). The available communication protocols
are listed table.
10
3.2. TRANSBASE FOR WINDOWS 11
Note: Network DDE is not availabe for WfW32. TCP/IP is available if the
installed TCP/IP stack supports a winsock Interface.
Appendix B shows the relationship between Windows platforms and available
communications protocols.
Following packages are available for Novell Netware V3.12 and for Novell Netware
V4.1
TCP/IP must be installed on the Netware server to make the server accessible
from the client machines.
Chapter 4
13
14 CHAPTER 4. GENERAL CONCEPTS OF TRANSBASE
4.1 Databases
To establish data privacy in a Transbase database, each user (or application pro-
gram resp.) has to login into the database and have his authorization checked
before being able to access any table. The authorization check is based on a user-
changeable password. Passwords are stored within the database in encrypted form
only (see the chapter ”The sysuser Table” below).
Upon creation of a database the database administrator (DBA) is automatically
installed as user with the user name ”tbadmin” and an empty password. It is
strongly recommended to change the DBA password immediately after creation.
(See AlterPasswordStatement in TB/SQL-Manual)
Other database users can be added or deleted by the DBA only. The database
administrator is responsible for choosing a unique user name (which may be dif-
ferent from the operating system user identification) and a user class for a new
user.
To protect machine resources and database objects against misuse, Transbase
applies three concepts with the notions userclass, owner and access privilege.
The concept of userclass applies to users. Each user has a userclass which can
be changed by the DBA only. (See Grant-Userclass-Statement, Revoke-Userclass
-Statement). The userclass regulates the right to login, to create objects (tables,
4.3. MULTIPLE CONNECTS 15
views, indexes) and also defines whether a user has the property of a DBA. The
following four userclasses are supported:
Userclass Access Right
”no access” No login
”access” Login privilege. No privilege to create database objects.
”resource” Login privilege Privilege to create database objects
”dba” All rights.
The concept of owner is a relationship between users and objects. Each object has
one owner namely the user who created it. The owner of an object has all access
privileges (see below) on it and also the right to drop the object.
The concept of access privileges regulates the right to select, insert, update, delete
tuples. Select-, insert-, delete privileges are specified on table granularity , update
privileges are specified on field granularity .
Each access privilege on a table for a user is either grantable or not grantable. If
it is grantable , the user is permitted to forward the privilege to other users (again
in grantable or not-grantable form).
All system tables are owned by the database administrator. Other users have
select privilege only.
Note that the database administator can change the system tables ”manually”
(i.e. via InsertStatements, UpdateStatements, or DeleteStatements) but this
may have disastrous effects and is strongly discouraged.
More than one database can be addressed via a single connection by a distributed
query. Table names in the FROM clause can be extended by database and ma-
chine name with the syntax: tablename@dbname@hostname. If a query exhibits
a foreign database name, the kernel which has received the query for process-
ing establishes a distributed query processing plan. Other kernels are started at
demand at the addressed databases and deliver partial results to the main pro-
cessing kernel. The distributed processing of the query remains transparent to
the application except the explicit formulation of the remote databases within the
tablenames in the FROM clause.
Distributed queries currently have the following restrictions:
DDL statements are restricted to local tables. View definitions using remote tables
are not allowed.
INSERT queries on remote tables are only allowed if the table has no STATE-
MENT triggers (however triggers defined with the FOR EACH ROW clause are
allowed). INSERT, UPDATE, DELETE statements against remote tables are
possible if there are no subqueries referring to tables which are not on the same
database.
SELECT queries against one remote table are not updatable, i.e. no DELETE
POSITIONED or UPDATE POSITIONED is allowed.
Chapter 5
This chapter gives an overview of the restrictions that apply to Transbase. When-
ever possible, the restrictions are given in formulas.
17
18 CHAPTER 5. TRANSBASE RESTRICTIONS AND LIMITATIONS
5.2.1 Instantiation
By its nature, Transbase is a multi user, multiple database system with local and
distributed database accesses.
The process architecture is characterized by the following property: Each appli-
cation (client) is processed by a dedicated kernel (server).
In contrast to UNIX based platforms which have no restrictions with respect
to number of incarnations of server processes, the different Windows platforms
5.2. RESTRICTIONS ON WINDOWS PLATFORMS 19
exhibit many subtle restrictions and characteristics as far as the server capabilities
are concerned (multitasking, shared memory, semaphors, networks, etc.).
A rough characteristic of multi instantiation of programs and runtime libraries of
Windows and its derivatives is the following:
The instantiation capabilities of executables and DLLs induce the following mul-
tidimensional classification:
The following chapters describe the system structure of Transbase with respect to
processes, system resources etc.
The Transbase process structure is shown by the following picture. LAP denote
arbitrary local application programs, RAP denotes a remote (client) application
program. All applications have linked in the TBX (Transbase eXec) library (either
statically or linked at runtime).
When an application CONNECTs to the database at a machine M, its linked
TBX library sends a message to a port of M where a Transbase demon process is
listening.
The daemon process is either tbmux or tbkernel .
The daemon forks a new or activates an idle tbkernel process ( denoted by TB/K1
etc. in the picture) which then serves the application. Additionally, the pic-
ture shows the Transbase Shared Memory which contains data shared between all
TB/K processes.
Not shown in this diagram is another Transbase background process ”tbserver”
which coordinates 2-phase-commit of distributed transactions and implements
asynchronous transaction abort via signals. If tbserver is not running, applica-
tions are yet able to run but 2-phase-commit and asynchronous transaction abort
are not available.
Note that the names tbkernel and tbserver are often confused because one is
tempted to call the daemon tbkernel a ”server” process in a general sense - this
20
6.1. TRANSBASE SYSTEM STRUCTURE ON UNIX MACHINES 21
FORK
TB/K 1 TB/K2 ZB/K3
TB
KERNEL
Shared Memory
DEMON
should have been avoided by another name for tbserver, e.g. commit coordinator
”comcord” or similarily. It may be that tbserver is renamed or integrated into
tbkernel in the future.
When n applications are running a transaction on one or several databases on one
machine, n+1 tbkernel processes coexist in the process table of that machine. An
application which is connected to the database but does not have an active trans-
action either has a dedicated tbkernel process or does not have one, depending
on the installed daemon process: with tbkernel as daemon, a dedicated tbker-
nel exists, with tbmux the tbkernel processes are multiplexed between different
applications (see below).
A further different process ”tbadmin” exists which is an interactive tool for the
database administrator to create, drop and alter databases. Its function is ex-
plained in detail in the following subsubsections which also give an overview of
how the Transbase processes come into operation starting from scratch (i.e. start-
ing with the machine’s boot program).
With the tbadmin command ”tbadmin -c dbname” a database with name dbname
can be created. Many creation parameters can be given interactively or on the
command line.
With the tbadmin command ”tbadmin -d dbname”the database dbname is deleted.
22 CHAPTER 6. TRANSBASE SYSTEM STRUCTURE
A daemon process named tbkernel (or mykernel, depending on the license) has to
be started which exports a named TCP /IP service. If such service is requested by
an application program (CONNECT request), the daemon process forks a child
process which exclusively serves the requesting application.
tbkernel has to be started once after the machine has been booted. All other
tbkernel processes which serve the applications are started (forked) automatically
from that background process whenever an application requests service.
Note that whereas the application may run under an arbitrary user identification,
the actually serving tbkernel process always runs under the userid of the owner
of the database directory . The owner of the database directory is the user who
originally created the database.
Note further that tbkernel processes are code-shared , i.e. they are resident only
once in a system (even with various databases). Of course, each tbkernel process
has its own private data and stack segments.
tbkernel processes where the schedule basis is the transaction. The intention is to
limit the number of tbkernel processes to a level which roughly corresponds to the
number of applications with active transactions.
With this principle, the number of active connections can be much larger than
the number of concurrently existing tbkernel processes. Especially, an application
which has no transaction active does not necessarily occupy a tbkernel process.
However, an application with an active transaction on database db has an attached
tbkernel process even if the application is idle for a long time.
The degree of multiplexing can be adjusted for each database Separately by speci-
fication of mintb and maxtb, the minimum and maximum number of concurrently
existing tbkernel processes for that database. If mintb and maxtb are both 0, then
no multiplexing occurs, i.e. each application has a dedicated tbkernel process for
the whole connection (it then makes no difference whether tbmux or tbkernel runs
as daemon).
If mintb and maxtb are > 0 and tbmux is started then tbmux initially starts mintb
tbkernel processes which all initially are in state idle. Whenever an application
connects or starts a transaction, tbmux schedules an idle tbkernel process for that
application’s transaction. If no idle tbkernel exists and the number of existing
tbkernel processes is less than maxtb, then tbmux starts another tbkernel which
serves the application’s transaction. If maxtb kernels are already running, the
application is set into state waiting until a tbkernel becomes idle and is scheduled
for that application.
Whenever a tbkernel has processed a transaction it contacts tbmux for reschedul-
ing. It then either is rescheduled by tbmux (if an application is waiting) or - if no
application requests service - is terminated by tbmux (unless number of running
tbkernels decreased below mintb) or enters state idle until an application requests
service.
Waiting applications are served on a first-come-first-serve discipline.
One more background process tbserver has to be started which exports the TCP
/IP service named ”tbserver”. This process is responsible for asynchronous signal
handling and for the commit synchronisation of distributed transactions. If none
of the above services is requested, the starting of the tbserver process can be
omitted.
If an application has requested one of the above services, the tbserver process forks
a child that is exclusively allocated to the requesting application.
Note that though each application may have connections to more than one tbkernel
processes it always has at most one connection to a tbserver process. The tbserver
24 CHAPTER 6. TRANSBASE SYSTEM STRUCTURE
process lives from the first request until the end of the requesting application or
until a tbserver is requested on a different host.
Each application program which wants to access a database has to link in the
Transbase/Exec library tbx. This library defines a dynamic procedural interface
to all database functions. By the TBX-CONNECT request an inter-process com-
munication is initiated between the application program and the corresponding
tbkernel process as described above. In the sequel, the application program (via
the tbx module) and the tbkernel communicate directly over this link. However,
communication details are hidden from the application programmer by the tbx
module.
The tbkernel process lives until the application program explicitly DISCONNECTs
from the database or until it exits or dies. A tbkernel process also may be killed
by an explicit kill command. However, the permission to kill a tbkernel process is
restricted to the super-user or to the database administrator.
Note that an application program may CONNECT to more than one database con-
currently. In this case, separate tbkernel processes are created for each database.
The application may then run distributed transactions, i.e. transactions which
query more than one database but it may also be that the application simultane-
ously runs several transactions which all are local on one database.
The terms boot and shutdown of a database are directly correlated to the creation
and deletion of shared memories and semaphores attached to that database, resp.
After creation of a database, it is automatically booted, i.e. the shared memories
and semaphores exist. A specific database db can be shut down by the tbad-
min command ”tbadmin -s db”. This requires that no processes are running on
the database (the option -sf overrides that and ungracefully stops running applica-
tions). A database can be booted by the command ”tbadmin -b db”. Without the
parameter db, all databases on a particular machine can be shutdown or booted.
Booting a database must be (at least) done after the machine has been (re)started
because a machine crash or controlled machine shutdown implicitly deletes all
shared memory regions and semaphores.
6.2. TRANSBASE SYSTEM STRUCTURE ON MS WINDOWS 25
wintbadm.exe plays the part of tbadmin on Win32S and WfW32S. it is not possible
to create multiuser databases.
tbkwso32.exe is equivalent to the tbkernel process. The main difference is, that it
is automcatically add to the autostart group during installation and from then on
it is started automatically each time when Windows is started.
tbkwso32.exe serves for TCP/IP connections. Since 32 Bit processes can be mul-
tiple instantiated on Win32S and WfW32S several connections to local databases
are possible. Since Transbase/CD cannot handle multiuser databases on these
platforms, several connects to a database are not possible.
tbkdde32.exe is the DDE equivalent of tbkwso32.exe.
tbkwso32.exe is equivalent to the tbkernel process. The main difference is, that it
is automcatically add to the autostart group during installation and from then on
it is started automatically each time when a user logges in.
tbkwso32.exe serves for TCP/IP connections. Since 32 Bit processes can be mul-
tiple instantiated on Windows NT / 95 several connections to local databases are
possible.
tbkdde32.exe is the DDE equivalent of tbkwso32.exe. It serves for local and net-
work dde connections.
Note: It is not possible to connect more than one database at a time via the
linked-in interface.
(CLIB_OPT)/P<path to tbnlm.ini>
On Novell netware tbadmin.nlm plays the part of tbadmin. For more information
see chapter 7.1
28 CHAPTER 6. TRANSBASE SYSTEM STRUCTURE
must be appended.
must be appended.
Non-multiplexer demon
tbkernel
tbdiag
Function: In the TCP /IP version, tbkernel (tbdiag) defines a TCP /IP service
called ”tbkernel” (which has to be listed in the /etc/services file). Using this
service a TCP /IP port is allocated where tbkernel (tbdiag) may receive requests.
Conversely, an application program uses the service ”tbkernel” to identify the port
where to request a database connection.
In the TCP /IP version, databases can only be accessed if a tbkernel is running.
In the TCP /IP version, if a CONNECT request is received, tbkernel forks itself;
one copy (code shared) is dedicated to the requesting application program, while
the other copy of tbkernel continues to offer the tbkernel service.
After the CONNECT request, tbkernel first checks if the specified database has
been booted. If yes, tbkernel switches to the userid of the owner of the database
directory . The name of the database directory is contained in the database file
”f.db ” which is read by tbkernel. If tbkernel has not been started by superuser
but by another user ”transbase” all tbkernel processes run under the ”transbase”
userid and thus only can access the database if it also has been created by ”trans-
base”.
Called by: Superuser or another dedicated user (called ”transbase” in the se-
quel). Call time may be installation time of Transbase or system boot time. The
pipe version is implicitly called by the application.
6.6.2 tbmux
Multiplexer demon
Example (showing default options): tbmux -tbk tbkernel -i 600 -sk 5 -l 120
-a 5
Note: At least one of -tbk, -tbs must be specified. If one of them is not specified
the corresponding server is not scheduled.
All the following options specify delay times in seconds >= 0:
-i inactivity specifies the time (seconds) after which an application is killed due to
inactivity. This is a feature that is independent of the multiplexer technique.
-a spawntimeout is a timeout for the successful spawning of a tbkernel. With very
heavy load of the host, the default value of 5 may have to be increased. A very
high value has the slight disadvantage that detection that the partner process
tbkernelprocess canot be started or is the wrong partner takes a long time.
-sk startkernel specifies the delay for the start of a new tbkernel if no idle tbkernel
is found to be scheduled.
-l stopkernel specifies the delay for the termination of a tbkernel after it has become
idle and is not needed for the start of a new transaction in the moment (and is a
candidate to be killed because the number of existent tbkernel is greater than the
specified minimum number).
Note that the options -sk and -l are useful to smoothen frequent termination and
newstart of tbkernel processes in an environment with short transactions. With
high values, the number of active tbkernel processes changes slower than with
small values.
Permissions: ”-rwx——”
Called by: Superuser or dedicated user transbase. Call time may be installation
time of Transbase or system boot time.
6.7 tbserver
Command Line Syntax on Unix:
tbserver
32 CHAPTER 6. TRANSBASE SYSTEM STRUCTURE
As part of the tbkernel processes, a main memory region exists which is shared
between all tbkernel processes which run concurrently on the same database.
In UNIX and Novell Netware implementations, the shared memory region is a
system resource which exhibits the following properties:
• A shared memory region which is not in use by any process may be swapped
out to secondary memory.
The shared memories are created when the database is created or booted. They are
deleted when the database is deleted or shutdown . The number of shared memo-
ries depends on the database creation parameters (normally it is n+1 , where n is
the number of caches specified at creation time). In most UNIX implementations,
the command ”ipcs -m” gives a list of existing shared memories.
Note: On Novell Netware the shared memories are owned by the NLM tbnlmipc.
They are created by loading and they are destroyed by unloading this module.
Note: On Novell Netware the semaphores are owned by the NLM tbnlmipc.
They are created by loading and they are destroyed by unloading this module.
Transbase employs the underlying file system to store and retrieve data from disk.
Therefore, a database consists of files. In general, several files are used to store
the data from the database.
A database is identified by a unique logical name which is chosen by the database
administrator at creation time. The mapping between this logical name and the
path name of the database directory is performed by the tbkernel process via the
file f.db (see below).
If a database is to be accessed remotely, the database is identified by the pair
(logical database name, host name ). Thus applications may migrate from one host
to another without the need for recompilation. In contrast, if a database migrates
to another host, all application programs that specify an explicit database name
have to be recompiled.
TRANSBASE LOCAL The following files of the Transbase installation are not
read-only:
PATH: Since the TRANSBASE directory is the location for the Transbase op-
erators (e.g. UFI) also, it is recommended to include this path in the PATH
environment variable, too.
The following examples show the environment setting for UNIX System V
(under the so-called Bourne-Shell) and for Berkeley UNIX (under the C-
Shell).
Example: 1
TRANSBASE=/usr/transbase
export TRANSBASE
PATH=\$PATH:\$TRANSBASE
Example: 2
In a net of NFS (Network File System) coupled machines, each machine has to have
its private copy of the TRANSBASE directory, i.e. the TRANSBASE directory
must not be shared via NFS as a whole.
However, homogeneous machines can share operators, include files, text files etc.
by placing them into a commonly accessible directory and using TRANSBASE
variable pointing to this directory via a private path. The files f.db , f.bak, f.id,
rc.Transbase, and the log subdirectory never can be shared but must be placed
into separate local directories with appropriate definition of environment variable
TRANSBASE LOCAL (see Chapter Runtime Environment).
36 CHAPTER 6. TRANSBASE SYSTEM STRUCTURE
NFS Mounted File Systems: When a database is placed on a file system which
is NFS mounted, the database syncing is not guaranteed in most cases. In
case of update activity, if either the database machine or the NFS server
machine crashes, the database can be corrupted.
Note that the boot command ”tbdmin -b ..” issues warnings if one or several
database files are placed on NFS file systems (warnings can be suppressed
by the option -bf).
6.13. DISK CACHES, NFS AND DATABASE SECURITY 37
Disk Controller Caches: Disk controller caches may impose syncing problems
which are more hidden than NFS. For the sake of increased performance,
disk caches often buffer the operating system’s I/O activity and sometimes
even the synchronous calls thus compromising database security.
However, in many cases the disk controlleris configurable . For example, the
cache controller may be configured in two modes, namely write-through or
write-deferred (or write back or similarily). For database security, the cache
must be configured in write-through mode.
Dumping and Logging: If one cannot dispense with NFS databases or with
the disk speedup by write-deferring disk caches , one should take additional
measurements for the database’s security. Periodic dumping by the tbarc
or tbtar tool is one simple possibility. Additional logging by the ”Disk
Recovery Logging” feature even can restore a highly up-to-date database
state, however, without a correctly working sync call, some of the most
recent transactions may get lost even with Disk Recovery Logging. For this
topic see also chapter Transaction Recovery and Disk Recovery 11.
Account Logging
For convenience, the layout of the database accounting file is such that it can be
used for being spooled into a database table. It therefore has the usual Transbase
external spool format (see The Data Spooler in the TB/SQL Reference Manual).
For each event, one line (tuple) is appended to the accounting file.
Each line has the following entries:
38
7.3. DATABASE EVENTS AND ASSOCIATED INFORMATION 39
• Eventinfo CHAR(*)
additional specific information about that event
• Kernelpid INTEGER
the process-ID of the associated Transbase kernel
• Connid INTEGER
an identifier of the used connection
• Username CHAR(*)
the database login name of the application
• Clienthost CHAR(*)
the host name of the client machine where the application runs
• Descr1 CHAR(*)
additional event-specific description-1 as described below
• Descr2 CHAR(*)
additional event-specific description-2 as described below
In case of excessive length of Descr1 or Descr2, the entries in the accounting file
are truncated for not exceeding the maximum tuplesize.
All database events, whose logging can be activated are listed below together with
their specific associated informations.
ERROR The ERROR event occurs, if a Transbase kernel error happens. If the
transaction is aborted due to this error, the Eventinfo is the string ”Hard”,
otherwise the string ”Soft”.
Descr1 and Descr2 hold the short- and long-error messsages, resp. as they
are defined in the file ”tberror.h” and are written to ”tberrtxt”.
CONN The CONN event occurs at any connect- or disconnect-call to the data-
base. The Eventinfo is ”Connected” or ”Disconnecting” resp. Descr1 and
Descr2 are both NULL.
40 CHAPTER 7. ACCOUNT LOGGING
LOGIN The LOGIN event occurs at any attempt to login to the database. The
Eventinfo is ”Worked” at success or ”Failed” at any error. In this case,
Descr1 and Descr2 hold the reasons for the failure (”undefined user”, ”wrong
passwd” etc.)
APPLIC The APPLIC event occurs due to a specific request from the appli-
cation. See below for a detailed description of the programming interface
”tbx(SENDEVENT, .) and mytbxsendevent( ... )”. The Eventinfo, Descr1
and Descr2 are supplied by the application.
The Eventinfo is
In case of ”Dynamic” and ”Store”, Descr1 holds the SQL query text, otherwise it is
NULL. Descr2 is NULL in the ”Dynamic” case, otherwise it holds the Statement-
Id which identifies the stored query.
Chapter 8
Database Administration
The following chapters give a short overview over the database administration
tools.
Note: Each machine must have its own database file f.db. It must not be shared
by different machines via NFS.
tasdb /usr/transbase/tasdb@hp9000
hp9000 1 16425345 1
--EOF--
41
42 CHAPTER 8. DATABASE ADMINISTRATION
Explanation: The value ”key” is used as default key to attach to the database
shared memory and to the semaphores.
Note: It is repeated here that the entries of this file should not be updated by
the database administrator.
Each database has its own database directory. The path name of the database
directory is chosen at creation time and is denoted in f.db.
By default, all data of a database resides in files which are inside the database
directory (i.e. in subdirectories of the database directory). However, at database
creation time, one can also specify other locations for the database data.
Independent of the parameters chosen at database creation time, the database
directory contains at least a database description file named ”tbdesc”. Below is
an example for a tbdesc file of a Standard Database called ”tasdb”:
---
/usr/transbase/tasdb@hp9000/scr
/usr/transbase/tasdb@hp9000/drlog
/usr/transbase/tasdb@hp9000/bfims
8.3. SPACE ALLOCATION FOR A DATABASE 43
/usr/transbase/tasdbcd@hp9000/roms
/usr/transbase/tasdbcd@hp9000/scr
/usr/transbase/tasdbcd@hp9000/drlog
/usr/transbase/tasdbcd@hp9000/bfims
10240 8888 19312 131072 2 10 2048 10 0 1048576 500000
10000000
/usr/transbase/tasdbcd@hp9000/account/acctlog
0 0
1 1 0
EDITORIAL SYSTEM
0 1000000 0 /usr/transbase/tasdbcd@hp9000/disks/tbdsk001
0 5000000 0 /usr/transbase/tasdbcd@hp9000/roms/cd/rfile000
--EOF-
For each database, Transbase allocates three logical data containers on non-volatile
storage, namely the scratchfile container, the bfimfile container and the so called
diskfiles container.
The scratchfile container is a directory where temporary files are created as needed
(intermediate results, sorting, etc.) and destroyed at end of transaction. At
database creation time, a path can be specified for the scratchfile directory. Trans-
base must have the permission to create the directory with the specified pathname.
The directory can be on a foreign disk, e.g. mounted via NFS. As a default, Trans-
base creates the scratch directory in the database directory (as a subdirectory
called ”scratch”).
44 CHAPTER 8. DATABASE ADMINISTRATION
The bfimfile container is a directory where data is placed which serves to recover
the database data after a system crash or for transaction abort (”before images”).
Transbase supports two different recovery strategies namely ’before image logging’
and ’delta logging’ (see 11. With both methods, the changes of update transactions
are temporarily logged in files which are temporarily created and dropped in the
bfimfile container. By default, Transbase creates the bfim directory in the database
directory (as a subdirectory called ”bfims”).
It is discouraged to specify the bfimfile container on NFS mounted filesystems
because no guarantee for correct recovery of system crashes is given. See also
6.13.
Permanent data is stored in the logical diskfile container. The diskfile container
consists of 1 or several diskfiles (files of a file system) or raw devices. These
diskfiles need not reside inside the same directory (but they do by default), thus
the term ”diskfile container” is more a logical than a physical concept.
If not specified differently, Transbase names the files tbdsk001, tbdsk002 etc. At
database creation time, 1 or several diskfiles and/or raw devices can be specified.
Except in the case of raw devices, Transbase must have the permission to create the
specified diskfiles. As default, Transbase creates one diskfile named ”tbdsk001”
inside the subdirectory ”disks” which itself lies in the database directory. The
default size is 1000000 pages of 2KB each.
It is discouraged to specify diskfiles on NFS mounted filesystems because no guar-
antee for correct recovery of system crashes is given. See also 6.13.
At creation time of the database (tbadmin command), the maximum size of each
specified diskfiles must be specified. The size must be given in number of pages
(blocks). As the database is filled with data, the space on disk is allocated on a
demand basis, i.e. the diskfile(s) dynamically grow until their specified maximal
size. If space is needed but no page on any diskfile is free, Transbase reports an
error. At any time, the maximal database size can be extended by adding one or
more additional diskfiles. This is done by the administration tool tbadmin. For
46 CHAPTER 8. DATABASE ADMINISTRATION
this purpose, the database must be shut down. Similar to database creation, each
diskfile to be added can be specified by its maximal size and its placement on disk.
Of course, it has no sense to specify a diskfile size which is bigger than the operating
system can provide. Transbase maintains its own space allocation scheme within
each diskfile. For each allocatable page within a diskfile, there is a space overhead
of one bit, roughly. For example, if a diskfile is specified with maximal size of
500000 pages (about 1 GB with 2KB pages), the space overhead and thus the
initial physical size of the diskfile is about 60 KB.
Note that the first diskfile at database creation time seems to be considerably
larger as displayed by the operating system. The reason is that it contains all sys-
tem tables with their initial data. Another effect is that some database blocks are
written at predefined addresses inside the first diskfile and leave some unallocated
blocks which later on are used for user data.
Transbase supports Binary Large Objects (BLOBs) as a field type of tables. Trans-
base also supports a mechanism to dedicate one or more diskfiles to BLOB objects.
When a diskfile is dedicated for BLOBs, Transbase stores all BLOB objects (and
only BLOB objects) in that diskfile.
BLOB dedication of a diskfile is specified when the diskfile is created, i.e. either
at database creation time or when the database is extended by adding further
diskfile(s). Note that the first diskfile can never be dedicated for BLOBs because
it contains the system tables with their initial data.
If no BLOB-dedicated diskfile exists, Transbase stores BLOB and nonBLOB ob-
jects in a demand oriented interleaved manner as space is needed. Otherwise, if
at least one BLOB-dedicated diskfile exists, the page allocation scheme strictly
respects this. For example, if a BLOB were to be stored and the BLOB diskfiles
were full whereas the nonBLOB diskfiles still had free space, Transbase would
report an error and you would have to create another BLOB-dedicated diskfile.
When the first BLOB-dedicated diskfile is only created after some BLOBs have
already been stored, it is no more possible to transfer the already stored BLOBs
into the dedicated diskfiles except they are recreated as new objects and the old
versions are dropped (via deleting and reinserting the corresponding tuples of the
table).
Recall that diskfiles can be placed at different file partitions which itself reside on
different media. Thus, it is for example possible to store all BLOBs in one or more
dedicated diskfiles which are placed on magnettooptical disk drives (MOs). Also
note that the location of diskfiles can even be changed by tbadmin after they have
been created and partially or completely filled with data. This all put together
makes the disk allocation scheme of Transbase highly flexible.
8.3. SPACE ALLOCATION FOR A DATABASE 47
The location of some or all of the existing diskfiles of a database can be changed
after creation of the database. The database alter command ”tbadmin -a dbname”
is used for this purpose. There the new locations are given interactively and
tbadmin uses the operating system’s copy command to move the diskfile.
It is also possible to copy diskfiles ”by hand” and to adapt the pathnames of the
corresponding files in the database description file ”tbdesc”. Note, however, that
it is not guaranteed that this procedure will also be supported in future versions
of Transbase.
Note furthermore that it is not possible to split or merge diskfiles by hand.
When data is inserted, updated or deleted by SQL commands or some DDL com-
mand is performed, one or several diskfiles are physically updated by Transbase.
In this case, the Transbase process needs write access to the corresponding disk-
file(s).
When a session starts by the applications’s CONNECT command, the attached
Transbase database process ”tbkernel” always opens the first diskfile for reading
access of some system blocks and to check the user’s login password etc. Fur-
ther diskfiles are opened on a demand driven basis depending on the data being
requested.
Transbase always tries to open a diskfile in read/write mode. If this does not
succeed, the diskfile is opened in read-only mode. This means that database
processing is even possible if one or several diskfiles have been moved to file systems
which are mounted read-only or even to read-only media such as CD-ROM. Of
course, modification of data on read-only diskfiles is not possible.
Recall that diskfiles can be dedicated to BLOB objects. Thus it is e.g. possible
to store all BLOB objects on low cost media such as magnetooptical disks or
even transfer them to CD-ROM media. This may be an interesting cost effective
database partitioning which physically reflects the different data characteristics
(read-only versus read/write, or high traffic versus low traffic).
the jukebox system possibly must change a disk in one of its disk drive. Perhaps
the driver requires that all files of the disk to be set offline have to be closed.
Transbase provides for some commands to explicitly control the closing of the
diskfiles. In principle, the file closing commands define events when to close disk-
files (e.g. after each query or after fetching a BLOB) and limit the number of
parallel open files. The commands can be issued by the application and thus are
explained in detail in the TB/SQL Reference Manual.
Romfile containers have no meaning for Standard Databases. Their meaning for
CD Editorial and CD Retrieval Databases is explained in the Transbase CD-ROM
Database Guide.
-b boot database
-s shutdown database
-r reboot database
-i inform about database
-c create database
-a alter database
-d delete database
-C attach to CD-ROM database
-M migrate database
-drec disk recovery
Each command option has further parameters that can be seen interactively by
the command
tbadmin params option
For all command options the flag -nv can be specified which suppresses any version
output.
In the following, each command option is described in detail.
8.4. TBADMIN COMMAND LINE OPTIONS 49
8.4.1 tbadmin -b
This tbadmin option boots databases, i.e. recovers them from previous crashes
and installs their corresponding shared memories. A database must be booted
before it can be accessed by programs.
The optional f flag ignores potential semaphore collisions and omits NFS check on
files
Valid Parameters are: database names of those databases to be booted. Without
further parameters, all databases on the local machine are booted.
Note:
• Booting a database may be time consuming when the database had crashed
and a lengthy transaction had been active that must be rolled back.
• The database cannot be restored from a previous crash. In that case, a disk
recovery process must be started manually.
8.4.2 tbadmin -s
This tbadmin option shuts databases down, i.e. saves their buffers persistently to
disk and uninstalls their corresponding shared memories and semaphores. After
shutdown the database cannot be accessed by programs.
The optional f flag terminates all active Transbase kernel processes thereby abort-
ing any active transactions on the database.
Valid Parameters are: database names of those databases to be shut down. With-
out further parameters, all databases on the local machine are shut down.
50 CHAPTER 8. DATABASE ADMINISTRATION
Note:
• Booting a database may be time consuming when the database had crashed
and a lengthy transaction had been active that must be rolled back.
Potential Errors:
• Without the f flag, an error is returned when Transbase kernel processes are
running on the database.
8.4.3 tbadmin -r
8.4.4 tbadmin -i
This tbadmin option retrieves information about all databases (no parameters) or
about a specific database (dbname parameter).
Without dbname parameter, a list of all database names on the local host is given.
For a specific database (specified by its dbname), either all available information is
displayed or a specific information is retrieved specified by the following parameter
list:
n Database Name
u Number of Users
st Database Status
cp Database Codepage
id Database Ident
space Shows the number of occupied and free pages for each disk file.
52 CHAPTER 8. DATABASE ADMINISTRATION
hp=‘tbadmin -i dbname h‘
cp $hp/disks/* $tape
8.4.5 tbadmin -c
This tbadmin option creates a new database on the local machine. There is an
interactive way tbadmin -c dbname and a non-interactive, batch-oriented way
tbadmin -cf dbname param .... Please note that the dbname parameter is
mandatory. The params that may be specified in the non-interactive method
are listed below:
typ=S|E Database Type: Standard(S) or CD-Editorial(E)
rom=<path> Database rompath: a valid pathname where the romfiles may be
found. If omitted, defaults to rom/cd.
h=<path> set database home. If omitted the database home directory will be
located in the current directory and named dbname@hostname
d=[<path>] [, [<size >] [, [blob] [,pinit]]]
single database disk file specification (needed for every disk file)
<path> must be a valid path name. If omitted the pathname defaults to disks/
tbdsk001 in the database home directory.
<size> specifies the maximum size of disk file in pages. If omitted, <size> defaults
to 102400 pages.
<blob> dedicates the disk file for storage of blobs. If omitted, defaults to FALSE.
<pinit> forces the diskfile to be physically initialised (with empty pages). If
omitted, defaults to FALSE.
bf=<path>
must be a valid path name for the Before Image directory. If omitted, the path-
name defaults to bfim/ in the database home directory.
s=<path> must be a valid path name for the scratch directory. If omitted, the
pathname defaults to scratch/ in the database home directory.
drl=on|off If set to on, disk recovery is switched on for the database, i.e. logfiles
will be kept even if they are no longer needed for transaction recovery. If omitted,
disk recovery defaults to off.
8.4. TBADMIN COMMAND LINE OPTIONS 53
Note:
• The default settings of memory sizes are extremely low for backward com-
patibility.
• The default setting of the page size is very low; in any case, it should be set
higher than the block size of the underlying file system which is typically 4k
or even 8k.
• Some of the settings above cannot be changed after the database has been
created, while others can be changed by tbadmin -a.
• The physical initialization of disk files may take time and put IO load on
the machine.
8.4.6 tbadmin -a
This tbadmin option modifies database parameters after the database has been
operational. The database is shut down and rebooted after the given parameters
have been changed.
Note that some database parameters like the page size cannot be changed by
tbadmin -a.
There is an interactive way tbadmin -a dbname and a non-interactive, batch-
oriented way tbadmin -af dbname params. Please note that the dbname param-
eter is mandatory.
8.4. TBADMIN COMMAND LINE OPTIONS 55
The parameters that may be specified in the non-interactive method are listed
below:
n=<dbname>
The database is renamed to <dbname>.
dx=[<path>] [, [<size >] [, [blob] [,pinit]]]
The database is extended for one disk file with specified properties. Multiple dx
options are allowed to extend the database for more than one diskfile.
<path> must be a valid path name. If omitted the pathname defaults to disks/
tbdsk00n in the database home directory.
<size> specifies the maximum size of disk file in pages. If omitted, <size> defaults
to 102400 pages.
<blob> dedicates the disk file for storage of blobs. If omitted, defaults to FALSE.
<pinit> forces the diskfile to be physically initialised (with empty pages). If
omitted, defaults to FALSE.
bf=<path> must be a valid path name for the Before Image directory.
s=<path> must be a valid path name for the scratch directory.
drl=on|off switches disk recovery logging on or off. If on, logfiles will be kept for
archiving even if they are no longer needed for transaction recovery. If off, logfiles
are automatically dropped when no longer needed.
drs=<size in MB> specifies the size of logfiles in MBytes. If set to 0, database is
switched to Before-Image-Logging. If set to a value >0, database is switched to
Delta-Logging. See Tuning Guide
acf=<path> sets the <path> for the accounting file.
ace=[<evkey>[,<evkey>]...] sets the events to be logged into the accounting
file. Valid event keys are: NONE, ALL, ERROR, CONN, LOGIN, TA, APPLIC,
DDL, DML, STATQ, STATS
acl=on|off switches Database Accounting on or off. Events to be recorded are
kept when switched off, so that they can be reactivated.
ci=on Switches the database to be case-insensitive thereby mapping all identifiers
to to upper-case. An error occurs, if identifier names collide. Note that a database
cannot be switched back to case-sensitivity.
u=<number> sets the maximum number of concurrent sessions on the database. It
cannot be set higher than permitted by the Transbase server license. u=1 sets the
database into single-user mode.
min=<number> sets the minimum number of tbkernel processes controlled by tb-
mux
56 CHAPTER 8. DATABASE ADMINISTRATION
Note:
• The physical initialization of disk files may take time and put IO load on
the machine.
8.4.7 tbadmin -d
This tbadmin option deletes a database. The database is shut down first and then
all files are deleted and the database entry in f.db is deleted.
If the database has a non-empty tbbadmin password, the password can be specified
as command-line-option (f flag) or it is prompted interactively. Please note that
the dbname parameter is mandatory.
8.4.8 tbadmin -C
This option controls the ”attach” operation which creates a database from a CD-
ROM image. See CD-ROM guide. Command-line-parameters:
8.4. TBADMIN COMMAND LINE OPTIONS 57
If the f flag is specified, no interaction occurs except for CD-ROM insertion. If the
F flag is specified, no interaction occurs at all. In these cases, parameters have to
be specified at command-line or be set to their default values as specified below.
h=<path> Database Home: a valid pathname where the database’s home direc-
tory will be placed. If omitted the home directory will be located in the current
directory and named ”dbname@hostname”
d=[<path>] [, [<size >] [, [blob] [,pinit]]] Database disk file specifica-
tion (needed for every disk file). <path> must be a valid path name. If omitted
the pathname defaults to disks/tbdsk001 in the database home directory. <size>
specifies the maximum size of disk file in pages. If omitted, <size> defaults to
102400 pages. <blob> dedicates the disk file for storage of blobs. If omitted,
defaults to FALSE. <pinit> forces the diskfile to be physically initialised (with
empty pages). If omitted, defaults to FALSE.
bf=<path> must be a valid path name for the Before Image directory. If omitted,
the pathname defaults to bfim/ in the database home directory.
s=<path> must be a valid path name for the scratch directory. If omitted, the
pathname defaults to scratch/ in the database home directory.
r=<path> must be a valid path name for the directory where the Romfiles are
located (mounted).
rf=<file> must be a valid file name for of a Romfile.
drl=on|off If set to on, disk recovery is switched on for the database, i.e. logfiles
will be kept even if they are no longer needed for transaction recovery. If omitted,
disk recovery defaults to off.
drs=<size in MB> Specifies the size of logfiles in MBytes. If set to 0, database is
switched to Before-Image-Logging.
acf=<path> must be a valid path name for the accounting file.
ace=[<evkey>[,<evkey>]...] Lists the events to be logged into the accounting
file. Valid event keys are: NONE, ALL, ERROR, CONN, LOGIN, TA, APPLIC,
DDL, DML, STATQ, STATS
acl=on|off Switches Database Accounting on or off. Events to be recorded are
kept when switch off, so that they can be reactivated.
p=<password> specifies the tbadmin password. If omitted, the tbadmin password
is the empty string.
u=<number> sets the maximum number of concurrent sessions on the database. It
cannot be set higher than permitted by the Transbase server license. u=1 set the
database into single-user mode.
58 CHAPTER 8. DATABASE ADMINISTRATION
8.4.9 tbadmin -M
This tbadmin option is used to migrate a set of databases that has been created
with an older Transbase version to the current version.
For versions older than V5.3 you must specify a codepage for each subset of
databases. The codepage specification is ignored for databases of version 5.3 and
younger.
Note:
This tbadmin option is used to dump and restore databases completely. This
option requires the database to be delta-logged (drs>0). While a database is
being dumped, it may yet be operational (”fuzzy dump”), i.e. no shutdown is
required and the database can process user queries while being dumped.
To create an initial dump of a database for later differential dumping use the
command:
To dump a database into a single file or directly onto tape, use one of the previous
commands and replace dir=<targetdir> with file=<file>|<device>, e.g.,
Note: When dumping to a stream, i.e. to a file, device or stdout, the size of
each file to be dumped must not exceed 4GB.
To extract dumped files of a database from a single file or tape, use the command:
This will create the same structure in <dir> as if the dump was originally written
into that directory.
If the optional dir=<dir> is omitted, then the files are restored into their original
location from where they have been dumped.
The command
produces a list of database files disk/logfiles from the given file or device. Note
that for the dumping procedure is lenghly, only a preliminary file list will be
extracted from the file header and not the complete stream is processed. Thus
the file might also contain additional files that were created while the dumping
process was running and some *.act files might have become *.arc files before being
dumped.
tbadmin -drec extract only copies files into the database directory. It does not
start any recovery actions, yet.
To restore a database from a dump, use the command:
If <dir> contains an initial dump and a database <dbname> does not exist on the
system, then a new database <dbname> is created, using the dumped database
configuration settings. The user is prompted for database settings that may be
changed during the recovery process, e.g. pathnames. The command line option
-drecf forces that all interactive prompts are omitted, and the dumped configu-
ration is used unchanged. If <dbname> already exists, then recovery is performed
in-place and existing files are overwritten. If <dir> contains no initial dump, then
<dbname> must exist. Recovery from differential dumps will copy all diskfiles from
the dump, but will rather apply logfiles directly to the diskfiles where possible, in-
stead of copying, and thus reduces the required disk space of the recovery process.
This procedure may also be carried out iteratively with changing <dir> names
or its contents, resp., e.g. if files have to be extracted from tapes or file-archives.
Note, that if the database is to be recovered from file or device, then the stream
will be extracted automatically to your your disk, i.e. diskfiles are copied directly
into the database directory. Logfiles are extracted into a temporary directory
in your database home directory, since random read access to logfiles is required
during recovery which is not possible from a stream.
The disk recovery can be restricted to restore the database only until a given
point in time (e.g. when an erroneous transaction shall be backed out). Use the
command:
8.5. ACCOUNT LOGGING ADMINISTRATION 61
to specify a date value. In this case, no commits later than the specified date will
be restored.
To determine whether a dump is complete and what period a dump covers, use
the command:
The output will list all relevant files in the dump and supplies for logfiles the
timestamp of the last commit. This information might prove useful for recovery
until a given point in time. An error occurs if the dump is not complete, i.e.
if information is missing between diskfiles (or first logfile, resp.) and last logfile
in dump. If only diskfiles and no logfies are available in <dir>, no information
on commit timestamps is available. This command is only applicable on dumps
residing in a directory on disk, not on dumps in a file archive or on tape.
The recovery procedure is completed by rebooting the database, where all open
transactions are rolled back producing a consistent database state. The optional
restore reboot command for the very last recovery step, allows to restarts the
database as soon as restoration is completed and brings the database in operational
state.
The account logging component is maintained using the administration tool ”tbad-
min” or ”myadmin” resp. (see Transbase System and Installation Guide). The
following examples use the ”tbadmin” call, options and parameters are identical
with ”myadmin”.
The account logging settings can be examined by calling
Syntax on Unix:
By default the account logging file of a database has the name ”acctlog” and is
located in the database subdirectory ”account”. Name and location of this file
can be choosen at database creation time either interactively or by use of the
command line parameter ”acf=<path>”.
The accounting file can be changed via tbadmin -a[f] ... [acf=<path>] ....
This has the effect that the old file is closed and a new, empty file will be created
if account logging is switched on.
Note that the old accounting file is not deleted. It can be analyzed or spooled into
the database for further evaluation.
The set of events to be logged can be specified or changed via ”tbadmin” either
interactively or by use of the command line parameter ”ace=<evset>”.
Hereby <evset> is an optional sequence of absolute settings, followed by an op-
tional sequence of incremental settings:
Event keywords (<evkey>) are case insensitive, separators are any of <blank>,
<tab>,’,’ and ’:’.
If the specified set starts with an absolute setting, the set of active events is
overwritten. If the specified set starts with an incremental setting, the set of
active events is changed.
8.6. CODE PAGES AND LOCALE SETTING 63
From version 5.4 on, Transbase supports code pages and Locale settings that can
be configured dynamically, when creating a database. Neither the code page nor
the Locale setting can be modified after the database has been created.
The code page determines how character strings are coded. The Locale setting
determines what characters are considered characters and non-characters as well
as how characters are mapped to uppercase and lower case.
The Locale setting is not used to determine the sort order, i.e. the sort order is
always given by the machine code of the underlying computer.
Proprietary
This code page should be used when a database created by a former version
of Transbase shall be accessed. No assumptions about coding are made.
Each character is one byte wide. Characters of different code schemata can
be mixed arbitrarily.
SingleByte
This code page is very similar to Proprietary, except that character functions
respect the Locale setting of the database.
ASCII
This code page restricts all character strings to consist of ASCII characters
(below 128) exclusively. Please note that runtime errors may occur when
BINCHAR is assigned to CHAR.
UTF-8
This code page provides full Unicode support. Internally (and at the com-
munication layer) each Unicode (UCS-2) character is coded by a variable
64 CHAPTER 8. DATABASE ADMINISTRATION
sequence of one, two or three bytes. Each UCS-4 unicode character is coded
by up to six consecutive bytes.
In UTF-8 databases, the assumption that a character takes one byte may
be false. Character functions in Transbase work (and count) in term of
characters (not bytes). Space allocation functions, however, still work (and
count) in bytes.
Former versions used the so-called C-locale setting which is the default for all C
programs. From version 5.4, a specific locale can be specified for a database that
is used for all Transbase kernels on that database.
The Locale setting has influence of the character classification and also on the
mapping from upper case to lower case and vice versa (i.e. on the case sensitivity).
Please note that a reasonable Locale setting is even needed for UTF-8 databases
in order to map e.g. German Umlaut characters correctly. If no Locale setting (or
the C Locale setting) is used, such characters would not be mapped.
8.7.1 Principles
Each Transbase database either works in case sensitive (CS)or case insensitive
(CI) mode. Affected are all identifiers existing in the database schema as are
names of tables, views, fields, sequences, integrity constraints. Names are created
by DDL statements, e.g. by CREATE TABLE, CREATE INDEX etc. Names are
referenced for example in SELECT statements and are then resolved in either CS
or CI mode. In CS databases, names are stored in the catalogue tables as they have
been created. Name resolution succeeds if the referencing name exactly matches
the name as stored in the catalogue. In CI databases, all names are stored in upper
case letters in the catalogue tables (except names given in delimiter identifiers, see
next section). Name resolution converts the name to be resolved to upper case
and then tries to match it against the stored names.
For example, a table has been created via CREATE TABLE suppliers ...
In a CS database, referencing the table in a SELECT statement requires the
formulation SELECT * FROM suppliers ...
In a CI database, one could also formulate: SELECT * FROM SUPPLIERS .. or
also SELECT * FROM SuPplIeRs ...
5̌4 Please note that the upper case mapping of non-ASCII letters is determined
by the Locale setting of the database.
8.8. USING TBADMIN ON MS WINDOWS 65
In a CI database, all names created by DDL statements are stored in upper case
in the catalogue tables except names which have been formulated in double quotes
(so called delimiter identifiers). The latter are stored exactly as they have been
written (of course without the quotes). For example, CREATE TABLE "suppliers"
.. inserts the table name suppliers (in lower case). The statement SELECT * FROM
suppliers .. then fails to be resolved because unquoted names are converted to
upper case first in a CI database. The table can only be referenced by a quoted
name again, as in: SELECT * FROM "suppliers" ...
Syntax:
Effect: This option is used when tbadmin is started from another task to perform
a specific action. Especially during setup it is very useful to attach or create
databases using tbadmin.
The -notify/-notifywindow options makes tbadmin to send his exitcode to task/
wnd by using the message msg. The exitcode will be the wParam component of
msg. tbadmin will close his window at the end of the operation silently.
Chapter 9
9.1 General
The programs require to include file ”tbadmsdk.h”. The TBADM function library
is only available for Windows.
All functions resemble exactly the corresponding functions of the tbadmin com-
mand. In particular, parameters are usually passed to the library as strings. If
there is no specific argument, the parameter can be set to NULL.
The library functions return TRUE(1) to signal no error and FALSE(0) otherwise.
In case of errors, the functions TbadmGetLastErrorCode and TbadmGetLastEr-
rorText can be called for details.
9.2 TbadmLoad
Syntax:
TbadmLoad();
TbadmUnLoad
Syntax: TbadmUnLoad();
TbadmAttach
66
9.3. TBADMCREATE 67
Bool AttachCallback
(char *dbname, char *rpath, int rno, char *label)
{
int ret = MessageBox( (HWND)0, dbname, label, MB_OKCANCEL);
if (ret == IDCANCEL) return FALSE;
else return TRUE;
}
9.3 TbadmCreate
Syntax:
char *dbname: Name of the database char *args: Arguments, see tbadmin com-
mand, e.g. ”ps=4096 nc=2*1024”
9.4 TbadmAlter
Syntax:
char *dbname: Name of the database char *args: Arguments, see tbadmin com-
mand, e.g. ”nc=4*1024” or ”drs=0”
9.5 TbadmDelete
Syntax:
char *dbname: Name of the database char *args: Arguments, see tbadmin com-
mand.
68 CHAPTER 9. TBADMIN LIBRARY INTERFACE
9.6 TbadmBoot
9.7 TbadmShutdown
Syntax:
9.8 TbadmGetInfo
Syntax:
printf("%s\n", dbinfo->dbentry.d_name);
for(i=0; i<dbinfo->volumes.nrvol;i++)
printf("%-60.60s %ld\n",
dbinfo->volumes.tbadmvolume[i].volpath,
dbinfo->volumes.tbadmvolume[i].size);
9.9 TbadmGetLastErrorCode
Syntax:
TbadmGetLastErrorCode(long *e);
9.10 TbadmGetLastErrorText
Syntax:
TbadmGetLastErrorText(char **etxt);
char **etxt: Pointer to character string pointer receiving the pointer to the error
text.
9.11 TbadmMigrate
Syntax:
TbadmMigrate(char *dbname)
9.12 TbadmMonitor
Syntax:
Tools
71
72 CHAPTER 10. TOOLS
Syntax on Unix:
Syntax on Windows:
Effect: tbarc -w archives a database by spooling all database data and by pro-
ducing a script make.db for the restoration of the database. All files are placed
into one directory given by parameter archive . As far as possible, the names of
the spool files are the same as the table names, otherwise synthetic names are
generated. BLOB values are represented by file names referring to subdirectories
which contain one file for each BLOB value.
make.db contains CREATE statements for tables, indexes and views as well as
SPOOL statements from files to tables.
For tbarc -w, the specified archive is created if it does not exist, otherwise it must
be empty.
tbarc -s produces make.db without spool statements and without producing spool
files for the tables. This option runs very fast and produces a complete schema
description of a database (without archiving the database).
10.1. ARCHIVING, RESTORING, SCHEMA REPORT 73
tbarc -r restores the database by applying an archive script (as made by tbarc -w)
to a (presumably) empty database.
Options for both tbarc and tbtar are:
p=: tbarc /tbtar run under the database userid of ”tbadmin”. Without the p=
option, the caller is prompted for the appropriate password.
Limitations: Although a tbarc archive also preserves all information about do-
mains, constraints, referential constraints and privileges, it is not possible to
edit make.db with respect to these table properties. This is because make.db
does not contain corresponding DDL statements but catalog table data in
spool format. See the rse command of tbi to change a table w.r.t. con-
straints.
make.db is divided into three parts: it first handles all domains. Part 2
contains DDL statements for the creation of tables and indexes and data
loading.Part 3 contains DELETE and UPDATE statements on catalog tables
to reinstall privileges and constraints. Additional table definitions in Part 2
can be added, but arbitrary modifications in Part 2 in general make Part 3
inconsistent and should be avoided.
tbarc -r dbarchive db
tbarc -s dbarchive db
Syntax on Unix:
not available
Effect: tbtar -w writes one data stream on stdout or file. The stream embeds
all data of a database (DBarchive) or all data of one single table (tablearchive).
tbtar -r reads an input stream produced by tbtar -w and stores the data into the
target database.
tbtar -rl is like tbtar -r but uses the local SPOOL variant (see SpoolTableStatement
in the Transbase SQL ReferenceManual ). This variant can be used if the tbtar
process and the Transbase kernel process run on the same machine. This speeds
up the restoration and saves intermediate disk space.
tbtar ro reads an input stream produced by tbtar -w without building up the
database. This can be used as a procedure to test the physical correctness of a
tbtar archive.
p=[<passwd>]
tbadmin passwd
f=outfile [,maxsizeMB]
st=<tablename>
skip=<number>
count=<number>
c=<cldef_file>
p=[<passwd>]
tbadmin password
f=<infile>
ds=<tmpdiskspaceMB>
nf=<numberblobsperloadportion>
Loading a table with Blob fields requires one file per blob in
a specific directory. This option limits the number of files by
breaking up the input stream into several portions (similar
to the ds= option). The default value is 1000.
tt=<tablename>
rsfile=<outfile>
tbtar -w db
Syntax on Unix:
Syntax on Windows:
not available
10.2. TBCHECK - CORRECTNESS TEST AND STATISTICS OF A DATABASE77
not available
Effect: tbtape-w writes its input stream to the specified device or file. tbtape
writes in block sizes of size KB where 5KB is the default. If the output medium
(tape , floppy) is full, tbtape requests for a further medium before continuing.
Tbtape writes sequence numbers on the first block of each physical medium to
check the correct medium sequence during reading. On each block a continuation
flag is written to recognize whether the file has a continuation on a further medium
instance.
tbtape -r reads a tbtape file from the specified device and copies it to standard
output. If the medium is exhausted but the tbtape file is not finished then tbtape
prompts for another medium instance.
The -c option can be optionally used for binary compatibility between different
machines. Using the -c option makes tbtape converting integers in the block
headers to the machine representation. When the medium cannot read, tbtape
assumes a binary incompatibility and asks you to use the -c option and to retry.
Syntax on Unix
Syntax on Windows
Effect: tbcheck inspects the database dbname and produces on stdout a report
about all tables, indexes, BLOBs and BLOB indexes. The report comprises the
number of occupied pages on all B-tree levels, the number of tuples and the average
occupancy of pages and other info.
At the same time, tbcheck performs an intensive check of all data structures used
for storage of database data.
For this command the database must be shutdown.
Options:
-s tname Restrict the check and report on the table tname and its indexes.
Example:
tbcheck tasdb
tbcheck -T100 -s bigtable tasdb passwd
Syntax on Unix
Syntax on Windows
not available
10.4. CLEANING LOG RECORDS FOR DISTRIBUTED TRANSACTIONS79
Effect: tbdiff records all differences between two databases db1 and db2.
tbdiff produces a script and possibly some spoolfiles in directory ”scriptdir”. The
script is named ”diff.sql” and is suitable for tbi to be run.
When run on db1, ”diff.sql” transforms db1 to the state of db2.
tbdiff runs under tbadmin but otherwise appears to db1 and db2 as normal appli-
cation. tbdiff leaves both databases unchanged. However, intermediate changes
are made on db2 which are reset before tbdiff exits.
tbdiff prompts for tbadmin to log in.
The ”v” option protocols the actions on screen.
The directory scriptdir must either exist and be empty or must be creatable by
tbdiff XE ”tbdiff” .
Example:
Syntax on Unix
not available
Note: The only reason for this command is to delete useless logfiles from time
to time. For the correctness and atomicity of transactions it is not mandatory to
use this command. Beside that, it is rather unlikely that many superfluous logfiles
are produced.
Files: Files located in the ”log” subdirectory within the TRANSBASE directory.
Example:
tbrecord -c $TRANSBASE/log/log*
Chapter 11
Transaction recovery deals with the event that an update transaction is not com-
mitted but has to be rolled back such that none of its effect remain in the database.
Different circumstances may lead to the rollback of a transaction, namely either an
explicit abort call of the application or a hard runtime error detected by the kernel
such as lack of dynamic memory. The corresponding kernel itself then performs
the rollback.
In case of an unexpected kernel exit or a machine crash, possibly several trans-
actions may remain uncomitted and must be rolled back either by other kernel
instances or by the database booting procedure after reboot of the machine.
Transbase supports two different transaction recovery methods called ’before im-
age logging’ and ’delta logging’. The choice is a database configuration parameter
which can be altered via tbadmin (the latter requires a shutdown and reboot of
the database).
With this method, before images of changed database pages are stored in a file
’bfmxxxxx’ (bfims directory) which is shared among all current transactions. To
roll back a transaction, the corresponding pages are written back from the before
image file into the database diskfiles. The before image file is deleted when no
update transaction is active. Sometimes this is deferred to avoid frequent creation
and deletion, but at least at database shutdown time it is finally deleted.
This recovery method is well suited for long update transactions, especially for
mass loading, index creation and database build up. However, it performs bad for
81
82 CHAPTER 11. TRANSACTION RECOVERY AND DISK RECOVERY
short update transactions with heavy load, because all changed pages are forced
to the diskfiles at commit time followed by a sync call to the (usually very large)
diskfiles.
After a system crash, all committed transactions are already reflected in the disk-
files, thus only the interupted transactions have to be rolled back by the same
mechanism as described for runtime rollback.
Delta logging writes a sequential stream of database changes into so called ’logfiles’
which are files L0000000.act and L0000001.act and so on (each having identical
size which is configurable). The changes consist of records which describe the
updates on database pages on byte level. At commit time, the produced logfile
entries in memory are forced to their corresponding logfile. Changed pages may
remain in the database buffer pool and will later be asynchronously written to
diskfile when the page is no longer needed. While new logfiles L*.act are added,
older logfiles eventually are deleted or (if disk recovery is switched on, see later)
are renamed to the extension .arc. To roll back a transaction the corresponding
logfile entries are read backwards and applied to the pages.
After a system crash, the existing logfiles are used for two purposes: Already
committed transactions whose effects are not yet completely on diskfiles are redone
and interrupted transactions are made undone on diskfiles. This requires reading
the logfiles in both directions.
After a database shutdown, at least the most recent logfile remains existent be-
cause it is not deleted until it is filled up to its specified length.
Disk Recovery is a method to protect the most current database state against loss
of the diskfiles.
Note that only delta logging (in contrast to before image logging) provides disk
recovery functionality. Additionally, the disk recovery option has to be specified
with tbadmin to provide for disk recovery.
Note that Disk Recovery and Archiving are related closely, see ”Archiving, Restor-
ing, Schema Report” 10. With Archiving, a snapshot of the database is made at
a certain point in time. Restoring an archive reinstalls that database state and
thus in general does not reinstall the current database state.
In contrast, disk recovery provides the possibility for a backup of the most recent
database state in case that one or more diskfiles are destroyed.
11.2. DISK RECOVERY WITH DELTA LOGGING 83
To enable disk recovery, the database must be switched to delta logging and the
disk recovery log must be switched on. Detailed commands will be given in the
following section.
For disk recovery, the database must be dumped periodically with a special tbad-
min option. A database shutdown is not necessary for this dump. The database
state reflected by a dump perfomed while the database is operational, lies some-
where during the dumping procedure, therefore this dump method is sometimes
called a ”fuzzy dump”. The generated dump must be kept on a save place, e.g. a
tape or at least on another harddisk.
A full dump consists of all diskfiles and of all L*.act logfiles at the time of dumping.
There may be older logfiles L*.arc at that time in the bfims directory, i.e. they
already have been renamed from .act to .arc, but they do not become part of the
new dump. They logically belong to an older dump if there exists one.
When a full dump has been made, all changes since that dump are logged into
further logfiles in the bfims directory. Together with the dump, they provide for
the information to construct the current database state after diskfiles have been
lost.
All logfiles produced after the dump must be moved periodically to a save place.
Logfiles L*.arc need not remain in the bfims directory, but note that the newest
logfiles L*.act must not be moved from the bfims directory before they have be-
come L*.arc.
The following is for setting the database into the state required for disk recovery.
Within ”tbadmin -a db” specify:
The latter option sets logfile size to 10 MB. Any value greater than 0 automatically
swichtes to delta logging.
Instead of dumping to a directory, a dump into one single file ’file’ is made by
replacing dir=<dumpdir> with file=<file> in the dump commands, e.g.
On UNIX platforms, the dump can also be written onto a sequential drive:
Note: When dumping to a stream, i.e. to a file, device or stdout, the size of
each file to be dumped must not exceed 4GB.
11.3. COMMANDS FOR DISK RECOVERY 85
Step1: Save all the remaining logfiles which are in the bfims directory of db. Add
them to the other already saved logfiles.
Step2: Make the initial dump online accessible in a directory dumpdir on a local
or a mounted disk drive. Direct recovery from a dump that resides in a
single file or on a peripheral device is possible. But it can also be extracted
into a directory dumpdir by:
This command will use the database setting as provided in the configuration
file residing in <db>’s database directory. First all diskfiles are overwritten
with their older copies from the initial dump. Afterwards the bfims directory
is cleaned. Remember that logfiles have been saved in Step1. Finally all
logfiles from the initial dump are copied to the bfims directory. The database
now is in its initial state as it was when the first dump was made.
will build a new database <db_new> in the current directory, using the con-
figuration file from the dump. During the creation process various database
configuration settings (like paths) are changeable. The -drecf command
forces database recreation without prompting for optional configuration set-
tings, using all settings provided by the dumped database configuration.
Repeat the command you have chosen (Step3a or Step3b) until all differential
dumps have been applied.
Step4: If logfiles of the crashed database were saved in Step1 then apply them,
too, with the command from Step3.
86 CHAPTER 11. TRANSACTION RECOVERY AND DISK RECOVERY
Step5: Finally, after the last set of logfiles has been processed, issue:
resp.
The database then is at its most recent state reflected by the saved logfiles and
can be processed again.
Chapter 12
Installation of Transbase
This chapter describes how the superuser or database administrator brings the
Transbase database system into operation.
In the first section, the system resources that are needed, are described, in the
second section the installation procedure is given, and in the final section the
runtime environment is described.
Reading: ”cd” into the directory where you want to install Transbase. Extract
the files using:
87
88 CHAPTER 12. INSTALLATION OF TRANSBASE
$ TRANSBASE = /usr/transbase/tb
$ export TRANSBASE
% sh $TRANSBASE/tbperm
Note that this last tbperm command must be started under su-
peruser (tbperm performs ”chown root ..” commands for program objects
where the s-bit is set). Note additionally that the PATH variable must be
such that chown can be found by tbperm. Finally, be prepared to be asked
for license numbers by tbperm interactively.
Files: After the above commands have been run, the following files have to exist
in the TRANSBASE directory. Note that depending on license restrictions
some of the given files may be missing or some additional files will be present.
SHMSEG 6
SHMMIN 1
SHMMAX 64 kbytes
SEMMNI 10
SEMMNS 60
SEMUME 10
Disk Space: Transbase installation needs disk space of about 6 Mbytes (this may
vary considerably on different machines). Not included here is the space
needed for databases.
/etc/services: In the TCP/IP version, two entries have to be made in the file
/etc/services as follows:
The first field defines the name of the service, namely ”transbase” or ”tbker-
nel”. The next field defines that the services can be requested via TCP/IP
port number, e.g. 2024. The port number given here has to uniquely identify
this service in your local environment. If a numbers less than 1024 are cho-
sen, only superuser-processes can listen on the specified port; since tbkernel
and tbserver may be started by superuser, a port number setting of < 1024
would guarantee that only those processes and no user process could listen
on that port number.
tbserver: In the TCP/IP version, the process tbserver has to be started. Its
runtime environment variable ”TRANSBASE” must have been set to the
location of the Transbase operators. Starting of tbserver must be done af-
ter each machine reboot or after the process has unexpectedly stopped for
whatever reason.
90 CHAPTER 12. INSTALLATION OF TRANSBASE
tbkernel: In the TCP/IP version, the process tbkernel has to be started. Its
runtime environment variable ”TRANSBASE” must have been set to the
location of the Transbase operators. Starting of tbkernel must be done
after each machine reboot or after the process has unexpectedly stopped for
whatever reason.
tbadmin -b: Before accessing a database, it must have been ”booted”. Booting
the database must be done after the machine has been booted or after the
database has been explicitly shutdown. The TRANSBASE environment
variable has to be defined.
application: The application must have the TRANSBASE environment variable
defined. In order to access Transbase tools, it is recommended to include
TRANSBASE in the PATH environment also.
Note: For the sake of database security, it is recommended to pay special atten-
tion to 6.13.
The setting of the runtime environment is recommended to be done from the boot
script. Examples are given below for System V and BSD 4.2.
The simplest way to do all database startup is to call the shell script ”rc.Transbase”
located within the TRANSBASE directory.
Example:
if [ -f $TRANSBASE/rc.Transbase ] ; then
sh $TRANSBASE/rc.Transbase
fi
BSD 4.2 The file /etc/rc should contain the following lines:
TRANSBASE=/usr/transbase
export TRANSBASE
$TRANSBASE/tbkernel
$TRANSBASE/tbserver
$TRANSBASE/tbadmin -b <boot list>
After installation, program SETUP.EXE can repeatedly be called from the Trans-
base installation directory to change or adapt package licence numbers or commu-
nication protocol.
12.2.1 Configuration
Some configuration parameters for Transbase as well as for Windows and the
network are crucial for the effective and sound processing of Transbase.
92 CHAPTER 12. INSTALLATION OF TRANSBASE
Transbase uses the following hierarchical search for its configurations parameters:
TBWIN.INI Values which have not been found in step 1 are searched in file
tbwin.ini in the Windows directory (often C:\WINDOWS).
WIN.INI - Section TBWIN Values which have not been found in step 1 or 2
are searched in the Windows file WIN.INI (Windows installation directory)
in the section [TBWIN].
At installation time, the file TBWIN.INI is created with corresponding entries. Its
parameters can be changed either by a reconfiguration (call of SETUP.EXE in the
installation directory) or manually with a normal text editor (e.g. notepad.exe).
Note that section name as well as parameter name are case insensitive, however
the parameter value is case-sensitive!.
An example of file TBWIN.INI is shown below, together with a short explanation
of parameters. A more detailed explanation is given in the corresponding chapters.
[TBWIN]
TRANSBASE=D:\TB // Transbase Installation Directory
// communication protocol:
HOSTACCESS16=tbwsoc16.dll // for 16-bit environment
HOSTACCESS32=tbbun32.dll // for 32-bit environment
// local DB access
12.2. INSTALLATION UNDER WINDOWS 93
LINKED_IN=ON
// ON: local databases are connected via linked_in DLL
// OFF: local databases are connected via client server
• TRANSBASE
• If the variable EDITOR is not defined, the WINTBI command ’e[dit]’ has
no effect.
• Unless the service names for network communications are directly defined
via the TRANSBASE_SERVICENAMES variable, the file SERVICES are searched
for entries of the form:
• tbkernel <port>/<protocol>
• tbserver <port>/<protocol>
There are no Transbase configuration parameters which refer to the specific oper-
ating system.
Conventional memory in DOS-based Windows environments is treated like in other
normal programs: Transbase does not directly use DOS memory but only indi-
rectly via the underlying network protocol.
12.2.1.4 Communication
• File HOSTS
This file holds a mapping between symbolic host machine names and
Ethernet addresses.
A Transbase client connects to a databse by supporting a database
name in the form:
<database>@<host>
The hostname can either be a symbolic host name (which then is
resolved via the file HOSTS) or directly the ethernet address (e.g.
192.9.200.9).
• File SERVICES
Via this file, all available network services are listed and their corre-
sponding port addresses are defined. The following entries are relevant
for Transbase:
...
tbkernel <tbk_port>/tcp
tbserver <tbs_port>/tcp
...
These services must have been inserted both on client and server ma-
chine with consistent port addresses.
The variable TRANSBASE_SERVICENAMES (file TBWIN.INI or WIN.INI)
can override the above service names or directly define port addresses.
12.3. INSTALLATION ON NOVELL NETWARE 95
After installation, program SETUP.EXE can repeatedly be called from the Trans-
base installation directory to change or adapt package licence numbers.
12.3.1 Configuration
Some configuration parameters for Transbase are crucial for the effective and sound
processing of Transbase.
(CLIB_OPT)/P<path to tbnlm.ini>
At installation time, the file TBNLM.INI is created with corresponding entries. Its
parameters can be changed either by a reconfiguration (call of SETUP.EXE in the
installation directory) or manually with a normal text editor e.g. notepad.exe).
Note that section name as well as parameter name are case insensitive, however
the parameter value I s case-sensitive!.
An example of file TBNLM.INI is shown below, together with a short explanation
of parameters. A more detailed explanation is given in the corresponding chapters.
[TBNLM]
TRANSBASE=sys:\TB // Transbase Installation Directory
Note: The parameter TRANSBASE is mandatory Unless the service names for
network communications are directly defined via the TRANSBASE_SERVICENAMES
variable, the file SERVICES are searched for entries of the form:
• tbkernel <port>/<protocol>
• tbserver <port>/<protocol>
12.3.1.3 Communication
• File HOSTS
This file holds a mapping between symbolic host machine names and Eth-
ernet addresses.
A Transbase client connects to a database by supporting a database name
in the form:
12.3. INSTALLATION ON NOVELL NETWARE 97
<database>@<host>
The hostname can either be a symbolic host name (which then is resolved
via the file HOSTS) or directly the ethernet address (e.g. 192.9.200.9).
• File SERVICES
Via this file, all available network services are listed and their corresponding
port addresses are defined.
The following entries are relevant for Transbase:
...
tbkernel \verb#<tbk_port>/tcp#
tbserver \verb#<tbs_port>/tcp#
...
These services must have been inserted both on client and server machine
with consistent port addresses.
The variable TRANSBASE_SERVICENAMES in file TBNLM.INI can override the
above service names or directly define port addresses.
Chapter 13
Trouble Shooting
This chapter describes the most common error situations and discusses reasons
possible remedies.
Wrong configuration for remote database access The application has tried
to CONNECT to a non-local database (<database>@<host>), but Trans-
base has been configured for Linked-In communication.
Configure a network protocol via the SETUP-program in the installation
directory or by editing file TBWIN.INI (parameter HOSTACCESS16 bzw.
HOSTACCESS32).
Server not reachable Verify that Transbase daemons tbserver, tbkernel or tb-
mux have been started. The network file SERVICES must contain these
98
99
services with corresponding port numbers, this holds for client and server
machine.
An alternative is to define service name or port address directly via variable
TRANSBASE_SERVICENAMES.
Another cause for trouble may be that a Transbase kernel (on server side)
did not find its end and listens to its client though this client has abnormally
ended by a crash. In this situation, the port address remains occupied by
the clientless kernel.
To identify all kernels, issue the command
which gives a detailed list of all connections to this database. Kernels with-
out clients can be killed (UNIX-Kommando : kill -9 <pid>)
Database ... does not exist A Transbase kernel running on a host H identifies
all databases existing on H via the file F.DB which itself is addressed via
the configuration parameter TRANSBASE.
The following fields are relevant in this context (see a detailed description
in Manual System Guide):
1. Database Name
name of the database, locally unique, case sensitive.
2. Database Directory location of the database directory (holding file TB-
DESC, directories BFIM, DISKS etc.)
3. Host name
Not evaluated
4. Database Type
- 1 / 65 Transbase/Myriad Standard-Database
- 2 / 66 Transbase/Myriad Editorial-Database
- 3 / 67 Transbase/Myriad CD-ROM-Database
5. Database-Id
Locally unique database identifier.
6. Bootflag
Only evaluated on multi-user databases
Database ... not booted Multi-user databases must be booted before database
processing (Command: tbadmin -b database)
Error in File TBDESC The file TBDESC in the database directory of a spe-
cific database contains various description parameters of the database, e.g.
100 CHAPTER 13. TROUBLE SHOOTING
?
TBX already active By the tast switching mechanism, an application may get
control and enter tbx although the last TBX call has not yet been finished.
With activated task switching, each application is responsible to avoid TBX
calls if the TBX is already active (cmp. 6.7.1, 6.7.2).
Appendix A
Runtime-DLLs
tbpasc32.dll Dynamically linked
Administration
tbadm32.exe Administration System and Installation Guide: tbadmin
Communication
tbbun32.dll Linked in kernel
tbdde32.dll DDE-interface
Frontends
wtbi32.exe graphical TB/SQL-Frontend
CD-ROM-Toolkit
tbmkro32.exe CD-ROM Database Guide: tbmkrom
Develop.-Toolkit
tbx.h Transbase-Include-File Programming Interface TBX
101
Appendix B
Availability
B.1 Client
Client Platform
16-Bit-System 32-Bit-System
Win16 WfW16 Win32 WfW32 WinNT
Communication
16-Bit-Variant
Linked In x x x x x
TCP/IP
WinSocket x x x x x
PC/NFS x x x x
LWP x x x x
PC/TCP x x x x
DECNet
PathWorks x x x x
DDE
DDE x x x x x
NetworkDDE x x x x x
32-Bit-Variant
Linked In x x x
TCP/IP
WinSocket x x x
PC/NFS
LWP
PC/TCP
DDE
Local DDE x x
NetworkDDE - x
102
B.1. CLIENT 103
Note:
• The following holds: Transbase clients are available on all network systems
which are based on the socket interface of Windows, i,e, which contain a file
WINSOCK.DLL (this is a sufficient condition).
For example, PC/NFS and PC/TCP support a WINSOCK.DLL, LanWork-
Place < 4.0 does not contain a WINSOCK.DLL!
B.2 Server
Server Platform
16-Bit-System 32-Bit-System
Win16 WfW16 Win32 WfW32 WinNT
Communication
16-Bit-Variant
Linked In x x x x x
TCP/IP
WinSocket x x x x x
PC/NFS x x x x
LWP
PC/TCP x x x x
DECNet
PathWorks
DDE
Local DDE x x x x x
NetworkDDE x x x
32-Bit-Variant
Linked In x x x
TCP/IP
WinSocket x x x
DDE
Local DDE x x
NetworkDDE - x
Note:
Server-Instantiations Platform
Machine 16-Bit-System 32-Bit-System
Win16 WfW16 Win32 WfW32 WinNT
Communication
16-Bit-Variant
Linked In
tbker16.dll 1 1 1 1 1
TCP/IP
tbkwso16.exe 1 1 1 1 1
DDE
tbkdde16.exe 1 1 1 1 1
32-Bit-Variant
Linked In
tbker32.dll 1 1 1 1 ≥1
TCP/IP
tbker32.dll 1 1 ≥1 ≥1 ≥1
tbkwso32.exe 1 1 ≥1 ≥1 ≥1
DDE
tbkdde32.exe 1 1 ≥1 ≥1 ≥1
105
106 APPENDIX C. INSTANTIATION AND CONNECTIONS
Host A Host B
Single−/Mulit−
Client−Server−Connections
Single−/Multi−
Server−Databade−Connections
Single−/Multi−Databse
DB 1 DB 2 DB 3
Client-Instantiations Platform
Machine 16-Bit-System 32-Bit-System
Win16 WfW16 Win32 WfW32 WinNT
Library
16-Bit-Variant
tbx.lib 1 1 1 1 1
32-Bit-Variant
tbx32.lib 1 1 1 1 n
Client-Server Platform
Connections 16-Bit-System 32-Bit-System
Win16 WfW16 Win32 WfW32 WinNT
Communication
16-Bit-Variant
Linked In 1 1 1 1 1
Client-Server n n n n n
32-Bit-Variant
Linked In 1 1 1 1 1
Client-Server n n n n n
C.4. SINGLE-USER-DATABASE / MULTI-USER-DATABASE 107
Note: A client simultaneously can have connections with the local server as well
as with remote servers.
Of course, the number of simultaneous connections to local servers is induced by
the instantiation restrictions of the servers on this platform.
Server-Database Platform
Connections 16-Bit-System 32-Bit-System
Win16 WfW16 Win32 WfW32 WinNT
Communication
16-Bit-Variant
Linked In
tbker16.dll 1 1 1 1 1
TCP/IP
tbkwso16.exe 1 1 1 1 1
DDE
tbkdde16.exe 1 1 1 1 1
32-Bit-Variant
Linked In x x x
tbker32.dll 1 1 1 1 ≥1
TCP/IP
tbker32.exe 1 1 1 1 ≥1
tbkwso32.exe 1 1 1 1 ≥1
DDE
tbkdde32.exe 1 1 1 1 ≥1