J BASETo Oracle

Download as pdf or txt
Download as pdf or txt
You are on page 1of 91

jBASE To Oracle

• TEMENOS EDUCATION CENTRE

Warning: This document, is protected by copyright law and international treaties. No part of this
document may be reproduced or transmitted in any form or by any means, electronic or mechanical,
for any purpose, without the express written permission of TEMENOS Holdings NV Unauthorized
reproduction or distribution of this presentation or any portion of it, may result in severe civil and
criminal penalties, and will be prosecuted to the maximum extent possible under applicable law.”
Information in this document is subject to change without notice.

Copyright © 2004 TEMENOS HOLDINGS NV

Copyright © 2005 TEMENOS HOLDINGS NV


Agenda

• Day 1
– J4 data storage – An overview
– Oracle data storage – An overview
– XML – An overview
– Oracle architecture – An overview
• Methods of connecting to Oracle
• Oracle database
• Initialization parameter file
• Starting and shutting down Oracle
• Alert log and trace file
• Creating a database
• Physical storage structures in Oracle

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 2


Agenda (Cont.)

• Day 2
– jBASE to Oracle conversion
– Working of JQL commands in Oracle
– Backup and restore in Oracle

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 3


Introduction

• Oracle - RDBMS
• Currently using 9i
• Recent release 10g
• T24 - Use Oracle to store data
• The jEDI driver establishes communication between T24 and
Oracle.
• jEDI driver release – 2.0.5

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 4


Data Storage In J4

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 5


Data Storage In Oracle

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 6


Data Storage In Oracle – T24 Browser

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 7


Introduction To XML

• XML stands for EXtensible Markup Language


• XML is a markup language much like HTML
• XML was designed to describe data
• XML tags are not predefined. You must define your own tags
• XML uses a Document Type Definition (DTD) or an XML
Schema to describe the data
• XML with a DTD or XML Schema is designed to be self-
descriptive
• XML is a W3C Recommendation

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 8


XML And HTML

• XML was designed to carry data.


• XML is not a replacement for HTML.
XML and HTML were designed with different goals:
• XML was designed to describe data and to focus on what data
is.HTML was designed to display data and to focus on how data
looks.
• HTML is about displaying information, while XML is about
describing information.

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 9


Building Blocks Of XML Document

• Elements
• Tags
• Attributes
• Entities
• PCDATA <messages>
<note id="p501">
• CDATA <to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>

<note id="p502">
<to>Jani</to>
<from>Tove</from>
<heading>Re: Reminder</heading>
<body>I will not!</body>
</note>
</messages>

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 10


Oracle Architecture

Oracle Oracle
Database Instance

Oracle
Oracle Server
Server

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 11


Connecting To Oracle

User Server
Process Process Oracle Server

Client Server

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 12


Connecting To Oracle (Cont.)

• IPC method
– Logs on the server running Oracle

• Client server connection method (T24 Desktop)


– Start an application on a local computer
– Connect to a server running Oracle over the network

• Three tired connection method (T24 Browser)


– User computer
– Application server
– Database server

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 13


Dedicated Server Connection (Method used in T24)

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 14


Shared Server Connection

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 15


What we have learnt so far

• Oracle server consists of an Oracle Instance and an Oracle


Database
• Oracle Instance is a set of memory structures and background
processes
• Oracle database is a collection of database files
• T24 uses the dedicated server connection to connect to Oracle

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 16


Oracle Database

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 17


Data Files

• Oracle database has one or more data files


• Physical structures
• Contain logical storage elements known as segments
– Example : Table segment (Stores table data)

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 18


Control Files

• Binary file
• Read during database startup to determine if the database is in a
valid state
• Updated continuously by Oracle
• If corrupt – Oracle will stop functioning
• Default – 3 control files
• Can have a maximum of 8 copies of the control file
• Holds
– Database name
– Time stamp of database creation
– Name and location of data files
– Backup information

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 19


Log Files

• Contains redo information

• Similar to F.JOURNAL
• Compare it to jBASE Transaction Journaling

• Any DML is written to a log file and then to the data file
• Should have multiple log files – enable log switch

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 20


Parameter File

• Holds Oracle initialization parameters


• Parameters determine the size and the working of the various
components of Oracle
• Oracle parameters – jBASE variables
• Required for startup

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 21


Password File

• Holds the names and passwords of users who can start and
shutdown Oracle
• Referred only when started or shutdown

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 22


Archived Log Files

