You are on page 1of 20

Introduction To jBASE

DateOf Issue Version Changes By


2002 1.0 Initial Alagammai
Palaniappan
2003 1.1 jBASE Alagammai
env Palaniappan
variable
changes
March 2004 1.2 Locking Alagammai
changes Palaniappan

Information in this document is subject to change without notice.

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

“Copyright © 2004 TEMENOS HOLDINGS NV”

“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.”

Information in this document is subject to change without notice.

DateOf Issue Version Changes By


2002 1.0 Initial Alagammai
Palaniappan
2003 1.1 jBASE Alagammai
env Palaniappan
variable
changes
March 2004 1.2 Locking Alagammai
changes Palaniappan

Temenos Training Publications Page 2 of 2 March 2004


Introduction To jBASE

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

Temenos Training Publications Page 3 of 3 March 2004


Introduction To jBASE

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)

Logging Onto jBASE


When ever a user wishes to log on to T24 running on jBASE, the steps would be
1. Logon to Unix by specifying a username and password
2. Once the Unix user name and password are verified, the .profile file (remote.cmd incase it is
a Windows server) under the home directory of the user is executexd
3. It is in this .profile file that jBASE environment is setup and the user is taken to T24.
For more details on this, refer documentation on ‘T24 directory structure and important files in T24’

Temenos Training Publications Page 4 of 4 March 2004


Introduction To jBASE

jBASE Directory Structure


jBASE has a directory structure similar to that of Unix. Following are some of the
directories that get installed when jBASE is installed.

/jbase<release number>

bin config jspooler lib tmp dev

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’.

Temenos Training Publications Page 5 of 5 March 2004


Introduction To 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 .

jRLA - jBASE Record Lock Arbiter


It is imperative to understand that all databases will perform record locking and all operating systems
perform file locking as they only understand files and folders.
The lock arbiter is responsible for resolving all record locking conflicts for jBASE processes. It runs in
the background and is commonly referred to as the lockdaemon. If jRLA is not loaded, jBASE will use
the normal UNIX system locks. This is acceptable for small user populations, but the UNIX locking
mechanism has limits on the number of locks available, and on performance. Only enable the jRLA
locking daemon when no other users are executing jBASE programs, otherwise some applications will
use UNIX system locks and others will use the jRLA locking daemon. In most situations a process will
take and release locks autonomously and disregard both the lock daemon and other processes.
However in certain situations it must inform the daemon of events or ask the daemon for permission.
These situations only occur when there are clashes in locking such as when a process finds that a
record is already locked or that another process requires the same lock.
Whenever a user wishes to open a record, jRLA immediately takes control. It locks the record
irrespective of whether the record exists in the database or not and writes the locking information on
the shared memory of the server where it is running. It also updates the When a subsequent request
to open the same record is initiated from another user/process, jRLA would check the shared memory
first to see if any body else is holding a lock on that record and if so, rejects the request. Else, the
record is opened to the user. (Refer document on ‘Creating And Maintaining Files In jBASE for more
information on Locking in jBASE)

jPML - jBASE Process Manager and Licensing


The jPML daemon is responsible for managing and licensing jBASE processes and ports. It registers
and licenses jBASE processes and allocates static or dynamic port numbers. The jPML daemon also
retains certain environment details. which can then be parsed between related processes. The jPML
daemon reads the configuration file, Config_jPML, from the $JBCGLOBALDIR/config directory at
startup time. This configuration file contains the ranges of port numbers that the jPML daemon will
allocate for processes running jBASE background tasks, and also for any jBASE processes that it
cannot allocate a relative port number. The configuration file may also contain hard coded
ttyname/port number entries. These entries will override any other port number allocation scheme.

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

Temenos Training Publications Page 6 of 6 March 2004


Introduction To jBASE

jBTP - jBASE Background Task Processor


The jBTP daemon is responsible for managing and controlling jBASE background processes. The
jBTP daemon can be used to allocate/deal locate, start/stop and suspend/resume background
processes.

Starting And Stopping Phantoms


The above mentioned 3 phantoms need to be started in the following order and stopped in the reverse
order.
jRLA -ib
jPML –ib
jBTP –ib

To stop the phantoms


jBTP –k
jPML –k
jRLA -k

jBASE Environmental Variables


