CORAL Database Copy Tools By Gitika Khare RRCAT, Indore, India.

Slides:



Advertisements
Similar presentations
Oracle to MySQL Database Migration SQLWays - Migration Software Presentation Copyright (c) Ispirer Systems Ltd. All Rights Reserved.
Advertisements

The Architecture of Oracle
WaveMaker Visual AJAX Studio 4.0 Training
Module 8 Importing and Exporting Data. Module Overview Transferring Data To/From SQL Server Importing & Exporting Table Data Inserting Data in Bulk.
Fundamentals, Design, and Implementation, 9/e Chapter 11 Managing Databases with SQL Server 2000.
Data Management Design
Google Bigtable A Distributed Storage System for Structured Data Hadi Salimi, Distributed Systems Laboratory, School of Computer Engineering, Iran University.
Harvard University Oracle Database Administration Session 2 System Level.
Working with SQL and PL/SQL/ Session 1 / 1 of 27 SQL Server Architecture.
File and Database Design; Logic Modeling Class 24.
1 Chapter Overview Transferring and Transforming Data Introducing Microsoft Data Transformation Services (DTS) Transferring and Transforming Data with.
Module 11: Data Transport. Overview Tools and functionality in Oracle and their equivalents in SQL Server for: Data transport out of the database Data.
Emmanuel Cecchet et al.  Performance Scalability of J2EE application servers.  Test effect of: ◦ Application Implementation Methods ◦ Container Design.
Chapter 14 & 15 Conceptual & Logical Database Design Methodology
Module 9: Managing Schema Objects. Overview Naming guidelines for identifiers in schema object definitions Storage and structure of schema objects Implementing.
Enterprise Object Framework. What is EOF? Enterprise Objects Framework is a set of tools and resources that help you create applications that work with.
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
Oracle for Software Developers. What is a relational database? Data is represented as a set of two- dimensional tables. (rows and columns) One or more.
SQL Server to MySQL Database Migration SQLWays - Migration Software Presentation March 2009 Copyright (c) Ispirer Systems Ltd.
© D. Wong 2002 © D. Wong CS610 / CS710 Database Systems I Daisy Wong.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
Database Technical Session By: Prof. Adarsh Patel.
Enterprise JavaBeans. What is EJB? l An EJB is a specialized, non-visual JavaBean that runs on a server. l EJB technology supports application development.
Copyright  Oracle Corporation, All rights reserved. 4 CMIS Powell Oracle Designer: Creating the Database Design CMIS Powell.
ALMA Integrated Computing Team Coordination & Planning Meeting #1 Santiago, April 2013 Relational APDM & Relational ASDM models effort done in online.
Some Design Notes Iteration - 2 Method - 1 Extractor main program Runs from an external VM Listens for RabbitMQ messages Starts a light database engine.
Oracle Data Integrator Procedures, Advanced Workflows.
PyCoral, Python interface to CORAL By S.S.Tomar RRCAT, Indore, India.
1 Design Issues in XML Databases Ref: Designing XML Databases by Mark Graves.
Intro – Part 2 Introduction to Database Management: Ch 1 & 2.
Lecture # 3 & 4 Chapter # 2 Database System Concepts and Architecture Muhammad Emran Database Systems 1.
DataBase Management System What is DBMS Purpose of DBMS Data Abstraction Data Definition Language Data Manipulation Language Data Models Data Keys Relationships.
JDeveloper 10g and Oracle ADF Business Components Getting the Most Out of Your Data Avrom Roy-Faderman Senior Programmer November, 2005.
The Digital Archive Database Tool Shih Lin Computing Center Academia Sinica.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
ADO.Net TableAdapters and TableAdapterManager Code Camp 2008 Emmet Gray
Apr. 8, 2002Calibration Database Browser Workshop1 Database Access Using D0OM H. Greenlee Calibration Database Browser Workshop Apr. 8, 2002.
EGEE User Forum Data Management session Development of gLite Web Service Based Security Components for the ATLAS Metadata Interface Thomas Doherty GridPP.
CERN - IT Department CH-1211 Genève 23 Switzerland t CORAL COmmon Relational Abstraction Layer Radovan Chytracek, Ioannis Papadopoulos (CERN.
Topic : Hibernate 1 Kaster Nurmukan. An ORM tool The problem fixed by ORM Advantage Hibernate Hibernate Basic –Hibernate sessionFactory –Hibernate Session.
BI Practice March-2006 COGNOS 8BI TOOLS COGNOS 8 Framework Manager TATA CONSULTANCY SERVICES SEEPZ, Mumbai.
Session 1 Module 1: Introduction to Data Integrity
Object storage and object interoperability
3D Testing and Monitoring Lee Lueking LCG 3D Meeting Sept. 15, 2005.
Andrea Valassi (CERN IT-DB)CHEP 2004 Poster Session (Thursday, 30 September 2004) 1 HARP DATA AND SOFTWARE MIGRATION FROM TO ORACLE Authors: A.Valassi,
Starting with Oracle SQL Plus. Today in the lab… Connect to SQL Plus – your schema. Set up two tables. Find the tables in the catalog. Insert four rows.
Topic : Hibernate 1 Kaster Nurmukan. An ORM tool Used in data layer of applications Implements JPA.
CORAL CORAL a software system for vendor-neutral access to relational databases Ioannis Papadopoulos, Radoval Chytracek, Dirk Düllmann, Giacomo Govi, Yulia.
Oracle Business Intelligence Foundation – Testing and Deploying OBI Repository.
Status of tests in the LCG 3D database testbed Eva Dafonte Pérez LCG Database Deployment and Persistency Workshop.
1 Information Retrieval and Use De-normalisation and Distributed database systems Geoff Leese September 2008, revised October 2009.
5 Copyright © 2008, Oracle. All rights reserved. Testing and Validating a Repository.
Hoi Le. Why database? Spreadsheet is not good to: Store very large information Efficiently update data Use in multi-user mode Hoi Le2.
1 DIRAC Data Management Components A.Tsaregorodtsev, CPPM, Marseille DIRAC review panel meeting, 15 November 2005, CERN.
3 Copyright © 2006, Oracle. All rights reserved. Designing and Developing for Performance.
1 Copyright © 2008, Oracle. All rights reserved. Repository Basics.
11 Copyright © 2009, Oracle. All rights reserved. Enhancing ETL Performance.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
Jean-Philippe Baud, IT-GD, CERN November 2007
Database Replication and Monitoring
COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI
POOL persistency framework for LHC
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
Teaching slides Chapter 8.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Constraints.
Data Model.
MySQL Migration Toolkit
Chapter 11 Managing Databases with SQL Server 2000
Presentation transcript:

CORAL Database Copy Tools By Gitika Khare RRCAT, Indore, India

Objective Several experiment applications are based on LCG database abstraction layer CORAL for accessing relational data from several supported back-ends (Oracle, MySql, SQLite). To simplify deployment of CORAL based applications, a set of associated tools are required to allow copying of individual tables or complete schemas between existing databases and technologies. 2

CoralTools The CoralTools package provides a set of export tools for the CORAL framework. The mapping between data types of source and destination schema follows the CORAL mapping rules. This would allow the CORAL based applications to run unchanged against data copies in a different database backend. The tools support schema and data copy between the following relational databases – Oracle, MySQL and SQLite. The CoralTools package is developed in Python and is an implementation of the PyCoral interface developed using the python/C API. 3

schemautils Python Package The following set of CoralTools have been developed for the CORAL framework: listobjects(schema) Returns list of tables ordered by hierarchy dumpobjectlist(schema) Dumps the list of tables (and views) grouped and ordered by hierarchy, specifying the existing constraints and indexes. copyschema() Copies the schema objects from source to destination, without to copy data copydata() Copies the schema objects from source to destination, including data 4

schemautils Python Package copytableschema(tablename) Copies the specified tableschema. No data copy. copytabledata(tablename, selectionclause, selectionparameters) Copies the specified tableschema, including data copytablelistschema(tablelist) Copies the specified list of tables ordered by hierarchy. No data copy. copytablelistdata(tablelist) Copies the specified list of tables ordered by hierarchy, including data. tablelist is the list of tables with selectionclause and selectionparameters 5

Implementation Details Resolution of Table Hierarchies Export of a tree of hierarchically related objects from source to specified database required the knowledge of table dependency trees. A Python class is developed for providing schema object relationship information. The relational dependency class provides an implementation for building table dependency trees for a specific table and an entire schema. It scans all the tables in the schema to construct the dependencies between the tables. Circular dependency between the tables is not handled since it requires special treatment. This class is used for the implementation of CoralTools. 6

Implementation Details Scalability The tools are targeted to copy of big volumes of data. Implementation uses bulk operations on both reading and writing side, taking care to balance the data transfer from the source to the destination (minimize the roundtrips), and the memory required on the client side for caching. For copying of data buffer protocol is used, which allows reading and writing of data into a buffer without additional memory requirement. 7

Use Case 1 1. Export of all the objects from a specified schema from a source database into a specified database ordered by hierarchy. Source schema objects in destination database do not exist. 1.1 Schema only, no data 1.2 Schema + data 8

Use Case 2 2. Export of a tree of hierarchically related objects from a source database into a specified database. For the specified list of tables, the export considers ordering of tables by: a) all the upper level tables which are referenced by foreign key constraints. b) all of dependent tables (referencing columns of this table by foreign key constraint) c) The export also considers data selection on the specified table columns. 2.1 Tables and related objects (constraints, indexes) do not exist in the destination database. The required tables and related objects are consistently created. 2.2 Tables and related objects exist, possibly with data. The existing set of tables involved is checked. The export is successful if no primary key violations are found during the new data insertion. 9