• Archived copies of filled up redo log files


• Log files are archived when log switches happen

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 23


What we have learnt so far

• Oracle database consists of physical database files that store


data
• Data files hold actual data
• Control file – binary file holds crucial information about the
database
• Log files – Hold redo information
• Parameter File – Holds the Oracle parameters
• Password File - Holds the user name and password of users who
can start and shutdown Oracle
• Archived log files – Archived copies of filled up log files

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 24


Initialization Parameter File

Initialization Parameter File

PFILE SPFILE

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 25


PFILE

• Static parameter file


• Text file
• Modifications take effect on subsequent startup
• Referred – Startup of Oracle
• Location
– $ORACLE_HOME/dbs (Unix)
– %ORACLE_HOME%\database (Windows)

ORACLE_HOME
ORACLE_SID

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 26


Creating A PFILE

• Default PFILE - $ORACLE_HOME/dbs/init.ora

cp $ORACLE_HOME/dbs/init.ora $ORACLE_HOME/dbs/initt24.ora

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 27


SPFILE

• New to Oracle 9i
• Binary file
• Dynamically change values
• If edited becomes useless
• Default location : $ORACLE_HOME/dbs

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 28


Creating A SPFILE

• Created from PFILE

CREATE SPFILE = ‘$ORACLE_HOME/dbs/spfilet24.ora’ from


PFILE = ’$ORACLE_HOME/dbs/pfilet24.ora’

CREATE SPFILE from PFILE

• Create PFILE from SPFILE

CREATE PFILE from SPFILE

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 29


Viewing The Contents Of The SPFILE

SELECT NAME,VALUE FROM V$PARAMETER

DESC V$PARAMETER

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 30


Mandatory Parameters For The Initialization Parameter File

• BACKGROUND_DUMP_DEST
• COMPATIBLE
• CONTROL_FILES
• DB_CACHE_SIZE
• DB_NAME
• SHARED_POOL_SIZE
• USER_DUMP_DEST

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 31


Altering Values In The SPFILE

• Set a value

ALTER SYSTEM SET <Parameter Name> = <value>


[SCOPE = MEMORY|SPFILE|BOTH]

• Reset a value

ALTER SYSTEM RESET <Parameter Name>


[SCOPE = MEMORY|SPFILE|BOTH]

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 32


Starting Oracle

• Command to be used – STARTUP


• Order of usage of initialization parameter files
– spfile<SID>.ora
– spfile.ora – Default spfile
– init<SID>.ora
– init.ora – Default pfile

• Force usage of PFILE

STARTUP PFILE = $ORACLE_HOME/dbs/initT24.ora

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 33


Stages Of Startup

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 34


Startup Commands

STARTUP NOMOUNT
STARTUP MOUNT
STARTUP OPEN
STARTUP PFILE = <PFILE location and file name>

ALTER DATABASE MOUNT

ALTER DATABASE OPEN

ALTER DATABASE OPEN READ ONLY

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 35


Shutting Down Oracle

SHUTDOWN ABORT
SHUTDOWN IMMEDIATE
SHUTDOWN TRANSACTIONAL
SHUTDOWN NORMAL

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 36


What we have learnt so far

• PFILE – Initialization parameter file - Text file


• SPFILE - Initialization parameter file - Binary file
• Create PFILE and SPFILE
• Start Oracle
– Startup nomount
– Startup mount
– Startup open
• Shutdown Oracle

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 37


Alert Log And Trace Files

BACKGROUND_DUMP_DEST
• Alert log file – alert<SID>.log
• Information
– When database was started/shutdown
– When background processes were started
– Current LSN number
– Log switch information
– Creation of objects
– Details of ALTER statements
– Error messages

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 38


Background Trace Files

BACKGROUND_DUMP_DEST
• For background processes
• <SID>_<Process Name>_<Process ID>.trc

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 39


User Trace Files

USER_DUMP_DEST
MAX_DUMP_FILE_SIZE

• Follow the naming convention <SID>_ora_<Process ID>.trc


• Information regarding SQL statements executed by a user
• Set SQL_TRACE to TRUE
• Holds error messages

ALTER SESSION SET SQL_TRACE TRUE


ALTER SESSION SET SQL_TRACE FALSE

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 40


Create A Database – Using DBCA

Demo

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 41


Data Storage Architecture In Oracle

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 42


Tablespaces

