R13 - TAFJ-DB Tools
R13 - TAFJ-DB Tools
R13
Temenos
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.
TAFJ-DBTools
Amendment History:
Page 2
TAFJ-DBTools
Table of Contents
Introduction............................................................................................................................................. 5
Execution – interactive mode.................................................................................................................. 5
Execution – script mode......................................................................................................................... 6
Command execution report.................................................................................................................... 7
Default mode: execution report buffered in DBTools console...........................................................7
The “log mode” could be associated to the “script mode” by combining -s and –log logFileName
parameters.....................................................................................................................................7
The “log mode” could be associated to the “console mode” by providing a log file name in the
DBTools console, from setup menu................................................................................................7
Silent mode: no execution report............................................................................................................ 9
Presentation......................................................................................................................................... 10
Header..............................................................................................................................................10
Main panel.......................................................................................................................................11
Footer...............................................................................................................................................12
Database Functionalities...................................................................................................................... 13
SQL...................................................................................................................................................13
JQL....................................................................................................................................................14
JED....................................................................................................................................................15
Extract table.....................................................................................................................................16
Load data..........................................................................................................................................18
Show Locks.......................................................................................................................................19
Release Locks....................................................................................................................................20
Database statistics............................................................................................................................21
Console Functionalities........................................................................................................................ 22
HELP.................................................................................................................................................22
History..............................................................................................................................................23
Aliases..............................................................................................................................................24
Create an alias..............................................................................................................................24
Display aliases...............................................................................................................................25
Execute an alias............................................................................................................................25
Remove an alias............................................................................................................................27
Page 3
TAFJ-DBTools
Setup................................................................................................................................................27
Navigation and display.....................................................................................................................29
JED Console application...................................................................................................................... 31
Execution – Interactive mode...........................................................................................................31
Example........................................................................................................................................31
Optional parameters....................................................................................................................31
Execution - script mode....................................................................................................................32
Example........................................................................................................................................32
Presentation.....................................................................................................................................34
Header..........................................................................................................................................34
Main panel....................................................................................................................................36
Footer...........................................................................................................................................37
Functionalities..................................................................................................................................37
Change a record...........................................................................................................................37
Delete a record.............................................................................................................................46
Validation.....................................................................................................................................47
Navigation and display.................................................................................................................50
Page 4
TAFJ-DBTools
Introduction
TAFJ-DBTools Console is made to give the ability to launch SQL / JQL statements, and integrate
various TAFJ tools that deal with database in a unique application.
It is also designed to help users to launch various commands in a quick and efficient way by providing
aliases and history functionalities. Results are being displayed with a customizable and friendly
approach.
It’s built upon TAFJ-Core framework to be independent of any native libraries and allow executing
commands and displaying results on system with possibly no X Window installed.
Finally it must be faster than launching commands with separate application as session and database
connection is being reused between each execution.
The targeted database will be the one defined in the default configuration file or in the configuration
file specified by the -cf option.
Note:
Copy all jar files from TAFJ_HOME\dbdrivers\<drivers for different databases>\ folder to
TAFJ_HOME\ext folder.
Page 5
TAFJ-DBTools
DBTools Console gives also the ability to launch automatically a default command.
Just add your command to the command line after DBTools Console invocation and it will be
executed by default.
i.e.
DBTools Console could also execute same command as interactive mode in script mode without
opening the console. You just have to add ‘-s’ option and the command you want to execute.
i.e.
Please note to script a “SELECT * FROM …” command you will have to escape the * parameter
Page 6
TAFJ-DBTools
Page 7
TAFJ-DBTools
The same applies when executing directly the command from the console.
This kind of execution is appropriate for commands that don’t produce large execution report.
The “log mode” could be associated to the “script mode” by combining -s and –log
logFileName parameters.
i.e.
In that case all FBNK_CURRENCY IDs will be outputted to the OS console and to currencyId.log under
TAFJ_HOME/log.
The “log mode” could be associated to the “console mode” by providing a log file
name in the DBTools console, from setup menu.
The setup menu is available by typing setup on the command line. Please refer to the setup section
for more information about it.
Page 8
TAFJ-DBTools
Once the log file has been setup it’s necessary to turn on the SPOOL feature to tell the console to
output the result to the log file.
It could be done by typing SPOOL on the command line. You will see that SPOOL is ON in the header
of the console. By retyping SPOOL you will turn it off and disable the logging functionality.
This way you could choose which command execution report you want to append to log file.
Page 9
TAFJ-DBTools
When providing parameter -silent in “script mode”, command will be executed silently, no output
will be generated.
i.e.
Page 10
TAFJ-DBTools
Presentation
Header panel that contains information about the current mode or running command
Main panel that contains the result of the last executed command
Footer panel that contains the command line
Header
The header presents the following information:
Page 11
TAFJ-DBTools
In SQL Mode, you will also see the auto-commit status. Please refer to SQL and setup sections to get
more information on that point.
Main panel
The main panel contains the command result to be displayed or edited. It is displayed vertically and
split into lines and eventually columns.
If the data is larger than the console maximal length (80 characters by default) it will be displayed on
multiple columns.
If the result has more lines than the console could support (20 rows by default) it will be displayed on
multiple pages.
i.e. SQL Select result that is being displayed on 2 pages and 12 columns.
Page 12
TAFJ-DBTools
For command results that can be edited, i.e. console setup parameters, a field number is displayed
on a margin on the left part of the panel; the associated value is displayed next to the margin on the
middle of the panel.
It’s then possible to access the related data by typing its associated field number on the command
line. Please refer to Setup functionality section for more information.
i.e. Setup command result that can be edited, by typing ‘2’ you will be able to change actual value
‘20’ to another value.
Footer
The footer panel contains the command line that shows by default the database connection
parameters: user name, database provider and hostname.
Depending on console setting it could also show the hostname ip address and the database name.
Page 13
TAFJ-DBTools
Database Functionalities
SQL
To execute SQL statements, first you have to enter SQL mode by typing command “SQL” on the
command line or by prefixing your SQL command with SQL keyword.
Then you will see that SQL mode is activated in the header panel and the auto-commit status.
To be recognized the statement must start with one of the following keywords in uppercase:
SELECT
INSERT
UPDATE
DELETE
CREATE
ALTER
DROP
COMMIT
ROLLBACK
DESCRIBE
By default the database connection is set to auto-commit=false, that means if you don’t apply the
COMMIT statement after your data modification, your change will be roll backed when exiting the
console.
Once your statement has been executed, the result will be displayed on the console if that statement
has got a result set, otherwise you will get information about the number of rows affected.
Page 14
TAFJ-DBTools
In case of SQL Exception the related message will be displayed on the console.
To avoid an excessive memory usage when retrieving important set of data, by default only the
first 200 rows will be displayed. You can change this parameter to the value you want, please refer
to Setup section to do so.
JQL
To execute JQL statements, first you have to enter JQL mode by typing command “JQL” on the
command line or by prefixing your JQL command with JQL keyword.
Then you will see that JQL mode is activated in the header panel.
To be recognized the statement must start with one of the following keywords in uppercase:
Page 15
TAFJ-DBTools
DBCHECK
You can execute the following commands to do checks on your database by typing DBCHECK to put
DBTools in DBCHECK mode, then USAGE to arrive at the below screen:
All commands log to a particular file that is shown to the user once the command runs.
CHECK NUMERICS iterates the dictionary items where dictionary items are defined as numeric. It
then tests those fields to make sure the data is indeed numeric. As well, it tests those VOC items that
are defined rightJustified to see if the data is numeric.
CHECK LENGTH iterates the dictionary items and gathers defined lengths and checks each against the
maximum length stored in the column. It reports anything that is incorrectly defined. THIS
COMMAND TAKES A LONG TIME TO RUN (More than 3 hours depending on the size of the DB).
CHECK MISSING TABLE iterates VOC items and tests that the tables exist in the database.
JED
Page 16
TAFJ-DBTools
You can call JED console to display and edit database records by using command JED <<FILE NAME>>
<<RECORD KEY>>
You can also call JED -s <<FILE NAME>> <<RECORD KEY>> <<FIELD NUMBER>>=<<VALUE>>; to
directly update a record without opening JED Console.
In that case, under Unix you have to put all parameters between quotes : JED ‘<<FILE NAME>>
<<RECORD KEY>> <<FIELD NUMBER>>=<<VALUE>>; ‘
Please refer to the JED Console section at the end of this document to get more information about
JED Console usage.
Extract table
Page 17
TAFJ-DBTools
This command allows extracting the records from a table and writing them on the local file system.
Depending on the option you choose, the result will be:
-f : file mode (default). A set of distinct file, one per record, the name of the file has the
format <filename>-<recordId>
-d : directory mode. A directory having the name of the table and inside this directory each
record will be stored in a distinct file, the name of this last file will be the actual record Id.
/home/user/currency
FBNK.CURRENCY -GBP
FBNK.CURRENCY -CHF
FBNK.CURRENCY -USD
...
Where FBNK.CURRENCY -GBP, FBNK.CURRENCY -CHF ... are files containing the record.
All extracted files extracted and eventually raised exceptions will be shown in the console as result.
Page 18
TAFJ-DBTools
To extract the CURRENCY table as a set of records in their own directory, just type
/home/user/
FBNK.CURRENCY/
GBP
CHF
USD
...
Page 19
TAFJ-DBTools
All extracted files extracted and eventually raised exceptions will be shown in the console as result.
Known issue: as it is possible that the record id of the record to be extracted contain the character
“/”, extraction will fail as we can’t have “/” in a file name.
Load data
This command loads data from your file system into your database. You can provide as parameter a
file to load a single record, or a directory to load a set of records i.e.:
-f : file mode (default) . The file name has the format <filename>-<recordId>
If the file passed is a directory, all files having the previous format will be processed
You will get as result displayed in the console the table impacted and the record id inserted.
Page 20
TAFJ-DBTools
Show Locks
By launching LOCKS command you will be able to see all records locked on the database. It monitors
locks managed by tLockManager or by TAFJ LOCK_RECORDS table on the database.
Page 21
TAFJ-DBTools
Release Locks
The release locks command is specially designed for tLockManager. It is used to release the Locked
record from tLockManager.
You can check which records are currently locked by launching command LOCKS and then release the
record you want by typing command RELEASE <<FILE NAME>> <<RECORD ID>>
Page 22
TAFJ-DBTools
Database statistics
This command allows to easily getting information about your JBase file, JBase file path, JBase
equivalent database filename, created date and record count.
To get information about the file you have configured type STAT <<FILE.NAME>>
Page 23
TAFJ-DBTools
Console Functionalities
HELP
When opening DBTools Console the “HELP” command will launched by default and the available
commands will be displayed on the main panel.
Page 24
TAFJ-DBTools
You can access this screen whenever you want by typing command “help” on the command line.
History
A history of last commands launched (10 last commands by default) is maintained to give the ability
to reuse quickly last used command.
You will get the resulting output that shows the list of last used command.
Page 25
TAFJ-DBTools
Whether you are under history mode or not you can recall the command you want by typing its
history index on the command line. i.e. you want to recall last SQL command just type h1 and you
will get that command executed.
Page 26
TAFJ-DBTools
Please note that history is saved at the end of your session so you have the ability to load it the
next time you will use DBTools Console. Data are stored in a properties file “DBTools” under
TAFJ_HOME/conf.
If you don’t want to keep that history for your next session, or to avoid other user to get it, as the
DBTools properties file is shared between all users, you can clear it by typing command “clear-
history”.
As mentioned before DBTools Console doesn’t rely on a user context, in consequence if many users
use it at the same time the last one who quit his session will override the properties file with his
settings.
Aliases
Create an alias
DBTools Console also provide an “alias” functionality to reuse complex command efficiently.
For example you often use the same JED statement to setup F.TSA.SERVICE, record COB, status to
“START” and number of AGENT to “TEN” : JED F.TSA.SERVICE COB 3=TEN;6=START;
Page 27
TAFJ-DBTools
Display aliases
To display all stored aliases you can type command “aliases”
Execute an alias
To execute this command just type the alias name on the command line.
Please note that if you create an alias for a SQL or JQL statement you have to switch to the
appropriate mode before calling the alias or the command won’t be recognized.
i.e.
Page 28
TAFJ-DBTools
You have also the ability to complete an alias with an additional statement, i.e. you want to add
criteria to a SQL statement.
Page 29
TAFJ-DBTools
Remove an alias
To delete an existing alias just type command unalias <<ALIAS NAME>>
Please note that aliases are saved at the end of your session so you have the ability to load it the
next time you will use DBTools Console. Data are stored in a properties file “DBTools” under
TAFJ_HOME/conf.
As mentioned before DBTools Console doesn’t rely on a user context, in consequence if many users
use it at the same time the last one who quit his session will override the properties file with his
settings.
Setup
By typing command setup you will access to some properties allowing you to customize your session.
Page 30
TAFJ-DBTools
As mentioned before these properties are stored in the DBTools properties file and are shared
between all users.
To be considered, value should be an Integer, default value is 20. Make sure your console is correctly
sized to display the requested number of records.
Page 31
TAFJ-DBTools
To be considered, value should be an Integer, default value is 80. Make sure your console is correctly
sized to display the full line length.
SQL auto-commit
This property allows you to enable / disable auto-commit on your database connection. When
running SQL statements with auto-commit set to false, your change won’t be applied unless you
execute a COMMIT statement before exiting.
Log file
This property allows logging command result to the related log file by providing a log file name.
Default value is null, which means command result won’t be logged.
Page 32
TAFJ-DBTools
It’s especially useful in case of SQL SELECT where you might want to remain fixed the first line that
displays column names, and the first column that displays the record id.
By default DBTools console will split result into columns in the case that the record to be displayed is
too large to fit on one unique column. You could disable that functionality to have your record
displayed on a single column.
Page 33
TAFJ-DBTools
TAFJ-JED application is designed to edit and modify database records by providing their file name and
record key.
The JED Console application is made to replace JED GUI application on platforms with possibly no X
Window installed. : UNIX, AIX, z/OS.
JED Console should also be faster than the current SWING based application, and built upon TAFJ-
Core framework to be independent of any native libraries.
The targeted database will be the one defined in the default configuration file or in the configuration
specified by the -cf option.
Example
To edit the record SYSTEM from SPF file.
Optional parameters
Fields per page number
By default JED console is configured to display 20 fields per page.
By providing option line: –l <fields per page number> you will be able to change dynamically this
property. Please ensure that your terminal is correctly sized to display the number of line required or
the data won’t be displayed properly.
Page 34
TAFJ-DBTools
Column names
By default JED console is configured to display a record with no field name.
If connected to T24 and by providing the column name option: -cn you will be able to retrieve the
record field names if they are defined in the related T24 application.
Help
Before editing your record, you have the ability to display JED console available functionalities by
providing the help option: -help
LOCK
By default JED console will read the requested record with no lock on it. To make a readu you have to
provide the LOCK parameter with value Y.
It is also possible to modify a record by using JED console from command line, without opening it.
That’s what we call “script mode”.
To update the record you just have to add ‘-s’ to the command and know the field(s) number you
want to change and provide the associated values.
Example
To change in file F.TSA.SERVICE, COB record, field value number of agent (WORK.PROFILE) and
service status (SERVICE.CONTROL), you have to do the following:
Page 35
TAFJ-DBTools
If you don’t have any idea of the related field numbers, firstly you have to open the record in console
mode and get these numbers.
We can see that the field numbers we want to update are 3 and 6.
Then you can type the following command to change these fields to “TWO” and “START” :
On Windows
tJed -s F.TSA.SERVICE COB 3=TWO;6=START;
On UNIX
Same command with parameters put between brackets
The record will be automatically updated to its new value without opening the console.
It also works for multi-value and sub-value. i.e. tJed –s MY.FILE MYRECORD 1.1=VM;2.1.1=SM;
Page 36
TAFJ-DBTools
Presentation
Header
File name
Record key
Record lock status : the value could be UNLOCKED (default) / LOCKED depending on LOCK
parameter provided
Page 37
TAFJ-DBTools
Record status: the value could be empty (default, that means no current change made to the
record) / WAITING (when editing a field, waiting for user entry) / PENDING (change made to
a record but not validated into database yet) / SAVED (change made to the record validated
in database).
Console display mode : value could be empty (default, that means large record will be
displayed on multiple line and on a single column) / COLUMN MODE (that means large
record will be displayed on single line and multiple column)
Page 38
TAFJ-DBTools
Main panel
The main panel contains the record to be displayed. The record is displayed vertically and is split into
lines. Each line has a number that correspond to a field, a multi-value (i.e. 1.1) or a sub-value (i.e.
1.1.1).
The field number is displayed on a margin on the left part of the panel; the associated value is
displayed next to the margin on the middle of the panel.
JED console can display 80 characters per row, by default the margin is 5 characters long and the
data part 75 characters long.
When connected to T24 it’s possible to display in the margin the field names if they are defined, by
providing –cn option.
In that case the margin length will increase and the data length will decrease.
Page 39
TAFJ-DBTools
Footer
The footer panel contains the command line that shows some of the available commands. It can also
contain some instructions related to console current mode.
Functionalities
Change a record
Edit an existing field / Multi-value / Sub-value
To edit an existing field, multi-value or sub-value just type the field, VM, SM number on the
command line, even if the field isn’t on the current page.
The prompt will be placed on the related page and line and you will be able to change the field value.
Page 40
TAFJ-DBTools
The current field value is placed into bracket that allows you to see if there are blank characters in
the current value.
To validate the change, type “enter” and you will return to command line.
You will see the record status changing from WAITING to PENDING during this process.
Page 41
TAFJ-DBTools
The prompt will be placed on the related page and line and you will be able to insert the field value.
To validate the insertion, type “enter” and you will return to command line.
You will see the record status changing from WAITING to PENDING during this process.
Page 42
TAFJ-DBTools
Page 43
TAFJ-DBTools
i.e. i 3.3 to insert a third multi-value in the third field of the record. If the third field isn’t a multi-value
yet, its current value will be set as multi-value 1 and multi-value 2 and 3 will be added.
i.e. i 4.1.2 to insert a second sub-value in the first multi-value of the fourth field of the record. If the
fourth field isn’t a multi-value neither a sub-value yet, its current value will be set as multi-value 1,
sub-value 1 and sub-value 2 will be added.
Page 44
TAFJ-DBTools
Page 45
TAFJ-DBTools
The fields, multi-values, sub-values that follow the deleted field will be renumbered.
You will see the record status changing to PENDING during this process.
Page 46
TAFJ-DBTools
Page 47
TAFJ-DBTools
Page 48
TAFJ-DBTools
Delete a record
You can delete a record by typing command d.
Page 49
TAFJ-DBTools
Validation
Cancel pending changes
You have the ability to cancel all your pending modifications by typing command c. The record will be
restored at its initial state or at its state just after your last save. You will see the record status
changing from PENDING to empty during this process.
Page 50
TAFJ-DBTools
You will see the record status changing from PENDING to SAVED.
Page 51
TAFJ-DBTools
Refresh data
The command r will allow you to reload the record from the database, that way you will be able to
see external modification that have been applied to the record since you have loaded it.
Page 52
TAFJ-DBTools
Page 53
TAFJ-DBTools
Page 54
TAFJ-DBTools
Page 55
TAFJ-DBTools
Page 56
TAFJ-DBTools
You could then pass into COLUMN MODE with command cm, the field will be displayed on a single
line and multiple columns.
Please be sure to save your pending changes before switching to column mode, as console display
will be reinitialized all unsaved modifications will be lost when changing mode.
A flag in top right of the console indicates that column mode is on.
You can now scroll right and left to visualize the entire field, by using commands sr and sl.
Page 57
TAFJ-DBTools
i.e. use command sr to scroll right to next column, and so on until the end of field.
Page 58
TAFJ-DBTools
By typing cm command you will disable the column mode and get back to the classic mode.
Page 59
TAFJ-DBTools
Display help
An integrated help that sum up the available command can be reached by using help command.
Page 60
TAFJ-DBTools
Page 61