TAFJ DBtools
TAFJ DBtools
Learning Objectives
Slide 2
What is TAFJ
Slide 3
What is TAFJ
Slide 4
Introduction
Slide 5
Introduction
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 tAddUser.bat/tAddUser.sh
t/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.
Slide 6
DBTools console
Slide 7
DBTools console
Slide 8
DBTools console
Slide 9
DBTools console
Slide 10
DBTools console
Slide 11
User creation to access DBtools:
Slide 12
User creation to access DBtools
Slide 13
User Management for DBTools
Slide 14
User Management for DBTools
Syntax
The application could be launched from
TAFJ_HOME/bin.
tUserMgnt << MODE >> << -u username>> << -p
password>>
where MODE can be :
--Add << -u username>> << -p password>> ; Add a
new User.
--Reset << -u username>> << -p password>> ; Reset
an existing User.
--Del << -u username>> ; Delete an existing User.
Slide 15
User Management for DBTools
Slide 16
Creating a new User:
User Management for DBTools
Slide 17
User Management for DBTools
Slide 18
User Management for DBTools
Slide 19
DBTools console
Slide 20
DBTools console
Slide 21
DBTools console
Slide 22
DBTools console - Header
Slide 23
DBTools console - Header
Slide 24
DBTools console - Main panel
Slide 25
DBTools console - Main panel
Slide 26
DBTools console - Main panel
Slide 27
DBTools console - Main panel
Slide 28
DBTools console - Main panel
Slide 29
DBTools console - Main panel
Slide 30
DBTools console - Main panel
Slide 31
DBTools console - Main panel
Slide 32
DBTools console - Main panel
Slide 33
DBTools console - Main panel
Slide 34
DBTools console - Footer
Slide 35
DBTools -Database Functionalities
Slide 36
DBTools -Database Functionalities
Slide 37
DBTools -Database Functionalities
Slide 39
Database Functionalities – SQL MOD
SELECT
INSERT
UPDATE
DELETE
CREATE
ALTER
DROP
COMMIT
ROLLBACK
DESCRIBE
For e.g. SELECT * from FBNK_CURRENCY.
In TAFJ by default the dot is converted to underscore.
Slide 40
Database Functionalities – SQL MOD
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.
If a DML statement returns a result set, then the
result set is displayed. Else the number of rows
affected by the statement is displayed.
SQL Exceptions are displayed on the console. To
avoid excessive memory usage when retrieving
important set of data, by default only the first 200
rows are displayed.
Use setup to modify the defaults.
Slide 41
Database Functionalities – JQL MOD
Slide 42
Database Functionalities – JQL MOD
To be recognized the statement must start with one of
the following keywords in uppercase:
COPY <<Source Table Name>> <<Destination Table
Name>> <<RecId optional>>
COUNT <<VOC File name>>
GETDBNAME <<VOC File name>>
LIST-ITEM <<VOC File name>> <<WITH clause>>
DESCRIBE <<View or Table Name Pattern>>
<<Column Name Pattern
(optional)>>...ie. TAFJV_FBNK_CURR% %CURR%
LOCATE-TABLE <<Table Name>> (z/OS only)
CLEAR-FILE <<VOC File name>>
Slide 43
Database Functionalities – JQL MOD
CREATE-FILE <<VOC File name>>
o Several different syntaxes can be used.
o To create a table with a particular table type
(XML,CLOB,BLOB,MULTICOLUMN,
o VARCHAR), use the syntax:
CREATE-FILE F.TESTROFILE TYPE=<<TYPE>>
o For read-only and $DIM files:
Two commands are needed to create new T24 archive
tables.
CREATE-FILE F.TESTROFILE TYPE=XML
ASSOCIATE="YES“
The command above creates the table in the transactional
database and sets it up for a “read-only” pair.
CREATE-FILE F.TESTROFILE$RO TYPE=XML
DATABASE="TESTRODB" SCHEMA="TAFJRO"
READONLY="YES"
Slide 44
Database Functionalities – JQL MOD
Slide 45
Database Functionalities – JQL MOD
Slide 46
Database Functionalities – JQL MOD
The output file $TAFJ_HOME/log/enqtrans.txt would
look like:
FMF1.MD.DEAL FMF1_MD_DEAL D_F_MD_DEAL
CUST.SECTOR I?CUSTOMER;
SUBR("ENQ.TRANS","CUSTOMER", @1, "SECTOR")??
CUST.SECTOR?4R?S????????CUSTOMER;
SUBR("ENQ.TRANS","CUSTOMER", @1, "SECTOR")
FMF1.MD.DEAL FMF1_MD_DEAL D_F_MD_DEAL
INDUSTRY I?CUSTOMER;
SUBR("ENQ.TRANS","CUSTOMER", @1, "INDUSTRY")??
INDUSTRY?4R?S????????CUSTOMER;
SUBR("ENQ.TRANS","CUSTOMER", @1, "INDUSTRY")
Slide 47
Database Functionalities – OFS MOD
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.
Slide 48
Database Functionalities – OFS MOD
Slide 49
Database Functionalities – DBCHECK MOD
Slide 50
Database Functionalities – DBCHECK MOD
Slide 51
Database Functionalities – CHANGE-TABLETYPE MOD
Slide 52
Database Functionalities – CHANGE-TABLETYPE MOD
Slide 53
Database Functionalities – CHANGE-TABLETYPE MOD
Slide 54
JED console to display and edit database
Slide 55
JED console to display and edit database
Slide 56
JED console to display and edit database
Slide 57
JED console to display and edit database
To directly update a record without opening JED
Console command is:
JED -s <<FILE NAME>> <<RECORD KEY>>
<<FIELD NUMBER>>=<<VALUE>>;
Slide 58
Extract data from the database EXTRACT-TABLE
Slide 59
Extract data from the database EXTRACT-TABLE
Slide 60
Load data into the database- LOAD-DATA
Slide 61
Load data into the database- LOAD-DATA
Slide 62
Load data into the database- LOAD-DATA
To load a single record from a file on your file system
Slide 63
Lock Management - LOCKS
LOCKS command displays record locks managed by
tLockManager or by TAFJ LOCK_RECORDS table
on the database. The different lock modes are
discussed in the session on TAFJ lock manager.
Slide 64
Lock Management - RELEASE
Slide 65
Lock Management - RELEASE
Slide 66
Database/Tables 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>>
Slide 67
Console Functionalities
Slide 68
Console Functionalities
Slide 69
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.
Slide 70
Console Functionalities - history
Slide 71
Console Functionalities - history
A history of last commands launched (10 last
commands by default) is maintained to give the ability
to reuse quickly last used command.
Simply enter “history” on the command line. You will
get the resulting output that shows the list of last
used commands.
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.
You can clear history by typing the command clear-
history.
Slide 72
Console Functionalities - Aliases
Create an alias
Display an alias
Execute an alias
Remove an alias
Slide 73
Console Functionalities – Create an alias
Slide 74
Console Functionalities – Display an alias
Slide 75
Console Functionalities – Execute an alias
To execute this command just type the alias name on
the command line.
Slide 76
Console Functionalities – Execute an alias
Slide 77
Console Functionalities – Remove an alias
Slide 78
SETUP
Slide 79
SETUP
Slide 80
setup
Slide 81
SETUP
Slide 82
SETUP
Slide 83
SETUP
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 an explicit COMMIT statement
before exiting. Value should be a Boolean, default
value is false.
Log file - This property allows logging command
result to the related log file by providing a log file
name. Default value is null, indicating command
result won’t be logged.
OFS source and OFS separator – this property
allows you to configure the OFS source record and
the separator for working in the OFS mode
Slide 84
Navigation and display
Slide 85
DBTools Console
Slide 86
Execution – interactive mode
Slide 87
Execution – script mode
Slide 89
Log mode: execution report is append in a log file .
Slide 90
Log mode: execution report is append in a log file .
Slide 91
Silent mode: no execution report
Slide 92
Change console display
When displaying a result you have the ability to fix
the first line and / or the first column of the data being
displayed for all the pages and columns.
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.
Slide 93
Change console display
Type the following commands:
hc to enable / disable first fixed column
hl to enable / disable first fixed line
cm to enable / disable column mode
Slide 94
JED Console application
Slide 95
Execution – Interactive mode
Syntax
tJed [-u <username> –p <password> -cf
<configuration>[.properties]] <file name> <record
key>
tJed -u <username> –p <password> F.SPF SYSTEM
Slide 96
Execution – Interactive mode
Optional parameters
Fields per page number
By default JED console is configured to display 20
fields per page.
tJed –u <username. –p <password> -l 50 F.SPF
SYSTEM
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.
Slide 97
Execution – Interactive mode
Column names
By default JED console is configured to display a
record with no field name.
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.
tJed -u <username> –p <password> -cn F.SPF
SYSTEM
Slide 98
Execution – Interactive mode
Help
Use the help option to display the available
functionalities on the JED console -help
tJed -u <username> –p <password> -help F.SPF
SYSTEM
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.
tJed -u <username> –p <password> F.SPF
SYSTEM LOCK=Y
Slide 99
Execution – Interactive mode
JED Graphical mode
By providing option graphical user interface: -gui
you will be able to launch JED in graphical mode.
Useful when your T24 area does not have a
VT100 console. However on Unix systems X
Windows must be installed for launching the gui.
tJed -u <username> –p <password> -gui F.SPF
SYSTEM
Slide 100
Execution – Interactive mode
Slide 101
Execution - script mode
It is also possible to modify a record without opening
it in JED console from command line. This is referred
to as the “script mode”.
To update the record add ‘-s’ to the command along
with 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:
On Windows - tJed -s F.TSA.SERVICE COB
3=TWO;6=START;
On UNIX (use quotes)- tJed -s ‘F.TSA.SERVICE COB
3=TWO;6=START;’
Slide 102
Execution - script mode
Slide 103
Understanding the UI (Presentation)
Slide 104
Understanding the UI (Presentation)
Header
The header presents information related to the edited
record:
File name
Record key
Record lock status : the value could be
UNLOCKED (default) / LOCKED depending on
LOCK parameter provided
Slide 105
Understanding the UI (Presentation)
A record being viewed on the JED console can be in
one of the following four ‘states’
empty - default, no change made to the currently
displayed record
WAITING – displayed when a field is getting edited …
waiting for user entry
PENDING – record displayed on console has been
modified, but the changes not committed into
database.
SAVED – record modification stored in database.
(type ‘s’ at the command line to save the record)
Slide 106
Understanding the UI (Presentation)
Slide 107
Understanding the UI (Presentation)
Main panel
The main panel contains the record to be
displayed. The record is displayed vertically. Each
field is displayed in a row. Each row displays a
number that correspond to a single value field no
(i.e., 11 is FREQUENCY field), a multi-value field
with its MV position (i.e. 15.5 is the fifth
multivalued Date field) or a sub-value field no with
the SV position (i.e.1.1.1).
The field number is displayed on a margin on the
panel left; the field data is displayed adjacent to
the margin
JED console can display 80 characters per row,
by default the margin is 5 characters long and so
the data part 75 characters long.
Slide 108
Understanding the UI (Presentation)
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.
Classic mode, waiting for user command
Slide 109
tJed Functionalities - Change a record
Slide 110
tJed Functionalities - Change a record
Slide 111
tJed Functionalities - Change a record
Slide 112
tJed Functionalities - Change a record
Slide 113
tJed Functionalities - Change a record
Delete a field / Multi-value / Sub-value
To delete a field, multi-value or sub-value just type the
command d followed by the field, VM, SM number on the
command line.
The fields, multi-values, sub-values that follow the deleted
field will be renumbered.
Slide 114
tJed Functionalities - Change a record
Delete a record
You can delete a record by typing command d.
You will be asked for confirmation.
Slide 115
tJed Functionalities - 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.
Slide 116
tJed Functionalities - Validation
Save pending changes
To update your pending modifications into database, you
can use command s.
You will see the record status changing from PENDING to
SAVED.
You will see the record status changing from PENDING to
SAVED
Slide 117
tJed Functionalities - Validation
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.
The record status will be set to its default empty value.
Slide 118
TAFJ –DBTools DBCheck
DBCheck
Slide 119
TAFJ –DBTools DBCheck
Introduction
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:
Open the table and check its type
Write a test record on it
Read that test record
Read that test record and lock it
Delete the test record
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
Slide 120
TAFJ –DBTools DBCheck
Syntax
The DBCheck syntax is the following:
DBCheck [-cf <configuration>[.properties]]
The targeted database will be the one defined in your default
configuration file or in the configuration specified by the -cf
option.
Slide 121
TAFJ –DBTools DBCheck
Command: DBCheck
output looks like this:
Slide 122
Summary
Slide 123
Workshop
Slide 124
Thank You!
Questions / Discussion
Slide 125