JBCRELEASEDIR
It contains the path where jBASE is installed. When jBASE is installed, a link is created for the
directory where jBASE has been installed to a file named jbc under the usr directory. Therefore we
can refer to /usr/jbc as the directory where jBASE has been installed.
JBCRELEASEDIR = /usr/jbc
Example
ln –s /jbase4044 /usr/jbc

/jbase4044 is the directory where jBase has been installed


/usr/jbc jbc is the name of the file under the /usr directory where to which the link has been established
A link is usually created to the directory where jBASE has been installed in order to facilitate smooth
and convenient migration of users from one jBASE environment to another. When users who are
currently working on one environment need to start working on another jBASE environment on the
same server, then instead of changing the value of the environment variables to point to the path of
the other jBASE environment, we could just remove the old link and make the link point to the
directory where other jBASE environment resides. It is a convention to create the link to /usr/jbc.

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

Temenos Training Publications Page 7 of 7 March 2004


Introduction To jBASE

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.

Temenos Training Publications Page 8 of 8 March 2004


Introduction To jBASE

The Voc (Vocabulary) file can also be called the MD, Master Directory
JEDIFILENAME_MD=$HOME/VOC

Sample Commands Pertaining To VOC

LIST VOC This will list all the entries in the Voc file
Q Quit process

Types Of VOC Entries

D Data Field Definition


F File definition
K Keyword
M Menu Record
PA Paragraph
D Remote file pointer
S Sentence
V Verbs (commands)

jsh…> LIST VOC WITH TYPE = “F” To see all the ‘File’ type Voc entries.

Below is a guide to the most commonly used entry types:

Sentence A sentence is a complete command line, including the


verb. For example LISTME:

S Sentence entry type


SELECT FBNK.CUSTOMER Sentence text
Paragraph A paragraph is a series of sentences stored together
under one name. For example LOGIN:
PA Paragraph entry type
EX Sentence 1
DATA INPUTT Sentence 2
DATA 123456 Sentence 3

Temenos Training Publications Page 9 of 9 March 2004


Introduction To jBASE

File Pointers A file pointer is used to point to files

JED VOC FBNK.CUSTOMER


FBNK.CUSTOMER
Type of VOC entry. Denotes a file.
001 F
Path of the data file with the actual truncated name
002 ../mbdemo.data/st/FBNK.CUST000
003 ../mbdemo.dict/F.CUSTOMER]D
Path of the dict file with the actual truncated name

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 :

jsh geneva ˜ -->SELECT FBNK.CUSTOMER


501 Records selected

>SAVE.LIST TEMENOS
501 record(s) saved to list 'TEMENOS'

jsh geneva ˜ -->GET.LIST TEMENOS


501 Records selected
JBCCONNECT
This is the last variable to be set in the .profile file. All other variables need to be set before this
variable. This is the variable contains the command `jbcconnect`. The `jbcconnect` command picks
up one of the free port numbers in the memory (loaded by jPML during startup) and assigns it to the
user, thus establishing a connection to the server.
JBCCONNECT = ‘jbcconnect’
Please note that this variable contains the command jbcconnect in ``(grave acent).

JBCEMULATE
This variable contains the emulation settings required by jBASE. Temenos uses PRIME only.
JBCEMULATE = PRIME

Temenos Training Publications Page 10 of 10 March 2004


Introduction To jBASE

jBASE .profile file


As you would be already aware, when a user needs to logon into t24 running on jBASE, he supplies
the Unix user name and password. Unix validates the user name and password with the /etc/passwd
file and if successful, executes the .profile file under the home directory of the user(bnk.run). Find
below the contents of the .profile file of a user in a jBASE environment.

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 –

Temenos Training Publications Page 11 of 11 March 2004


Introduction To jBASE

Creation and maintenance of files in jBASE


In an RDBMS, a table would look like

EMPLOYEE TABLE

EMP.ID NAME ADDRESS PHONE DOB


1 TOM XXX XXX XXX
2 YYY YYY YYY YYY
3 ZZZ ZZZ ZZZ ZZZ
4 XYZ XYZ XYZ XYZ

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.

1 xxx yyy S.NO -- properties


2 xxx yyy NAME -- properties
3 xxx yyy ADDRESS -- properties

DATA Portion Of A File DICT Portion Of A File

Creating files in jBASE


As mentioned above, all jBASE file have 2 portions namely, the data and the dict.