CoralTools Usage (initialization) //Initialize Connection Service svc = coral.ConnectionService() //open session proxy for source schema providing logical service name & access mode session1 = svc.connect( ‘write_test', accessMode = coral.access_ReadOnly ) transaction1 = session1.transaction() //open session proxy for destination schema providing logical service name& accessmode session2 = svc.connect( ‘coral_test', accessMode = coral.access_Update ) transaction2 = session2.transaction() sourceSchema=session1.nominalSchema() destSchema=session2.nominalSchema() exp=exporter( sourceSchema,destSchema ) 10

UseCase 1 (schema+data) copydata() transaction1.start(True) transaction2.start() try: exp.copydata() transaction2.commit() print "Data copied" except Exception, e: transaction2.rollback() print "Test Failed" print str(e) transaction1.commit() 11

UseCase 2 (schema+data) copytabledata(tablename, selectionclause, selectionparameters) transaction1.start(True) transaction2.start() try: tablename = "T1" selectionclause= "id > :idmin and id < :idmax" selectionparameters = coral.AttributeList() selectionparameters.extend( "idmin","int") selectionparameters.extend( "idmax","int") selectionparameters["idmin"].setData(1) selectionparameters["idmax"].setData(10) exp.copytabledata(tablename,selectionclause,selectionparameters) transaction2.commit() print "Data copied" except Exception, e: transaction2.rollback() print "Test Failed" print str(e) transaction1.commit() 12

