J BASETo Oracle
J BASETo Oracle
J BASETo Oracle
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.
• 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
• Day 2
– jBASE to Oracle conversion
– Working of JQL commands in Oracle
– Backup and restore in Oracle
• 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
• 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>
Oracle Oracle
Database Instance
Oracle
Oracle Server
Server
User Server
Process Process Oracle Server
Client Server
• IPC method
– Logs on the server running Oracle
• 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
• 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
• Holds the names and passwords of users who can start and
shutdown Oracle
• Referred only when started or shutdown
PFILE SPFILE
ORACLE_HOME
ORACLE_SID
cp $ORACLE_HOME/dbs/init.ora $ORACLE_HOME/dbs/initt24.ora
• New to Oracle 9i
• Binary file
• Dynamically change values
• If edited becomes useless
• Default location : $ORACLE_HOME/dbs
DESC V$PARAMETER
• BACKGROUND_DUMP_DEST
• COMPATIBLE
• CONTROL_FILES
• DB_CACHE_SIZE
• DB_NAME
• SHARED_POOL_SIZE
• USER_DUMP_DEST
• Set a value
• Reset a value
STARTUP NOMOUNT
STARTUP MOUNT
STARTUP OPEN
STARTUP PFILE = <PFILE location and file name>
SHUTDOWN ABORT
SHUTDOWN IMMEDIATE
SHUTDOWN TRANSACTIONAL
SHUTDOWN NORMAL
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
BACKGROUND_DUMP_DEST
• For background processes
• <SID>_<Process Name>_<Process ID>.trc
USER_DUMP_DEST
MAX_DUMP_FILE_SIZE
Demo
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
• Physical structures
• Can belong to only one tablespace
• Size can adjusted manually or can be set automatically
• Have extension .dbf
CREATE TABLESPACE R5
DATAFILE ‘$ORACLE_HOME/ORADATA/T24/datafile01.dbf’ SIZE 10M;
CREATE TABLESPACE R5
DATAFILE ‘$ORACLE_HOME/ORADATA/T24/tablespace1.dbf’ SIZE 100M
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K
• 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
• 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;
ALTER DATABASE
DATAFILE ‘$ORACLE_HOME/ORADATA/T24/DATAFILE1.DBF’ RESIZE 300M;
SHUTDOWN
STARTUP MOUNT
ALTER DATABASE RENAME FILE
‘$ORACLE_HOME/ORADATA/T24/system1.dbf’
TO ‘$ORACLE_HOME/ORADATA/T24/systemnew.dbf’
• Dropping a tablespace
• Tablespace information
– DBA_TABLESPACES
– V$TABLESPACE
• Data file information
– DBA_DATA_FILES
– V$DATAFILE
• Temp file information
– DBA_TEMP_FILES
– V$TEMPFILE
• 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
• DBA_USERS
• DBA_TS_QUOTAS
• Oracle setup
– Create database
– Check pfile setting
– Create user
• Execute package.sql
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
jsh..>cd %JBCRELEASEDIR%\config
jsh..>CREATE.FILE jedi_config 1 1
• 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
• 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
• Post Conversion
• Setting TRACE on
export JEDI_XMLORACLE_TRACE=1:Unix
set JEDI_XMLORACLE_TRACE=1:Windows
• Scenario 1
SELECT FBNK.ACCOUNT
• Scenario 2
Secondary Prompt
• Scenario 3
SELECT FBNK.ACCOUNT WITH @ID = 25143
• Scenario 4
– Rebuild SS
• Scenario 4 (Cont.)
• Scenario 4 (Cont.)
– Check if index has been used
• Scenario 6
– Select on multi value fields
• Scenario 7
– Select on local reference fields
• Scenario 8
– CREATE.FILE
CREATE.FILE TRG.FILE1 TYPE=XMLORACLE
• Scenario 9
– CLEAR.FILE
• Scenario 10
– DELETE.FILE
• 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
• Scenario 12
– Working of TRANSSTART and TRANSEND
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;