TAFJ-DB Tools
TAFJ-DB Tools
TAFJ-DB Tools
R16
TAFJ-DBTool s
Amendment History:
Revisio
Date Amended Name Description
n
7st February
2 H. Aubert R12GA review
2012
26 October
3 JN. Charpin Command execution report
2012
15 January
4 JN. Charpin R13 review
2013
17 February
5 JN. Charpin R14 review
2014
6 10th April 2014 R. Vincent Add ShowDicts documentation for JQL mode.
27th August
10 R. Vincent Promoted column example and further doc
2015
25th November
12 H M Hamsa DBTools security enhancement. Add User inclusion.
2015
Page 2
TAFJ-DBTool s
2016
25th February
14 R. Vincent Add CREATE-FILE syntax and update doc.
2016
18th March
17 M. Kumar R16 AMR Review
2016
Vinod Modified the file name & path for the aliases and
19 2nd May 2018
Shunmugavel history data storage.
Page 3
TAFJ-DBTool s
Copyri g h t
Copyright (c) 2014 TEMENOS HOLDINGS NV
All rights reserved.
This document contains proprietary information that is protected by copyright. No part of this document may
be reproduced, transmitted, or made available directly or indirectly to a third party without the express
written agreement of TEMENOS UK Limited. Receipt of this material directly TEMENOS UK Limited
constitutes its express permission to copy. Permission to use or copy this document expressly excludes
modifying it for any purpose, or using it to create a derivative therefrom.
Temenos Headquarters SA
2 Rue de l’Ecole-de-Chimie,
CH - 1205 Geneva,
Switzerland
Please include your name, company, address, and telephone and fax numbers, and email
address if applicable. TAFJdev@temenos.com
Page 4
TAFJ-DBTool s
Table of Contents
Copyright................................................................................................................................................ 4
Errata and Comments............................................................................................................................ 4
DBTools.................................................................................................................................................. 8
Introduction.......................................................................................................................... 8
Syntax................................................................................................................................. 9
Execution – interactive mode...........................................................................................9
Execution – script mode.................................................................................................10
Silent mode: no execution report....................................................................................12
Presentation...................................................................................................................... 13
Header........................................................................................................................... 14
Main panel..................................................................................................................... 14
Footer............................................................................................................................ 16
Database Functionalities...................................................................................................16
SQL................................................................................................................................ 16
JQL................................................................................................................................ 17
OFS............................................................................................................................... 19
CHANGE-TABLETYPE..................................................................................................21
DBCHECK..................................................................................................................... 22
JED................................................................................................................................ 24
Extract table................................................................................................................... 25
Load data....................................................................................................................... 27
Show Locks................................................................................................................... 28
Release Locks............................................................................................................... 30
Database statistics.........................................................................................................32
Console Functionalities.....................................................................................................33
HELP............................................................................................................................. 33
History............................................................................................................................ 34
Aliases........................................................................................................................... 35
Create an alias...............................................................................................................35
Display aliases............................................................................................................... 36
Page 5
TAFJ-DBTool s
Execute an alias.............................................................................................................36
Remove an alias............................................................................................................ 38
Setup................................................................................................................................. 39
Max row retrieved ( SQL)...............................................................................................39
Max records per page....................................................................................................39
Max line length...............................................................................................................40
History size max.............................................................................................................40
Show session long name...............................................................................................40
Show page number........................................................................................................40
SQL auto-commit...........................................................................................................40
Log file........................................................................................................................... 40
Navigation and display......................................................................................................41
Change page/ column....................................................................................................41
Change console display.................................................................................................41
Add User Application............................................................................................................................ 42
Introduction........................................................................................................................ 42
Syntax............................................................................................................................... 42
Example............................................................................................................................ 42
JED Console application...................................................................................................................... 43
Syntax............................................................................................................................... 43
Execution – Interactive mode.........................................................................................43
Optional parameters......................................................................................................43
Execution - script mode..................................................................................................44
Presentation...................................................................................................................... 46
Header........................................................................................................................... 46
Main panel..................................................................................................................... 48
Footer............................................................................................................................ 49
Functionalities................................................................................................................... 49
Change a record............................................................................................................ 49
Delete a record..............................................................................................................58
Validation....................................................................................................................... 59
Navigation and display...................................................................................................62
DBCheck.............................................................................................................................................. 71
Introduction........................................................................................................................ 71
Page 6
TAFJ-DBTool s
Syntax............................................................................................................................... 71
Example............................................................................................................................ 71
DBComparer......................................................................................................................................... 72
Introduction........................................................................................................................ 72
Requirements.................................................................................................................... 72
Syntax............................................................................................................................... 72
Example............................................................................................................................ 73
TAFJ Promoted Columns..................................................................................................................... 74
Promoting Columns for SQLServer example.....................................................................74
Promoting Columns for DB2 example................................................................................75
Promoting Columns for Oracle example............................................................................75
Drop and Recreate the Views (All Databases)...................................................................75
USE CASE........................................................................................................................ 78
Alter Table for each multi-value......................................................................................78
Create Indexes for each new column.............................................................................78
Recreate the view with new columns.............................................................................78
Change query................................................................................................................79
Page 7
TAFJ-DBTool s
DBT o o l s
Intr o d u c t i o n
TAFJ-DBTools will be accessed only with authenticated users. Hence username and
password has to be passed as parameters to DBTools. The users to access DBTools needs
to be created using a file tUserMgnt.bat/tUserMgnt.sh. If there are 3 unsuccessful attempts,
user gets blocked. The blocked user cannot be used further until the user is reset with a new
password or delete/re-create.
TAFJ-DBTools Console provides access to SQL / JQL / OFS statements, and integrates
various TAFJ tools that deal with database within 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.
Page 8
TAFJ-DBTool s
Syn t a x
Exe c u t i o n – int e r a c t i v e mo d e
The targeted database is the one defined in the default configuration file or in the
configuration file specified with the -cf option. The username and password has to be passed
along with –u and –p option respectively.
Note:
Copy all jar files from TAFJ_HOME\dbdrivers\<drivers for different databases>\ folder to
TAFJ_HOME\ext folder.
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.
Page 9
TAFJ-DBTool s
Exe c u t i o n – scrip t mo d e
DBTools Console could also execute command 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
By default without any parameter specified, DBTools console is opened, the command is
executed and result is appended to a buffer and displayed in the console at the end of the
execution.
Page 10
TAFJ-DBTool s
When providing -log logFileName execution report is redirected live to the related log file.
This file is generated with .log extension under TAFJ_HOME/log
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.
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.
Page 11
TAFJ-DBTool s
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.
When providing parameter -silent in “script mode”, command is executed silently, no output
is generated.
i.e.
Page 12
TAFJ-DBTool s
Pre s e n t a t i o n
Header panel that contains information about the current mode or running command
Main panel that contains the result of the last executed command
Page 13
TAFJ-DBTool s
He a d e r
The header presents the following information:
The current page / column number and the total number of page / column if the result
of the command is being displayed on multiple page and/or columns.
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.
Mai n pan e l
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 14
TAFJ-DBTool s
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.
Page 15
TAFJ-DBTool s
Foot e r
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.
Dat a b a s e Fun c t i o n a l i t i e s
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
Page 16
TAFJ-DBTool s
CREATE
ALTER
DROP
COMMIT
ROLLBACK
DESCRIBE
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.
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.
Page 17
TAFJ-DBTool s
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 18
TAFJ-DBTool s
SHOWDICTS allows you to search all dictionary items. Logs show up in $TAFJ_HOME/log.
If the FILE parameter is not specified, the default ShowDicts.txt is used.
This example below shows any dict item I type with ATTRIBUTE 2 containing the search
“ENQ.TRANS”:
OFS
To execute OFS statements, first you have to enter OFS mode by typing command “OFS”
on the command line or by prefixing your OFS command with OFS keyword.
Page 19
TAFJ-DBTool s
Then you will see that OFS mode is activated in the header panel.
The console is now ready to execute OFS statements, please note that your TAFJ properties
file must point to a valid T24 precompile directory or jars.
Page 20
TAFJ-DBTool s
CHANGE- TABLETYPE
CHANGE-TABLETYPE statements will allow you to change a table type from one type of
data storage to another (example, from XML to CLOB, or vice-versa) while moving the
existing data to the new format. A backup file is created with the original data named with
the suffix .BACKUP of the target file. This backup file is deleted by default. Dictionary
tables are not supported. In addition, types currently supported are XML, CLOB,
BLOB, and VARCHAR at the moment.
Syn t a x
The CHANGE-TABLETYPE syntax is the following:
Exa m p l e
Page 21
TAFJ-DBTool s
DBC HECK
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:
Page 22
TAFJ-DBTool s
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.
Page 23
TAFJ-DBTool s
JED
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.
Depending on the operating system you could have to escape the part of command after -s
option with quotes: JED -s ‘F.TSA.SERVICE COB 6=START;’
Please refer to the JED Console section at the end of this document to get more information
about JED Console usage.
Page 24
TAFJ-DBTool s
Extra c t tabl e
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 25
TAFJ-DBTool s
To extract the CURRENCY table as a set of records in their own directory, just type
/home/user/
FBNK.CURRENCY/
GBP
CHF
USD
...
Page 26
TAFJ-DBTool s
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 27
TAFJ-DBTool s
Sh o w Lock s
By launching LOCKS command you will be able to see all records locked on the database. It
monitors locks managed by tLockManager, the TAFJ LOCK_RECORDS table (JDBC
Locking), or ORCL, or MSQL, or DATABASE internal locking on the database. Below is a
screenshot from tLockManager.
Note that MSQL LockManager will crash Eclipse with sqljdbc_4.1 drivers and will not
produce the right results (DBTools LOCKS command). It should also be noted that sp_lock
command truncates data. Version sqljdbc_1.2 of drivers have been tested and work.
Page 28
TAFJ-DBTool s
This is different than what you might see with DATABASE locking. When issuing the LOCKS
command, non-existent rows will appear as NonExist*<<TAFJ Session Unique ID>> for the
Session Id column, whereas one that was taken via SELECT FOR UPDATE, will show the
Oracle Session ID for the Session Id column. One cannot release locks taken with SELECT
FOR UPDATE. The Oracle session must be either committed, rolled back, or killed. As well,
tables with more than 25,000 rows will show up as F_PGM_DATA_CONTROL *UNKNOWN,
if F_PGM_DATA_CONTROL had more than 25,000 rows. This is because Oracle has no
way to report row level locking except by iterating all of the rows and attempting to lock them.
This is very costly in terms of performance, and hence, why TAFJ caps the number of rows.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
LOCK ID |Session Id
FBNK_CURRENCY*ZZZ |NonExist*1193893622
FBNK_CATEG_ENTRY*169376209561194.050001|128
This is also different than what you might see with ORCL, or MSSQL locking. Below is a
screenshot of ORCL locking. The 53 below denotes the database session id that called the
Page 29
TAFJ-DBTool s
lock. 205121125 represents the TAFJ unique session for a thread. So now TAFJ can match
a java thread with the database session that locked it.
---------------------------------------------------------------------------
-DOWN
tafjuser@10.41.5.54:TESTDB>LOCKS
---------------------------------------------------------------------------
-----
DBTools SHOW LOCKS P1:1
C1:1
---------------------------------------------------------------------------
-----
LOCK ID |Session Id
FBNK_CURRENCY*USD|2051521125*53
Keep in mind that there is one connection for a thread actually asking for a lock, and another
connection that actually takes the lock (this is due to auto-commiting of the lock connection).
What is reported is the database session id for the lock connection which will also appear in
the locking.log (for JDBC Locking it will only appear in the log).
Rel e a s e Lock s
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 30
TAFJ-DBTool s
Page 31
TAFJ-DBTool s
Note: With ORCL and MSQL locking, it is not possible to release locks because DBTools
does not own the database session where the lock was taken. As well, with DATABASE
locking, it is not possible to release locks that have been taken with SELECT FOR UPDATE
(see above SHOW LOCKS section for more details) for the same reason.
Data b a s e stati s t i c s
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 32
TAFJ-DBTool s
Con s o l e Fun c t i o n a l i t i e s
HELP
When opening DBTools Console the “HELP” command will launched by default and the
available commands will be displayed on the main panel.
Page 33
TAFJ-DBTool s
You can access this screen whenever you want by typing command “help” on the command
line.
His t o r y
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 34
TAFJ-DBTool s
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 35
TAFJ-DBTool s
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
“.TAFJ_DBTools” under %USERPROFILE% on windows and under $HOME on linux.
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”.
Alias e s
Creat e an alia s
DBTools Console also provides 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 36
TAFJ-DBTool s
Dis p l ay alia s e s
To display all stored aliases you can type command “aliases”
Exe c u t e an alia s
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 37
TAFJ-DBTool s
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 38
TAFJ-DBTool s
Re m o v e an alia s
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
“.TAFJ_DBTools” under %USERPROFILE% on windows and under $HOME on linux.
Page 39
TAFJ-DBTool s
Se t u p
By typing command setup you will access to some properties allowing you to customize your
session.
As mentioned before these properties are stored in the DBTools properties file and are
shared between all users.
Page 40
TAFJ-DBTool s
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.
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.
Sh o w se s s i o n lon g na m e
This property allows you to customize the session name that would be displayed in the footer
panel. When set to ‘true’ session long name is applied.
Sh o w pag e nu m b e r
This property allows you to display or not information about page number and column
number in header panel.
SQL aut o - co m m i t
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 41
TAFJ-DBTool s
Cha n g e pa g e / col u m n
For results that can’t be displayed on a single page and/or a single column (by default 20
lines are being displayed per page and a line is 80 characters long), you have the ability to
navigate between pages by using the following commands:
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 42
TAFJ-DBTool s
Us er Man a g e m e n t Appli c a t i o n
Intr o d u c t i o n
tUserMgnt is a User application designed to add/Del/Reset users for use of DBTools and
JED applications.
Syn t a x
The username and encrypted password gets stored in the property file. With the created
username and password one can access DBTools and JED application. The username and
password has to be passed along with –u and –p option respectively. The username and
password is mandatory if either of them passed as null then message “Missing user
credentials, please provide a user and password: -u username -p password” is displayed.
Exa m p l e :
Page 43
TAFJ-DBTool s
Page 44
TAFJ-DBTool s
Syn t a x
TAFJ-JED will be accessed only with authenticated users. Hence username and password
has to be passed as parameters to JED. The users to access JED needs to be created using
a tUserMgnt.bat/tUserMgnt.sh.
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.
Exe c u t i o n – Inte r a c t i v e mo d e
The targeted database will be the one defined in the default configuration file or in the
configuration specified by the -cf option. The username and password has to be passed
along with –u and –p option respectively.
Exa m p l e
To edit the record SYSTEM from SPF file.
Optio n a l para m e t e r s
Fiel d s pe r pa g e nu m b e r
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.
Colu m n na m e s
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.
Hel p
Before editing your record, you have the ability to display JED console available
functionalities by providing the help option: -help
LOC K
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.
JED Gra p h i c a l m o d e
By providing option graphical user interface: -gui you will be able to launch JED in graphical
mode.
tJed -u <username> –p <password> -gui F.SPF
SYSTEM
Exe c u t i o n - scrip t mo d e
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.
Exa m p l e
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 46
TAFJ-DBTool s
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” :
Note: depending on the operating system you could have to escape the part of command
after -s option with quotes: JED -s ‘F.TSA.SERVICE COB 3=TWO;6=START;’
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 -u <username> –p <password> -s
MY.FILE MYRECORD 1.1=VM;2.1.1=SM;
Page 47
TAFJ-DBTool s
Pre s e n t a t i o n
He a d e r
File name
Record key
Page 48
TAFJ-DBTool s
Record lock status : the value could be UNLOCKED (default) / LOCKED depending
on LOCK parameter provided
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 49
TAFJ-DBTool s
Mai n pan e l
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 50
TAFJ-DBTool s
Foot e r
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.
Fun c t i o n a l i t i e s
Cha n g e a rec o r d
Edi t an exi s t i n g fiel d / Mul t i - val u e / Su b - val u e
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 51
TAFJ-DBTool s
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 52
TAFJ-DBTool s
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 53
TAFJ-DBTool s
Page 54
TAFJ-DBTool s
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 55
TAFJ-DBTool s
Page 56
TAFJ-DBTool s
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 57
TAFJ-DBTool s
Page 58
TAFJ-DBTool s
Page 59
TAFJ-DBTool s
Del e t e a rec o r d
You can delete a record by typing command d.
Page 60
TAFJ-DBTool s
Valid a t i o n
Can c e l pe n d i n g ch a n g e s
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 61
TAFJ-DBTool s
Sav e pe n d i n g ch a n g e s
To update your pending modifications into database, you can use command s.
You will see the record status changing from PENDING to SAVED.
Page 62
TAFJ-DBTool s
Ref r e s h da t a
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 63
TAFJ-DBTool s
Page 64
TAFJ-DBTool s
Page 65
TAFJ-DBTool s
Cha n g e col u m n na m e m o d e
If you launched JED console with -cn option you will be able to enable and disable the field
name display in the margin on left part of the screen.
Page 66
TAFJ-DBTool s
Page 67
TAFJ-DBTool s
Cha n g e col u m n m o d e
By default JED console will split into as many lines as necessary, fields that are too large to
be displayed on a single line.
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 68
TAFJ-DBTool s
i.e. use command sr to scroll right to next column, and so on until the end of field.
Page 69
TAFJ-DBTool s
By typing cm command you will disable the column mode and get back to the classic mode.
Page 70
TAFJ-DBTool s
Dis p l a y hel p
An integrated help that sum up the available command can be reached by using help
command.
Page 71
TAFJ-DBTool s
Page 72
TAFJ-DBTool s
DBC h e c k
Intr o d u c t i o n
DBCheck is part of the TAFJ-DB tools. It allows checking your database integrity by
selecting from the TAFJ_VOC all the tables, and for each, it will do the following:
These operations are being displayed on the console with the format:
Table name - Table type - W(write) R(read) RU (read and lock) D (delete) - Time elapsed
Syn t a x
The DBCheck syntax is the following:
The targeted database will be the one defined in your default configuration file or in the
configuration specified by the -cf option.
Exa m p l e
DBCheck
Page 73
TAFJ-DBTool s
___________________________________DB Check_________________________________
1) FBNK.AA.ARR.ACTIVITY.API$HIS Type =XML WRRUD 407 ms [DONE ]
2) FEU1.AA.ARR.ACTIVITY.API$NAU Type =XML WRRUD 31 ms [DONE ]
3) FBNK.AA.ARR.ACTIVITY.CHARGES Type =XML WRRUD 31 ms [DONE ]
4) FMF1.AA.ARR.ACTIVITY.CHARGES$NAU Type =XML WRRUD 47 ms [DONE ]
5) FSG1.AA.ARR.ACTIVITY.CHARGES$SIM Type =XML WRRUD 47 ms [DONE ]
6) FEU1.AA.ARR.ACTIVITY.MAPPING$NAU Type =XML WRRUD 47 ms [DONE ]
…….
17673) FSG1.SC.FEE.GROUP.HIST Type =XML WRRUD 31 ms [DONE ]
17674) FSG1.SC.FEE.GROUP.HIST$NAU Type =XML WRRUD 16 ms [DONE ]
17675) FSG1.SC.FEES.MODIFY Type =XML WRRUD 15 ms [DONE ]
17676) FSG1.SC.FUND.FLOW Type =XML WRRUD 32 ms [DONE ]
_____________________________________________________________________________
DBC o m p a r e r
Intr o d u c t i o n
DBComparer is part of the TAFJ-DB tools. It compares the structure and data from two
databases defined in the configuration file: the main database and the comparer. It will stop
as soon as it will find a difference and it will indicate it in the console.
Req u ir e m e n t s
As for the targeted database, the following properties must be set to define the comparer:
- temn.tafj.jdbc.url.comparer
- temn.tafj.jdbc.driver.comparer
- temn.tafj.jdbc.username.comparer
- temn.tafj.jdbc.password.comparer
-files : A comma separated list of files without spaces to include (without whole
VOC) in the comparison
-startwithfile : All of the files before the file specified in the VOC will be skipped.
Syn t a x
The DBComparer syntax to perform a full comparison is the following:
Page 74
TAFJ-DBTool s
DBComparer
Exa m p l e
To run a comparison that starts at the mentioned file in the VOC.
In case of difference in the structure the resulting output looks like this:
___________________________________DBComparer__________________________________
Voc Record Key: %DATA.ACC.VOC
Voc Record Key: %DATA.ACCOUNT
Voc Record Key: %DICTIONARY
Voc Record Key: %OTHER.VOC
Unable to correctly select VOC record from comparer database: %OTHER.VOC
In case of difference in the data the resulting output looks like this:
___________________________________DBComparer__________________________________
pool- 1-thread- 1 file: (-1) F.TT.TELLER.HP.VERSIONS Checking record: 1
pool- 1-thread- 1 file: (-1) F.TSA.WORKLOAD.PROFILE$HIS Checking record: 1
pool- 1-thread- 1 file: (-1) F.TSA.WORKLOAD.PROFILE Checking record: 1
java.lang.RuntimeException: DB::SSELECT::Comparer returned count 214 where
other returned count 219
Comparer list:
Other list: F.TSA.STATUS
cancelling other threads.
Page 75
TAFJ-DBTool s
The below SQL mode command outputs a script to create a promoted column for indexing.
Use it with the SPOOL command.
Here is an example:
tafj@localhost:TB201507>SPOOL
tafj@localhost:TB201507>SPOOL
Page 76
TAFJ-DBTool s
This is a DB2 example only for recreating the view to use the new column RANK.
Page 77
TAFJ-DBTool s
,a.RECID "CURRENCY_CODE"
,RANK "RANK"
,XMLCAST(XMLQUERY('$d/row/c2[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000))
"NUMERIC_CCY_CODE"
,XMLCAST(XMLQUERY('$d/row/c3[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000)) "CCY_NAME"
,XMLQUERY('$d/row/c3' passing a.XMLRECORD as "d") "CCY_NAME_3"
,XMLCAST(XMLQUERY('$d/row/c4[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000)) "NO_OF_DECIMALS"
,XMLCAST(XMLQUERY('$d/row/c5[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000)) "QUOTATION_CODE"
,XMLCAST(XMLQUERY('$d/row/c6[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000)) "QUOTATION_PIPS"
,XMLCAST(XMLQUERY('$d/row/c7[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000)) "DAYS_DELIVERY"
,XMLCAST(XMLQUERY('$d/row/c8[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000)) "DAYS_FORWARD"
,XMLCAST(XMLQUERY('$d/row/c9[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000))
"INTEREST_DAY_BASIS"
,XMLCAST(XMLQUERY('$d/row/c10[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000))
"RATE_ALLOWANCE"
,XMLCAST(XMLQUERY('$d/row/c11[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000)) "FIXING_DATE"
,XMLCAST(XMLQUERY('$d/row/c12[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000))
"CURRENCY_MARKET"
,XMLQUERY('$d/row/c12' passing a.XMLRECORD as "d") "CURRENCY_MARKET_12"
,XMLCAST(XMLQUERY('$d/row/c13[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000))
"QUOTATION_SUSP"
,XMLQUERY('$d/row/c13' passing a.XMLRECORD as "d") "QUOTATION_SUSP_13"
,XMLCAST(XMLQUERY('$d/row/c14[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000)) "MID_REVAL_RATE"
,XMLQUERY('$d/row/c14' passing a.XMLRECORD as "d") "MID_REVAL_RATE_14"
,XMLCAST(XMLQUERY('$d/row/c15[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000))
"DEFAULT_SPREAD"
,XMLQUERY('$d/row/c15' passing a.XMLRECORD as "d") "DEFAULT_SPREAD_15"
,XMLCAST(XMLQUERY('$d/row/c16[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000)) "BUY_RATE"
,XMLQUERY('$d/row/c16' passing a.XMLRECORD as "d") "BUY_RATE_16"
,XMLCAST(XMLQUERY('$d/row/c17[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000)) "SELL_RATE"
,XMLQUERY('$d/row/c17' passing a.XMLRECORD as "d") "SELL_RATE_17"
,XMLCAST(XMLQUERY('$d/row/c18[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000))
"UPTO_SMALL_AMT"
,XMLQUERY('$d/row/c18' passing a.XMLRECORD as "d") "UPTO_SMALL_AMT_18"
,XMLCAST(XMLQUERY('$d/row/c19[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000))
"TRSY_SMALL_SPRD"
,XMLQUERY('$d/row/c19' passing a.XMLRECORD as "d") "TRSY_SMALL_SPRD_19"
,XMLCAST(XMLQUERY('$d/row/c20[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000))
"CUST_SMALL_SPRD"
,XMLQUERY('$d/row/c20' passing a.XMLRECORD as "d") "CUST_SMALL_SPRD_20"
,XMLCAST(XMLQUERY('$d/row/c21[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000)) "NEGOTIABLE_AMT"
,XMLQUERY('$d/row/c21' passing a.XMLRECORD as "d") "NEGOTIABLE_AMT_21"
,XMLCAST(XMLQUERY('$d/row/c22[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000))
"TRSY_MED_SPREAD"
,XMLQUERY('$d/row/c22' passing a.XMLRECORD as "d") "TRSY_MED_SPREAD_22"
,XMLCAST(XMLQUERY('$d/row/c23[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000))
"CUST_MED_SPREAD"
,XMLQUERY('$d/row/c23' passing a.XMLRECORD as "d") "CUST_MED_SPREAD_23"
,XMLCAST(XMLQUERY('$d/row/c24[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000)) "REVAL_RATE"
,XMLQUERY('$d/row/c24' passing a.XMLRECORD as "d") "REVAL_RATE_24"
,XMLCAST(XMLQUERY('$d/row/c25[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000)) "TRSY_LIMIT_AMT"
,XMLQUERY('$d/row/c25' passing a.XMLRECORD as "d") "TRSY_LIMIT_AMT_25"
,XMLCAST(XMLQUERY('$d/row/c26[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000))
"MIN_ROUND_AMOUNT"
,XMLCAST(XMLQUERY('$d/row/c27[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000))
"CASH_ONLY_ROUNDING"
,XMLCAST(XMLQUERY('$d/row/c28[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000))
"MIN_ROUND_TYPE"
,XMLCAST(XMLQUERY('$d/row/c29[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000))
"CASH_ROUND_TYPE"
,XMLCAST(XMLQUERY('$d/row/c31[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000)) "PRECIOUS_METAL"
,XMLCAST(XMLQUERY('$d/row/c32[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000))
"EQUIVALENT_CCYS"
,XMLQUERY('$d/row/c32' passing a.XMLRECORD as "d") "EQUIVALENT_CCYS_32"
,XMLCAST(XMLQUERY('$d/row/c33[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000)) "COUNTRY_CODE"
,XMLCAST(XMLQUERY('$d/row/c34[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000)) "FIXED_RATE"
,XMLCAST(XMLQUERY('$d/row/c35[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000)) "FIXED_CCY"
,XMLCAST(XMLQUERY('$d/row/c36[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000))
"FIXED_START_DATE"
,XMLCAST(XMLQUERY('$d/row/c37[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000)) "BASE_CCY_RANK"
,XMLCAST(XMLQUERY('$d/row/c38[position()=1]' passing a.XMLRECORD as "d") as VARCHAR(4000)) "AVAILABLE_DATE"
Page 78
TAFJ-DBTool s
Page 79
TAFJ-DBTool s
USE CASE
Here is an advanced example with column SCRIPT.GROUP a multi-value column
Jql
SELECT F.SEAT.SCRIPTS WITH SCRIPT.STATUS EQ 'ACTIVE' AND WITH SCRIPT.GROUP EQ
'TB01- START'
Sql tr a n s l a t i o n
SELECT RECID FROM "TAFJV_F_SEAT_SCRIPTS" WHERE "SCRIPT_STATUS" = 'ACTIVE' and
( XMLEXISTS('$t/c 1 0[ t ex t() = " TB0 1- START"]' PASSING "SCRIPT_GROUP_10" as "t") )
The above cre a t e s a full table scan. Her e is one way to index it.
Page 80
TAFJ-DBTool s
Cha n g e qu ery
Page 81