o Logical structures
o Can belong to only one database at a time
o Contains one or more operating system files which are known as
data files
o SYSTEM and the non SYSTEM tablespace
o Can be switched between read/write and read-only status

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 43


Data Files

• Physical structures
• Can belong to only one tablespace
• Size can adjusted manually or can be set automatically
• Have extension .dbf

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 44


Types Of Tablespaces

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 45


Create A Tablespace

CREATE TABLESPACE R5
DATAFILE ‘$ORACLE_HOME/ORADATA/T24/datafile01.dbf’ SIZE 10M;

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 46


Space Management In Tablespaces

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 47


Creating A Locally Managed Tablespace

CREATE TABLESPACE R5
DATAFILE ‘$ORACLE_HOME/ORADATA/T24/tablespace1.dbf’ SIZE 100M
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 48


Undo Tablespace

CREATE UNDO TABLESPACE UNDOTBS


DATAFILE ‘$ORACLE_HOME/ORADATA/T24/undo01.dbf’ SIZE 50M;

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 49


Temporary Tablespace

• Store temporary data


• Non standard block size cannot be specified

CREATE TEMPORARY TABLESPACE TEMPTBS


TEMPFILE ‘$ORACLE_HOME/ORADATA/T24/temp01.dbf’ SIZE 50M
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 4M;

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 50


Assigning A Default Temporary Tablespace

ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMPTBS;

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 51


Making Tablespaces Offline

• To perform backup
• Recover a tablespace or a data file when the database is online
• Move a data file when the database is online
• When a tablespace is made offline
– Control file is updated
– Users trying to access objects in the tablespace get an error
– Will remain in offline mode when database is restarted as well

ALTER TABLESPACE T24 OFFLINE;

ALTER TABLESPACE T24 ONLINE;

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 52


Data File Management

• Automatically extend

CREATE TABLESPACE R6
DATAFILE ‘$ORACLE_HOME/ORADATA/T24/DATAFILE1.DBF’ SIZE 5M
AUTOEXTEND ON NEXT 2M MAXSIZE 200M;

ALTER DATABASE
DATAFILE ‘$ORACLE_HOME/ORADATA/T24/DATAFILE1.DBF’ SIZE 5M
AUTOEXTEND ON NEXT 2M;

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 53


Obtain Autoextend information

SELECT TABLESPACE_NAME, FILE_NAME, AUTOEXTENSIBILE FROM


DBA_DATA_FILES;

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 54


Manually Resize A Data File

ALTER DATABASE
DATAFILE ‘$ORACLE_HOME/ORADATA/T24/DATAFILE1.DBF’ RESIZE 300M;

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 55


Data File Management (Cont.)

• Adding data files to a tablespace

ALTER TABLESPACE T24


ADD DATAFILE ‘$ORACLE_HOME/ORADATA/T24/DATAFILE3.DBF’ SIZE 100M;

• Moving data file to a another location

ALTER TABLESPACE T24 OFFLINE;


ALTER TABLESPACE ‘$ORACLE_HOME/ORADATA/T24/datafile1.dbf’ TO
‘$ORACLE_HOME/ORADATA/T24/datafile2.dbf’
ALTER TABLESPACE T24 ONLINE;

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 56


Data File Management (Cont.)

• Move a data file in the SYSTEM tablespace

SHUTDOWN
STARTUP MOUNT
ALTER DATABASE RENAME FILE
‘$ORACLE_HOME/ORADATA/T24/system1.dbf’
TO ‘$ORACLE_HOME/ORADATA/T24/systemnew.dbf’

• Dropping a tablespace

DROP TABLESPACE T24


INCLUDING CONTENTS AND DATAFILES
CASCADE CONSTRAINTS;

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 57


Views

• Tablespace information
– DBA_TABLESPACES
– V$TABLESPACE
• Data file information
– DBA_DATA_FILES
– V$DATAFILE
• Temp file information
– DBA_TEMP_FILES
– V$TEMPFILE

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 58


What We Have Learnt So Far

• Tablespace
• Data file
• SYSTEM and NON SYSTEM tablespace
• Create a locally managed tablespace
• Temporary tablespace
• Undo tablespace
• Readonly tablespace
• Offline tablespace
• Space management in data files

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 59


Creating Users In Oracle

• When a user is created a schema is created for the user


• Schema has the same name of that of the user
• Schema contains
• Tables
• Triggers
• Constraints
• Indexes
• Views
• Sequences
• Stored procedures etc.

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 60


Creating A User

CREATE USER TRGUSER


