230 likes | 424 Views
Nomad Object Model: Implementation in Oracle 9i. David Rodríguez IFCA (Santander) CERN IT-DB. Agenda. Introduction Mapping Model Schema summary Data loading Conclusions. Introduction. Task done with Dirk Düllmann and Dirk Geppert. NOMAD (WA96) experiment: Completed 1998.
E N D
Nomad Object Model: Implementation in Oracle 9i David Rodríguez IFCA (Santander) CERN IT-DB HEP Database Project Workshop
Agenda • Introduction • Mapping • Model • Schema summary • Data loading • Conclusions HEP Database Project Workshop
Introduction • Task done with Dirk Düllmann and Dirk Geppert. • NOMAD (WA96) experiment: • Completed 1998. • Search for neutrino oscillations. • Data in ZEBRA banks is read by an OO application. • Oracle 9i database: • OTT. • OCCI. HEP Database Project Workshop
Goal • To elaborate an Object Model in Oracle 9i for testing: • This model had to be a bigger, more complicated one than the ones used for specifical tests. • Maps the objects of the application that reads the data from the ZEBRA files. • Use of development environment (Peter Kunszt). • Use of object extensions of the database drove the model design. • Other testing fields like partitioning also influenced it. HEP Database Project Workshop
Data • Source: ZEBRA banks with DST and Raw data. • Object oriented (C++) interface to access the data with some FORTRAN functions. • Target: Oracle 9i DataBase. • Stored in object tables. • Navigation through references in the Database. HEP Database Project Workshop
OO in Oracle 9i • In the database (object extensions): • Object types. • Object tables. • Collections: • VARRAYS. • Nested tables. • Inheritance. • Client side: • OTT: generates C++ classes. • OCCI: C++ binding. Two interfaces: associative and navigational. HEP Database Project Workshop
Agenda • Introduction • Mapping • Model • Schema summary • Data loading • Conclusions HEP Database Project Workshop
Mapping • Create an object relational model in the database. • With OTT C++ classes are generated for each object type in the DB schema. • OCCI & generated classes to access the database: • Data loading/manipulation. • Querying/Reading. HEP Database Project Workshop
Object Relational Features • Use of object tables make mapping easier than when you use a pure relational schema. • Used the following: • User defined types (objects) <> Scalar types. • Object tables <> pure relational tables. • Inheritance (only single is possible) <> relations (f.k.). • Embedded objects (not referenceable) <> scalar types. • Collections (VARRAYS) <> multiple tables + relations. • Object references <> relations. HEP Database Project Workshop
Drawbacks • Only row-objects (the ones in an object table) have an object ID, and thus could be referenced by other. • Embedded objects can’t. • Nor objects in a collection. • Objects extensions show problems to being used from some Oracle tools. For example multilevel collections with direct path load (SQL*Loader). • Object References make complicated mapping the object relational model to a relational one. For example to use external tables (that don’t admit objects). HEP Database Project Workshop
Agenda • Introduction • Mapping • Model • Schema summary • Data loading • Conclusions HEP Database Project Workshop
Model design • Navigational access to objects in the database. • An entry point to all the data (Raw and DST). • Testing of several features: • Multilevel collections (VARRAYS). • Object REFs in the database. • Different ways of storing Raw (big chunks of read-only numerical) data. • Embedded objects. • Partitioning (other task). HEP Database Project Workshop
Agenda • Introduction • Mapping • Model • Schema summary • Data loading • Conclusions HEP Database Project Workshop
Schema summary I • Five object tables. • 16 object types. • 5 VARRAY types (no nested tables): • Two of Numbers. • Two of REFs. • One of Objects. • Navigational access to data through references in pEvent objects (entry point), and then in the DST/AOD. HEP Database Project Workshop
Schema summary II • Two raw implementations: • VARRAY, table pRawd_T. • BLOB, table pRawLob_T. • DST (AOD): We have two object tables: • Auxiliary table for DST object grouping (pAOD_T). • Table with actual DST Objects (pDstObj_T). It is actually filled with subtypes of pDstObj. HEP Database Project Workshop
More on AOD/DST • One pAOD object per event. This object has an array of references to the pDstObj objects of the event you can navigate to. • pDstObject subtypes: Dst, Evs, Rvxs and VArrayMas. • Heavy use of references in this part of the model. • Quite a lot of embedded objects too. HEP Database Project Workshop
Agenda • Introduction • Mapping • Model • Schema summary • Data loading • Conclusions HEP Database Project Workshop
Data Loading • hepLoader program. Loads data from ZEBRA banks into the database. • Data source: several ZEBRA files. • Funcionality: • Event filtering based on online_event_type. • Selection of type of Raw to fill (BLOB/VARRAY). • Change of run number [–R] (Stefano). • Setting the number of events to load [–n] (Stefano). HEP Database Project Workshop
Data Loading Problems • Memory leak. • Bigger if trying to load data that is already in the database. • Some problems loading a lot of raw data in BLOB format (workaround). • Some reading problems also with BLOB. HEP Database Project Workshop
Agenda • Introduction • Mapping • Model • Schema summary • Data loading • Conclusions HEP Database Project Workshop
Conclusions • We elaborated an object model in Oracle 9i and C++. • Implementation of part of the Nomad experiment data model. • Used real data from experiment. • Some problems still in data loading. • Also objects in the DB are not accepted by some Oracle tools. • Only row-objects can be referenced by others. HEP Database Project Workshop