UseCase 2 (schema only) copytablelistschema(tablelist) transaction1.start(True) transaction2.start() try: tablelist = ['T3','T1','T2'] exp.copytablelistschema(tablelist) transaction2.commit() print "Tables created" except Exception, e: transaction2.rollback() print "Test Failed" print str(e) transaction1.commit() 13

UseCase 2 (schema+data) copytablelistdata(tablelist) transaction1.start(True) transaction2.start() try: table1 = "T3" selectionclause1= "id >= 0 and id<10" table2 = "T2" selectionclause2= "id >= :idmin and id < :idmax" selectionparameters2 = coral.AttributeList() selectionparameters2.extend( "idmin","int") selectionparameters2.extend( "idmax","int") selectionparameters2["idmin"].setData(0) selectionparameters2["idmax"].setData(25) table3 = "T1" 14

UseCase 2 (schema+data) tablelist = [[table1,selectionclause1], [table2,selectionclause2,selectionparameters2], [table3]] exp.copytablelistdata(tablelist) transaction2.commit() print "Data copied" except Exception, e: transaction2.rollback() print "Test Failed" print str(e) transaction1.commit() 15

Exception Handling Circular dependency exists between the tables. Tables exists in destination schema. Unique constraint violated - (if data exists in the table) table or view does not exist - (Upper level table referenced by foreign key constraint does not exist in destination schema) Integrity constraint for foreign key violated – (data not found in upper level table which are referenced by foreign key constraint) 16

Status The CoralTools have been developed and tested using the test cases with Oracle, MySQL and SQLite. The tools for both UseCase 1 & UseCase 2 have been tested with a case with POOL-ORA application with Oracle, SQLite and MySQL database. Documentation has been prepared in compliance with the CORAL doc framework. Testing for Scalability, Performance analysis and Optimization is in progress. The tools have to be tested with a case with COOL application. 17