IDENTIFIED BY TRAINING
DEFAULT TABLESPACE T24
TEMPORARY TABLESPACE TEMP
QUOTA 50M ON DATATBS
QUOTA 50M ON USERS

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 61


Altering Quota Definition For Users

ALTER USER TRGUSER


QUOTA 100M ON USERS;

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 62


Dropping A User

DROP USER TRGUSER;


DROP USER TRGUSER CASCADE;

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 63


Views

• DBA_USERS
• DBA_TS_QUOTAS

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 64


Role Management

• Group of related privileges


• Can be granted to users
• Can be granted to roles

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 65


Role Management Commands

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 66


jBASE To Oracle Conversion

• Oracle setup
– Create database
– Check pfile setting
– Create user

CREATE USER ORAUSER IDENTIFIED BY orauser;


ALTER USER ORAUSER DEFAULT TABLESPACE GLOBUSDATAXML;
ALTER USER ORAUSER TEMPORARY TABLESPACE TEMP;

CREATE ROLE globus IDENTIFIED BY globus;


GRANT CONNECT, RESOURCE, QUERY REWRITE TO globus;
GRANT globus TO orauser;

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 67


jBASE To Oracle Conversion

• Oracle Setup (Cont.)


– Create the tablespaces

CREATE TABLESPACE GLOBUSDATAXML


DATAFILE ‘C:\Oracle\Ora92\TRGT24\DATAFILE1.DBF’ SIZE 500M
AUTOEXTEND ON NEXT 2M,
DATAFILE ‘C:\Oracle\Ora92\TRGT24\DATAFILE2.DBF’ SIZE 500M
AUTOEXTEND ON NEXT 2M
EXTENT MANAGEMENT LOCAL AUTOALLOCATE;

CREATE TABLESPACE GLOBUSINDEXXML


DATAFILE ‘C:\Oracle\Ora92\TRGT24\DATAFILE3.DBF’ SIZE 500M
AUTOEXTEND ON NEXT 2M,
DATAFILE ‘C:\Oracle\Ora92\TRGT24\DATAFILE4.DBF’ SIZE 500M
AUTOEXTEND ON NEXT 2M
EXTENT MANAGEMENT LOCAL AUTOALLOCATE;

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 68


jBASE To Oracle Conversion

• Oracle Setup (Cont.)


– Alter user definition

ALTER USER orauser QUOTA UNLIMITED ON GLOBUSDATAXML;


ALTER USER orauser QUOTA UNLIMITED ON GLOBUSINDEXXML;

• Execute package.sql

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 69


jBASE To Oracle Conversion

• Installing the XMLOracle driver


– bin
– lib
– sql

libXMLORACLE.so and libXMLORACLE.so.el

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 70


jBASE To Oracle Conversion

• Installing the XMLOracle Driver

REM A separate variable named ORADRIVERPATH has been


defined to ease
REM driver setup. The name can be any user define name.

set ORADRIVERPATH=C:\alm\LocalHosts\Oradriver
set ORA_HOME=c:\oracle\ora92
set ORACLE_SID=TRGT24
set JEDI_SOB_NOCLOSE=1
set ORACLE_SHLIB=%ORA_HOME%\lib
set ORACLE_SHLIB_PATH=%ORA_HOME%\lib
set ORACLELD_LIBRARY_PATH=%ORA_HOME%\lib
set NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
set PATH=%PATH%:%ORADRIVERPATH%\bin
set JBCOBJECTLIST=%JBCOBJECTLIST%:%ORADRIVERPATH%\bin

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 71


jBASE To Oracle Conversion

• XMLOracle driver configuration


– Create the jedi_config file

jsh..>cd %JBCRELEASEDIR%\config
jsh..>CREATE.FILE jedi_config 1 1

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 72


jBASE To Oracle Conversion

• XMLOracle driver configuration

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 73


jBASE To Oracle Conversion

• Test XMLOracle driver configuration

SELECT * FROM STUBFILES WHERE ID LIKE ‘%TRG_EXAMPLE%’;

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 74


jBASE To Oracle Conversion

• Test the XMLOracle driver

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 75


jBASE To Oracle Conversion

• Pre Conversion

EB.COMPILE BP SESSION.TO.CONVERT.TO.JBASE
EB.COMPILE BP DBCOPY.JBASE
EB.COMPILE BP SELECT.FILES.TO.CONVERT.JBASE
EB.COMPILE BP BUILD.EDICT.JBASE
EB.COMPILE BP EB.CREATE.VIEW

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 76