File Types In jBASE


Following are the 2 different types of files supported by jBASE.

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

Temenos Training Publications Page 12 of 12 March 2004


Introduction To jBASE

‘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

Structure Of A Hashed File Type J3

4*1024 4*1024 4*1024 4*1024 4*1024 4*1024 4*1024 4*1024


4096 4096 4096 4096 4096 4096 4096 4096
Bytes Bytes Bytes Bytes Bytes Bytes Bytes Bytes
Modulo 1 Modulo 2 Modulo 3 Modulo 4 Modulo 1 Modulo 2 Modulo 3 Modulo 4

Data Portion Of A Hashed File Dict Portion Of A Hashed File

Structure Of A Hashed File Type J4

4*4096 4*4096 4*4096 4*4096 4*4096 4*4096 4*4096 4*4096


16384 16384 16384 16384 16384 16384 16384 16384
Bytes Bytes Bytes Bytes Bytes Bytes Bytes Bytes
Modulo 1 Modulo 2 Modulo 3 Modulo 4 Modulo 1 Modulo 2 Modulo 3 Modulo 4

Data Portion Of A Hashed File Dict Portion Of A Hashed 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.

Temenos Training Publications Page 13 of 13 March 2004


Introduction To jBASE

Example 1

Create a hashed file TEMENOS of type J4 with the following values

Dict Modulo : 3
Dict Separation : 2
Dict Secondary Buffer Size : 3
Data Modulo : 4
Data Separation : 3
Data Secondary Buffer Size : Default

Solution 1

CREATE.FILE TEMENOS TYPE=J4 3,2,3 4,3

Dict Parameters Data Parameters

Note :
When no value is supplied for the secondary buffer size like above then the default
value of 2 is assumed.

Output

CREATE.FILE TEMENOS TYPE=J4 3,2,3 4,3


File TEMENOS12]D created , type = J4
File TEMENOS12 created , type = J4

Example 2

Create a non-hashed file named TEMENOS1.

Solution 2

CREATE.FILE TEMENOS1 TYPE=UD

Temenos Training Publications Page 14 of 14 March 2004


Introduction To jBASE

Output

CREATE.FILE TEMENOS1 TYPE=UD


File TEMENOS11]D created , type = UD
File TEMENOS11 created , type = UD

File Maintenance In jBASE

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

Temenos Training Publications Page 15 of 15 March 2004


Introduction To jBASE

which is what is specified in ‘Hash Method’.

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.

Options With jstat

Following are the options that can be used along with jstat.

f - free space display


r - record display
s - short summary display
v - verbose
w - do not wait on locked records

Temenos Training Publications Page 16 of 16 March 2004


Introduction To jBASE

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

Frame Allocated Used


-------- -------- --------
0 86016 83526
***************************************************************************
***************************
***************************************************************************
***************************************
1 94208 90011
***************************************************************************
***************************
***************************************************************************
*******************************************************
2 90112 86446
***************************************************************************
***************************
***************************************************************************
***********************************************
3 86016 81775
***************************************************************************
***************************
***************************************************************************
*********************************
4 86016 84119
***************************************************************************
***************************
***************************************************************************
***************************************

Temenos Training Publications Page 17 of 17 March 2004


Introduction To jBASE

5 90112 87100
***************************************************************************
***************************
***************************************************************************
************************************************
6 94208 91570
***************************************************************************
***************************
***************************************************************************
*********************************************************
****
7 90112 87622
***************************************************************************
***************************
***************************************************************************
*************************************************
8 86016 82860
***************************************************************************
***************************
***************************************************************************
*************************************

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

jrf

jrf is the command in jBASE that is used to resize hashed files.

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

Temenos Training Publications Page 18 of 18 March 2004


Introduction To jBASE

775029/4096 = 190 modulos(Approximately).

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

jrf –S195 ../mbdemo.data/ac/FBNK.ACCOUNT

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.

Options With jrf


Following are the options that can be used with the jrf command.
H# - Changes hash type to # (1-4)
D - Allows downsize
E - Resize empty files
I - Ignore empty files
R - Suggest modulo
V, -V1 - Verbose and very verbose mode
S# - Resize to modulo #

Temenos Training Publications Page 19 of 19 March 2004


Introduction To jBASE

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

Temenos Training Publications Page 20 of 20 March 2004

You might also like