Professional Documents
Culture Documents
No part of this document may be reproduced or transmitted in any form or by any means,
electronic or mechanical, for any purpose, without the express written permission of TEMENOS Holdings NV.
Introduction To jBASE
“Warning: This document [Banking Introduction – Courseware] is protected by copyright law and international treaties.
No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any
purpose, without the express written permission of TEMENOS Holdings NV
Unauthorized reproduction or distribution of this presentation or any portion of it, may result in severe civil and criminal penalties,
and will be prosecuted to the maximum extent possible under applicable law.”
Table of Content
Objectives............................................................................................................................................. 4
Introduction to jBASE............................................................................................................................ 4
The Architecture ................................................................................................................................... 4
Logging Onto jBASE............................................................................................................................. 4
jBASE Directory Structure..................................................................................................................... 5
jBASE Daemons ................................................................................................................................... 6
jRLA - jBASE Record Lock Arbiter ................................................................................................... 6
jPML - jBASE Process Manager and Licensing................................................................................ 6
jBTP - jBASE Background Task Processor ...................................................................................... 7
Starting And Stopping Phantoms ...................................................................................................... 7
jBASE Environmental Variables............................................................................................................ 7
JBCRELEASEDIR............................................................................................................................. 7
JBCGLOBALDIR............................................................................................................................... 7
PATH ................................................................................................................................................ 8
LIBPATH ........................................................................................................................................... 8
JBCSPOOLERDIR............................................................................................................................ 8
JBCBASETMP .................................................................................................................................. 8
JEDIFILENAME_MD ......................................................................................................................... 8
JBCLISTFILE .................................................................................................................................. 10
JBCCONNECT................................................................................................................................ 10
JBCEMULATE ................................................................................................................................ 10
jBASE .profile file ................................................................................................................................ 11
Creation and maintenance of files in jBASE........................................................................................ 12
Creating files in jBASE .................................................................................................................... 12
File Types In jBASE..................................................................................................................... 12
File Maintenance In jBASE.............................................................................................................. 15
Summary ............................................................................................................................................ 20
Objectives
• To understand the working of the jBASE database and the directory structure of jBASE.
• To understand the environmental variables that control the jBASE database
• To understand the daemons that control the working of jBASE
• To understand the different types of files in jBASE and the mechanism to create them.
• To understand the jBASE file resizing commands.
Introduction to jBASE
jBASE is an application development and database management system that enhances and extends
the UNIX Operating System. Most of the Unix commands can be executed from within jBASE. It
allows existing applications to be easily migrated from other DBMS’s, including PICK and REALITY.
jBASE uses the ‘C’ compiler to compile programs. It is an open database and hence has the capability
to communicate with other external databases like Oracle, DB2 etc with the help of drivers.
The Architecture
User
T24 (Application)
jBASE (Database)
Unix/Windows
(Operating System)
/jbase<release number>
bin Contains all the binary executables that make up the jBASE system including the
compilers.
config Contains various configuration files relating to the jPML daemon(discussed later in
this section), the configuration file for the creation of library files(Discussed in the
session ‘Infobasic Programming ‘) and other configuration files.
lib Contains the library files that are required for the working of jBASE. This directory
contains all the libraries required for linking and executing jBC compiled routines.
Shared or Dynamic libraries are also stored here. Library files stored here are similar
to dynamic link libraries (.dll) files in Windows.
tmp This is a general purpose temporary directory for runtime use.
jspooler This is the spool directory of jBASE. It contains all the files that are required for
spooling to work in jBASE. This directory is created as a part of the printer set up of
jBASE and does not get installed when jBASE is installed. Refer to documentation on
‘Printer Setup in jBASE’.
jBASE Daemons
jBASE is controlled by 3 daemons/background processes. These daemons have to be started in order
to start jBASE and they need to be stopped when jBASE needs to be stopped. At the moment, then
Unix start up and shut down scripts haven’t been modified to start/stop these daemons. Hence, a root
user/root equivalent user needs to start/stop these daemons .
When the jPML daemon is initiated, as mentioned above it reads the configuration file Config_jPML
and loads the port numbers onto the memory. When ever a user wishes to connect to the server, a
free port number is obtained from the range of port numbers loaded onto the memory and assigned to
the user.
The following examples describe the different jPML entries.
port_background = 1000 1099 - defines range for 100 background ports
port_foreground = 1100 1199 - defines range for 100 foreground ports
port_def = /dev/tty01s 33 - defines port 33 for process of ttyname /dev/tty01s
The configuration file also contains the text of the jBASE disconnect message and logon prompt
JBCGLOBALDIR
It contains the path of the Config directory(Discussed earlier in this section) of jBASE. jBASE refers
this variable when it needs to refer/read configuration files. Usually it points to the same path as that of
JBCRELEASEDIR as the config directory is present there.
JBCGLOBALDIR = /usr/jbc
PATH
It is a Unix variable used in jBASE. In Unix, it contains the search path of Unix executables. Here apart
from containing the search path of Unix executables, it will also contain the search path of jBASE
executables. As you would be aware, the bin directory under the directory where jBASE has been
installed, contains all the jBASE executables. Therefore, this variable would point to that bin directory.
PATH=$PATH:/usr/jbc/bin
Note that the search path of jBASE executables has been appended to the existing contents of the
PATH variable.
LIBPATH
It contains the path of the jBASE library files. As you would be aware by now, the jBASE library files
are stored under the lib directory, which is under the directory where jBASE has been installed.
Therefore this variable would point to that lib directory.
LIBPATH = /usr/jbc/lib
Note that the variable LIBPATH needs to be used only for AIX machines. Use SHLIB_PATH for HP
and LD_LIBRARAY_PATH for all other types of machines to store the path of jBASE executables.
JBCSPOOLERDIR
It contains the path of the spool files of jBASE. As discussed earlier, the jspooler directory under the
directory where jBASE has been installed holds all the spool files of jBASE. Therefore this variable
would point to the jspooler directory.
It is the decision of the system administrator whether to keep the jspooler directory under the directory
where jBASE has been installed or move it to a common location like /usr. In the first case, the
jspooler directory becomes jBASE release specific. All users working in that specific release of jBASE
would be using that jspooler directory. In the second case, irrespective of the release of jBASE which
the user is using, all of them will use a common tmp directory. In the below mentioned example the
jspooler directory has been moved to a common location, has been given the correct permissions as
every jBASE user needs to access it.
JBCSPOOLERDIR=/usr/jspooler
JBCBASETMP
It contains the path of the jBASE tmp directory. Every operating system and database has its own tmp
directory to store any temporary information. As mentioned earlier the directory named ‘tmp’ that gets
installed when jBASE is installed is jBASE’s tmp directory. It is the decision of the system
administrator whether to keep the tmp directory under the directory where jBASE has been installed or
more it to a common location like /usr. In the first case, the tmp directory becomes jBASE release
specific. All users working in that specific release of jBASE would be using that tmp directory. In the
second case, irrespective of the release of jBASE which the user is using, all of them will use a
common tmp directory. In the below mentioned example, the tmp directory has not been moved any
where.
JBCBASETMP=/usr/jbc/tmp
JEDIFILENAME_MD
Each jBASE account has a vocabulary file called the VOC file.The VOC file contains entries that
identify every verb, sentence, paragraph, file, keyword, and menu that you can use while you are in a
jBASE account. The command processor uses the VOC file to decide what action to take when you
enter a command.
The Voc (Vocabulary) file can also be called the MD, Master Directory
JEDIFILENAME_MD=$HOME/VOC
LIST VOC This will list all the entries in the Voc file
Q Quit process
jsh…> LIST VOC WITH TYPE = “F” To see all the ‘File’ type Voc entries.
JBCLISTFILE
This is the environmental variable that contains the path of the &SAVEDLISTS& directory. When a
SELECT statement is issued from the database prompt, the output of the SELECT statement can be
saved using the SAVE.LIST command followed by the name of a file that is to store the selected ids.
This file created by SAVE.LIST will get stored under the &SAVEDLISTS& directory and can be
retrieved any time using the GET.LIST followed by the file name.
JBCLISTFILE=$HOME/&SAVEDLISTS&
Example :
>SAVE.LIST TEMENOS
501 record(s) saved to list 'TEMENOS'
JBCEMULATE
This variable contains the emulation settings required by jBASE. Temenos uses PRIME only.
JBCEMULATE = PRIME
export HOME=/globus/bnk/bnk.run
export JBCRELEASEDIR=/usr/jbc
export JBCGLOBALDIR=%JBCRELEASEDIR%
export JBCOBJECTLIST=$HOME/lib;$HOME/globuspatchlib;$HOME/globuslib
export LD_LIBRARY_PATH=$JBCRELEASEDIR/lib
export LIBPATH=$JBCRELEASEDIR/lib
export SHLIB_PATH=$JBCRELEASEDIR/lib
export JEDIFILEPATH=$HOME
export JBCLISTFILE=$HOME/&SAVEDLISTS
export JBCSPOOLERDIR=$HOME/jspooler
export JEDIFILENAME_MD=VOC
export JEDIFILENAME_SYSTEM=/usr/jbc/src/SYSTEM
export PATH=$JBCRELEASEDIR/bin;$HOME/globuspatchbin;$HOME/globusbin
export JBCDEV_BIN=$HOME/bin
export JBCDEV_LIB=$HOME/lib
export JBCBASETMP=$JBCRELEASEDIR/tmp
export JBCEMULATE=prime
export JBASE_WARNLEVEL=30
export JBASE_INHIBIT_ZERO_USED=1
export JEDIENABLEQ2Q=1
export classpath=$classpath
export GLOBUS_HOME=$HOME
export OFS_SOURCE=GCS
export TEMENOS_HOME=$HOME
set START.GLOBUS=N
set /P START.GLOBUS="START GLOBUS Y/N="
echo “START.GLOBUS%"
if [ ans –eq ‘Y’ –o ans –eq ‘y’]
EBS.TERMINAL.SELECT
EX
fi
exec $JBCRELEASEDIR/bin/jsh –
EMPLOYEE TABLE
In jBASE, tables are referred to as files. Every file in jBASE have two portions. The DATA portion and
the DICTionary portion. Unlike other databases, jBASE stores data and the file structure separately.
The actual data of a file (records) is stored in the DATA portion of the file and the file structure (the
fields and their definitions) are stored in the DICT portion of the file. These two portions of the file may
exist in the same physical location or could exist in different physical locations.
I. Non-hashed files
II. Hashed files
Non-hashed files
These files are nothing but UNIX directories.They are used store files / programs. The file type for a
non-hashed file is ‘UD’
Hashed files
Hashed files in jBASE are used to store data files. All Globus data files are hashed. Hashed files use
Hashing algorithms to read and write data onto data files. Hashing algorithms enable dynamic
access(read and write) to data there by reducing the read and write time. There are 2 types of hashed
files namely, J3 and J4. The data and the dict portion of all hashed files are divided into groups called
‘Modulos’. The default size of one modulo if it is a J3 type hashed file is 1024 bytes and if it is a J4
type hashed file it is 4096 bytes. All Globus hashed files are of type J4.The size of the modulo is
determined by ‘Separation’. ‘Separation’ is otherwise called the multiplying factor of the modulo.
For instance, while creating a hashed file, if we specify the modulo as 4 and the separation as 4 for
both the DATA and the DICT portion of the file then, the following will be the layout of the file
Note :
When a hashed file is created in jBASE , the facility to define the secondary buffer size
is available. The default size of the secondary buffer size is twice the size of one modulo. If a
specific value is specified for the secondary buffer size then the size of the secondary buffer
size is the ‘specified value * size of one modulo’. Data gets into the secondary buffer region
when the allocated modulo get full. The secondary buffer area is not allocated at the time of
creating the file. It is only when one of the modulo get full, the secondary buffer region for all
the modulos is created. All the modulos have a pointer to the secondary buffer region.
J4 is the default type of file created in jBASE when no specific type is mentioned.
Example 1
Dict Modulo : 3
Dict Separation : 2
Dict Secondary Buffer Size : 3
Data Modulo : 4
Data Separation : 3
Data Secondary Buffer Size : Default
Solution 1
Note :
When no value is supplied for the secondary buffer size like above then the default
value of 2 is assumed.
Output
Example 2
Solution 2
Output
As you would be aware, a badly sized file will result in low performance of the system. Therefore it is
absolutely necessary to resize files periodically.
jstat
jstat is the command in jBASE that is used to determine the statistics of a hashed file.
Example 1
jstat FBNK.ACCOUNT
Output
File ../mbdemo.data/ac/FBNK.ACCOUNT
Type=J4 , Hash method = 4
Groups = 9,Frame size = 4096 bytes ,Secondary Record Size = 8192 bytes
Record Count = 2001 , Record Bytes = 775029
Bytes/Record = 387 , Bytes/Group = 86114
Primary file space: Total Frames = 196 , Total Bytes = 775029
Secondary file space: Total Frames = 0 , Total Bytes = 0
Analysis
Find below the line by line analysis of the above output of jstat.
Line 1 : Displays the relative path of the file with the actual name of the file. Files could have truncated
names because of file name length restriction imposed by Unix.
Line 2 : Displays the type of the file(J3/J4). The default hash method for all jBASE hashed files is 4
Line 3 :
Groups : Represents the modulo of the file when it was created
Frame Size : Represents the size of 1 modulo. Here the siye of 1 modulo is 4096bytes
therefore the separation would have been 1 when the file was created as it is a J4 file.
Secondary buffer size : Represents the size of the secondary buffer size. The value is
8192Bytes which is twice the size of 1 modulo. Therefore when the file was created the
secondary buffer size specified would have been 2.
When the file was created it was created as a J4 file with modulo 9, separation 1 and secondary buffer
size as 2.
Line 4 :
Record Count : Specifies the total number of records in the file at present
Record Bytes : Specifies the total number of bytes occupied by the file at present
Line 5 :
Bytes/Record : Specifies the average size of 1 record
Bytes/Group : Specifies the average size of 1 modulo at present
Line 6 :
Total Frames : If this contains a value greater than the original modulo of the file then it
denotes that the file is badly sized and needs resizing. In this example, when the file was
created, it was created with a modulo of and ‘Total Frames’ now shows a value of 196. This
file needs to be resized. In the above example a value of 196 in ‘Total Frames’ does not mean
that the number of modulos have increased automatically. Any extra space occupied by the
file to hold its data is converted in terms of modulos and specified here.
Total Bytes : Specifies the total space occupied by the file in terms of bytes.
Following are the options that can be used along with jstat.
Example 2
jstat –r FBNK.ACCOUNT
Shows modulo wise data split of data. In this example, though the size of 1 modulo is only 4096 Bytes,
each modulo seems to occupy more than 8000 Bytes of data. This denotes a sure overflow of data
and denotes the fact the file needs resizing.
Output
File ../mbdemo.data/ac/FBNK.ACCOUNT
Type=J4 , Hash method = 4
Groups = 9 , Frame size = 4096 bytes , Secondary Record Size = 8192 bytes
5 90112 87100
***************************************************************************
***************************
***************************************************************************
************************************************
6 94208 91570
***************************************************************************
***************************
***************************************************************************
*********************************************************
****
7 90112 87622
***************************************************************************
***************************
***************************************************************************
*************************************************
8 86016 82860
***************************************************************************
***************************
***************************************************************************
*************************************
jrf
Example 1
Resize the FBNK.ACCOUNT file(discussed in the above examples) to avoid any overflow of data.
Analysis
In order to resize a file we need to calculate the new modulo. The FBNK.ACCOUNT file is now
775029 Bytes big. The amount of data 1 modulo can hold is only 4096 Bytes as the separation was
specified as 1 when the file was created. In order for the FBNK.ACCOUNT file to hold 775029 Bytes of
data we would require
When deciding the modulo, the number of records that might get into the file on an average need to be
kept in mind and then calculated. In this case we could assume that this file could have about 10 new
records every week. Every record would occupy approximately about 387 Bytes. Therefore the file
would grow in size by (387 * 10 = 3870 Bytes) every week which would occupy approximately 1
modulo. Therefore we could specify the modulo as 195 so that the file would require resizing only after
a week. Files, depending on the number of records that get into them every day, need to be resized
weekly, monthly, quarterly etc.
Note :
A large separation could result in low performance as the hashing algorithms that are used to
store and retrieve data would only specify the modulo in which the record that is
requested(during a read) is present. Inside the modulo it is always a sequential search.
Therefore a huge separation will result in low performance. To determine the separation, the
average size of a record should be kept in mind.
Solution 1
The –S option with jrf is used to specify the new modulo for the file. Please note that to resize the file
the actual name of the file with the relative path(relative to the home directory) of the file needs to be
given. The relative path of the file and the actual name of the file can be obtained from the output(1st
line) of the jstat command.
Note :
When using the D and the E option to downsize and resize empty file respectively they
need to be used in conjunction with the S option as follows
jrf –DS# filename
Summary
• jBASE has a similar directory structure to that of Unix
• The bin directory contains all the jBASE executables
• The lib directory contains all the jBASE library files
• The config directory contains the configuration files of jBASE
• The tmp directory contains the temporary data that the database wishes to store
• The jspooler directory contains the jBASE spool files
• jPML is the process management and licencing daemon.
• jRLA is the jBASE record locking arbiter.
• jBTP is the jBASE back ground task processor.
• JBCRELEASEDIR contains the path where jBASE has been installed
• JBCGLOBALDIR contains the path of the jBASE config directory
• PATH contains the path of the jBASE executables ($JBCRELEASEDIR/bin)
• LIBPATH for AIX SHLIB_PATH for HP and LD_LIBRARAY_PATH are the variables that will
hold the path of the jBASE library files($JBCRELEASEDIR/lib)
• JBCSPOOLERDIR contains the path of the jBASE spooler files
• JBCBASETMP contains the path of the jBASE tmp directory
• JBCEMULATE stores the emulation settings for jBASE. Temenos only supports ‘PRIME’.
• JEDIFILENAME_MD contains the path of the VOC file
• JBCLISTFILE contains the path where saved lists need to be stored
• JBCCONNECT helps in establishing a connection to the server.
• J4 files are hashed files and the default size of 1 modulo is 4096 bytes
• J3 file are hashed files and the default size of 1 modulo is 1024 bytes
• UD files are non hashed files
• jstat is the command that is used to determine the statistics of a hashed file in jBASE
• jrf is the command that is used to resize hashed files in jBASE