jBASE To Oracle Conversion

• Running Conversion
– SELECT.FILES.TO.CONVERT.JBASE
• Create the F.SELECTED.FILES under bnk.run
– SESSION.CONVERT.TO.JBASE
• Take input from F.SELECTED.FILES
• Call DBCOPY.JBASE
• Create files of type XMLORACLE
• Create an entry in the STUBFILES table
• Create a primary key constraint and an index
• Store tables in GLOBUSDATAXML
• Store indexes in GLOBUSINDEXXML
• Update jBASE stub files

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 77


jBASE To Oracle Conversion

• Post Conversion

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 78


JQL Commands In Oracle

• Setting TRACE on

export JEDI_XMLORACLE_TRACE=1:Unix

set JEDI_XMLORACLE_TRACE=1:Windows

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 79


JQL Commands In Oracle

• Scenario 1

SELECT FBNK.ACCOUNT

• Scenario 2

Secondary Prompt

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 80


JQL Commands In Oracle

• Scenario 3
SELECT FBNK.ACCOUNT WITH @ID = 25143

• Scenario 4

SELECT FBNK.ACCOUNT WITH CATEGORY = 1001

– Rebuild SS

SELECT VIEW_NAME FROM USER_VIEWS;

DESC <View Name>

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 81


JQL Commands In Oracle

• Scenario 4 (Cont.)

SELECT FBNK.ACCOUNT WITH CATEGORY = 1001

CREATE-EXTINDEX FBNK.ACCOUNT CATEGORY

DROP INDEX ix_ACFBNK_ACCOUNT_c2


/
CREATE INDEX ix_ACFBNK_ACCOUNT_c2 ON ACFBNK_ACCOUNT x
(substr(extractValue(x.xmlrecord,'/row/c2'),1,6))
/
analyze table ACFBNK_ACCOUNT compute statistics
/

SELECT INDEX_NAME FROM USER_INDEXES WHERE INDEX_NAME LIKE


‘ix%’

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 82


JQL Commands In Oracle

• Scenario 4 (Cont.)
– Check if index has been used

ALTER SESSION SET SQL_TRACE TRUE


SELECT RECID FROM V_ACFBNK_ACCOUNT WHERE (CATEGORY = ‘1001’)

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 83


JQL Commands In Oracle
• Scenario 5
JQL Oracle SQL View Index
Used Used

SELECT FBNK.ACCOUNT SELECT RECID FROM V_ACFBNK_ACCOUNT WHERE ( Y Y


WITH CATEGORY > 1001 CATEGORY > '1001' )

SELECT FBNK.ACCOUNT SELECT RECID FROM V_ACFBNK_ACCOUNT WHERE ( CATEGORY Y Y


WITH CATEGORY >= 1001 >= '1001' )

SELECT FBNK.ACCOUNT SELECT RECID FROM V_ACFBNK_ACCOUNT WHERE ( Y Y


WITH CATEGORY < 1001 CATEGORY < '1001' )

SELECT FBNK.ACCOUNT SELECT RECID FROM V_ACFBNK_ACCOUNT WHERE ( CATEGORY Y Y


WITH CATEGORY <= 1001 <= '1001' )

SELECT FBNK.ACCOUNT SELECT RECID FROM AC_FBNK_ACCOUNT WHERE ( ( CATEGORY N N


WITH CATEGORY NE 1001 != '1001' OR CATEGORY IS NULL ) )
This above query will result in a full table scan

SELECT FBNK.ACCOUNT SELECT RECID FROM FBNK_ACCOUNT WHERE ( ( CATEGORY = '' N N


WITH CATEGORY = ‘’ OR CATEGORY IS NULL ) )
This above query will result in a full table scan

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 84


JQL Commands In Oracle
JQL Oracle SQL View Index
Used Used

SELECT FBNK.ACCOUNT SELECT t.RECID FROM ACFBNK_ACCOUNT t N N


WITH CATEGORY LIKE
…10…

SELECT FBNK.ACCOUNT SELECT RECID FROM V_ACFBNK_ACCOUNT WHERE ( CATEGORY Y N


WITH CATEGORY LIKE LIKE '%10%' ESCAPE '\' )
…’10’…

SELECT FBNK.ACCOUNT SELECT RECID FROM V_ACFBNK_ACCOUNT WHERE ( CATEGORY Y N


WITH CATEGORY LIKE LIKE '%10%' ESCAPE '\' )
“…’10’…”

SELECT FBNK.ACCOUNT SELECT t.RECID FROM ACFBNK_ACCOUNT t N N


WITH CATEGORY LIKE Will report a message ‘Mismatched Token’ in the
ORAdriver.log file
‘10’…

SELECT FBNK.ACCOUNT SELECT RECID FROM V_ACFBNK_ACCOUNT WHERE ( CATEGORY Y Y


WITH CATEGORY LIKE LIKE '10%' ESCAPE '\' )
“‘10’…”

SSELECT FBNK.ACCOUNT SELECT RECID FROM ACFBNK_ACCOUNT N N


Will perform a full table scan. That is, perform a
READNEXT for each ID in the ACFBNK_ACCOUNT table

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 85


JQL Commands In Oracle

JQL Oracle SQL View Index


Used Used

SSELECT FBNK.ACCOUNT SELECT RECID FROM V_ACFBNK_ACCOUNT WHERE ( CATEGORY = Y Y


WITH CATEGORY = 1001 '1001' ) ORDER BY RECID

SELECT FBNK.ACCOUNT SELECT t.RECID FROM ACFBNK_ACCOUNT t N N


BY @ID Will perform a full table scan – perform a READNEXT for
each ID in the ACFBNK_ACCOUNT table

SELECT FBNK.ACCOUNT SELECT t.RECID FROM ACFBNK_ACCOUNT t N N


BY CATEGORY Will perform a full table scan – perform a READNEXT for
each ID in the ACFBNK_ACCOUNT table

SELECT FBNK.ACCOUNT SELECT t.RECID FROM ACFBNK_ACCOUNT t N N


BY.DSND @ID Will perform a full table scan – perform a READNEXT for
each ID in the ACFBNK_ACCOUNT table

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 86


JQL Commands In Oracle

• Scenario 6
– Select on multi value fields
• Scenario 7
– Select on local reference fields

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 87


JQL Commands In Oracle

• Scenario 8
– CREATE.FILE
CREATE.FILE TRG.FILE1 TYPE=XMLORACLE

• Scenario 9
– CLEAR.FILE

• Scenario 10
– DELETE.FILE

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 88


JQL Commands In Oracle

• Scenario 11
– Working of OPF/F.READ/F.WRITE
– F.READU
*Routine to update a value TRG in the field TEXT
*for customer 100069
SUBROUTINE TEST1
$INSERT I_COMMON
$INSERT I_EQUATE
$INSERT I_F.CUSTOMER
FN.CUS = 'F.CUSTOMER'
F.CUS = ''
Y.CUS.ID = 100069
R.CUS = ''
Y.CUS.ERR = ''
CALL OPF(FN.CUS,F.CUS)
CALL F.READ(FN.CUS,Y.CUS.ID,R.CUS,F.CUS,Y.CUS.ERR)
R.CUS<EB.CUS.TEXT,-1> = "TRG" ;* TEXT is a multivalue field
CALL F.WRITE(FN.CUS,Y.CUS.ID,R.CUS)
CALL JOURNAL.UPDATE(Y.CUS.ID)
RETURN
END

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 89


JQL Commands In Oracle

• Scenario 12
– Working of TRANSSTART and TRANSEND

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 90


An Insight Into Querying XML Records

SELECT x.XMLRECORD.getClobVal() FROM STFBNK_CUST000 x WHERE


RECID = ‘100069’

INSERT INTO TRG_FILE1 (RECID,XMLRECORD) VALUES


(‘1’,XMLTYPE.createXML
(‘<row id=”1”><c1>alm</c1><c2>Alagammai</c2></row>’))

SELECT RECID,
substr(extractValue(x.xmlrecord,'/row/c17'),1,2) "RESIDENCE",
substr(extractValue(x.xmlrecord,'/row/c15'),1,2) "NATIONALITY"
FROM
STFBNK_CUST000 x;

SELECT RECID,
substr(extractValue(x.xmlrecord,'/row/c12[@m=2]'),1,2)
"OTHER.OFFICER"
FROM STFBNK_CUST000 x;

SELECT RECID,
substr(extractValue(x.xmlrecord,'/row/c17[@m=2][@s=2]'),1,2)
"TEXT"
FROM EBF_VERSION x;

T3JTO – R05 – 1.0 Copyright © 2005 TEMENOS HOLDINGS NV 91

You might also like