Data Migration Tools By d.c.b.a

Slides:



Advertisements
Similar presentations
Database Basics. What is Access? Database management system Computer-based equivalent of a manual database Makes it easy to organize and update information.
Advertisements

CC SQL Utilities.
What is a Database By: Cristian Dubon.
Loading & organising data. Objectives Loading data using direct-load insert Loading data into oracle tables using SQL*Loader conventional and direct paths.
9 Copyright © 2004, Oracle. All rights reserved. Managing Data.
Chapter 5 Data Management. – The Best & Most Convenient Way to Learn Salesforce.com 2 Objectives By the end of the module, you.
Quick-and-dirty.  Commands end in a semi-colon ◦ If you forget, another prompt line shows up  Either continue the command or…  End it with a semi-colon.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
David Konopnicki Choosing Access Path ä The basic methods. ä The access paths and when they are available. ä How the optimizer chooses among the.
Attribute databases. GIS Definition Diagram Output Query Results.
Copyright  Oracle Corporation, All rights reserved. 4 Creating Functions.
9 Copyright © Oracle Corporation, All rights reserved. Oracle Recovery Manager Overview and Configuration.
DAT702.  Standard Query Language  Ability to access and manipulate databases ◦ Retrieve data ◦ Insert, delete, update records ◦ Create and set permissions.
ORACLE ONLINE TRAINING Contact our Support Team : SOFTNSOL India: Skype id : softnsoltrainings id:
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.
Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 13 Database Management Systems: Getting Data Together.
ASP.NET Programming with C# and SQL Server First Edition
Web Application Development. Define ER model in QSEE Generate SQL Create Database mySQL Write Script to use TableEditor class Process to create A simple.
Web Application Development. Tools to create a simple web- editable database QSEE MySQL (or PHPMyAdmin) PHP TableEditor.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
MS Access Database Connection. Database? A database is a program that stores data and records in a structured and queryable format. The tools that are.
Oracle Database Administration Lecture 6 Indexes, Optimizer, Hints.
Lecture 4 PL/SQL language. PL/SQL – procedural SQL Allows combining procedural and SQL code PL/SQL code is compiled, including SQL commands PL/SQL code.
15/10/20151 PHP & MySQL 'Slide materials are based on W3Schools PHP tutorial, 'PHP website 'MySQL website.
PHP MySQL Introduction. MySQL is the most popular open-source database system. What is MySQL? MySQL is a database. The data in MySQL is stored in database.
Copyright  Oracle Corporation, All rights reserved. 1 Oracle Architectural Components.
PowerBuilder Online Courses - by Prasad Bodepudi
1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen Introduction to Relational Databases &
SQL FUNDAMENTALS SQL ( Structured Query Language )
1 Structured Query Language (SQL). 2 Contents SQL – I SQL – II SQL – III SQL – IV.
CERN - IT Department CH-1211 Genève 23 Switzerland t DB Development Tools Benthic SQL Developer Application Express WLCG Service Reliability.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting MySQL – Inserting Data.
Chapter 3 Selected Single-Row Functions and Advanced DML & DDL.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 8 Advanced SQL.
Guide to Oracle 10g ITBIS373 Database Development Lecture 4a - Chapter 4: Using SQL Queries to Insert, Update, Delete, and View Data.
2 Using Administration Tools Objectives Using the Server Manager Line Mode Identifying administration applications supplied with the Oracle Enterprise.
Microsoft Access 2013 ®® Tutorial 12 Managing and Securing a Database.
D Copyright © Oracle Corporation, All rights reserved. Loading Data into a Database.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 (Part II) INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Manipulating Data. Objectives After completing this lesson, you should be able to do the following: Describe each DML statement Insert rows into a table.
Chapter 9: Advanced SQL and PL/SQL Guide to Oracle 10g.
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
9-1 © Prentice Hall, 2007 Topic 9: Physical Database Design Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Altering Tables and Constraints Database Systems Objectives Add and modify columns. Add, enable, disable, or remove constraints. Drop a table. Remove.
SQL LOADER. SQL*Loader (sqlldr ) is the utility to use for high performance data loads. The data can be loaded from any text file and inserted into the.
© 2007 by Prentice Hall2-1 Introduction to Oracle 10g Chapter 2 Overview of SQL and SQL*Plus James Perry and Gerald Post.
2 Copyright © 2006, Oracle. All rights reserved. Configuring Recovery Manager.
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.
Optimization and Administartion of a Database Management Systems Krystian Zieja.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 14 Web Database Programming Using PHP.
11-1 © Prentice Hall, 2004 Chapter 11: Physical Database Design Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
SQL: Structured Query Language It enables to create and operate on relational databases, which are sets of related information stored in tables. It is.
Installation Oracle 11g Express 2 double click the "setup" button to install the Oracle.
 CONACT UC:  Magnific training   
MySQL Tutorial. Databases A database is a container that groups together a series of tables within a single structure Each database can contain 1 or more.
1 ORACLE I 3 – SQL 1 Salim Phone: YM: talim_bansal.
C Copyright © 2009, Oracle. All rights reserved. Using SQL Developer.
11 Copyright © 2009, Oracle. All rights reserved. Enhancing ETL Performance.
D Copyright © 2009, Oracle. All rights reserved. Using SQL*Plus.
Advanced Accounting Information Systems
Choosing Access Path The basic methods.
Database Management  .
Interacting with the Oracle Server
MS Access Database Connection
ORACLE SQL Developer & SQLPLUS Statements
ISC440: Web Programming 2 Server-side Scripting PHP 3
Structured Query Language
DATABASES WHAT IS A DATABASE?
Presentation transcript:

Data Migration Tools By d.c.b.a

Source & Target  Source  Oracle  MySQL  Target  Oracle  MySQL  Flat Text File  Download

Oracle Source  Oracle to Oracle  datacopy  Oracle to MySQL  ora2mysql  Oracle to Flat Text File  SQLULDR2

MySQL Source  MySQL to Oracle  mysql2ora  MySQL to MySQL  mysqlcopy  MySQL to Flat Text File  MYSQLULDR2

Basic Concept  Query on Source, DML on Target  Only Select Allowed on Source Database  Insert/Update/Delete/Script allowed on Target Database,  Refer source columns by “:”+column name  Query1/Table1 for Source SELECT Statement  Query2/Table2 for Target DML Statement  Basic Data Types Supported. Object Data Types not Supported.  Array Operation to Reduce Network Roundtrips.  Direct Load Supported for Oracle.  Parallel Supported for Both Oracle and MySQL.  Parameter File Supported.

Database Connection  User1 Option for Source Database  User2 Option for Target Database  Oracle Connection    “sys” for SYSDBA logon (Oracle Database)  MySQL Connection   Default Port is 3306

Return Code  Windows  %ERRORLEVEL%  Linux/Unix  $?  Zero value for success without any errors.  Non-zero value for error, different error different return code.

DATACOPY From Oracle To Oracle

DATACOPY  Manipulate Data Between Oracle Databases.  Operations  Direct Load Insert  Insert  Update  Delete  PL/SQL Block  The SYNC option

Direct Load Insert (DATACOPY)  Using TABLE2 option to specify the table name on target database.  Specify the “direct=yes” option.  Example  datacopy query1=“select * from emp” table2=emp direct=yes

Insert (DATACOPY)  Using QUERY2 Option to Specify the Insert Statement on Target Database  Refer the source column value by “:” plus column name  Example  datacopy query1=“select eno, ename from emp” query2=“insert into emp(eno, ename) values (:eno, :ename)”

Update (datacopy)  Using QUERY2 Option to Specify the Update Statement on Target Database  Refer the source column value by “:” plus column name  Example  datacopy query1=“select eno, ename from emp” query2=“update emp set ename = :ename where eno = :eno”

Delete (DATACOPY)  Using QUERY2 Option to Specify the Delete Statement on Target Database  Refer the source column value by “:” plus column name  Example  datacopy query1=“select eno from emp” query2=“delete from emp where eno = :eno”

PL/SQL Block (DATACOPY)  Using QUERY2 Option to Specify the PL/SQL Script on Target Database  Refer the source column value by “:” plus column name  Example  datacopy query1=“select eno from emp” query2=“begin delete_emp(:eno); end;”

SYNC Option (datacopy)  Auto Generate Target SQL or PL/SQL Script without specify the “QUERY2” option.  Cooperation with “TABLE2” option.  SYNC=INSERT  Cooperation with “TABLE2” and “UNIQUE” option.  SYNC=UPDATE/DELETE  SYNC=DELINS/INSUPD/UPDINS

SYNC Option (DELINS)  Command  datacopy … table1=emp table2=emp unique=eno sync=delins  Real QUERY2 Value  Begin delete from emp where eno=:eno; insert into emp (…) values (…); end;

SYNC Option (UPDINS)  Command  datacopy … table1=emp table2=emp unique=eno sync=delins  Real QUERY2 Value  Begin update emp set … where eno=:eno; if sql%rowcount == 0 then insert into emp (…) values (…); end if; end;

SYNC Option (INSUPD)  Command  datacopy … table1=emp table2=emp unique=eno sync=delins  Real QUERY2 Value  Begin insert into emp (…) values (…); if unique error then update emp set … where eno=:eno; end if; end;

Tuning (datacopy)  Multiple Block Read (read=…)  Sort Area Size (sort= …)  Hash Area Size (hash=…)  Direct Path Read (serial=yes)  Parallel Query (/*+ PARALLEL … */ Hint)

Multiple Thread Copy  Automatically Split Into Pieces by ROWID Range.  Need “SELECT_CATALOG_ROLE” to access “DBA_EXTENTS” view.  Using “SPLIT” and “DEGREE” Option.  “SPLIT” for the base table for ROWID range analyze.  “DEGREE” for the parallel degree.  Example  datacopy … split=emp degree=4 …

Why “SPLIT” Option  Source Query Can be Complex.  select … from emp, deptno where emp.deptno = dept.deptno and emp.rowid >= :minrid and emp.rowid < :maxrid  select deptno, count(*) from emp where rowid >= :minrid and rowid < :maxrid group by deptno  Parallel Can Only Be One Dimemsion.  Reference The ROWID Range by “:MINRID” and “:MAXRID”.

Character Set  Source Database  NLS_LANG environment variable  Target Database  “CHARSET” option for basic character set.  “NCHARSET” option for national character set.  From US7ASCII to ZHS16GBK  export NLS_LANG=.US7ASCII  datacopy … charset=ZHS16GBK …

Parameter File  Text File (test.par)    query1=select * from emp  table2=emp  read=128  serial=yes  Command  datacopy parfile=test.par

ORA2MYSQL From Oracle To MySQL

Reference  Multiple Thread Support Refer DATACOPY.

SYNC Option (ora2mysql)  Auto Generate Target SQL without specify the “QUERY2” option.  Cooperation with “TABLE2” option.  SYNC=INSERT/ARRINS  Cooperation with “TABLE2” and “UNIQUE” option.  SYNC=UPDATE/DELETE/INSUPD/ARRUPD

Target SQL (ora2mysql)  ARRINS  Insert into emp (…) values (…), (…), (…)  INSUPD  Insert into emp (…) values (…) on duplicate key …  ARRUPD  Insert into emp (…) values (…) (…) (…) on duplicate key …

Character Set  MySQL Character Set is Controlled By “CHARSET” option.  Oracle Character Set is Controlled By “NLS_LANG” Environment Variable.

SQLULDR2 From Oracle To Flat File

Reference  Multiple Thread Support Refer DATACOPY.

Flat File Format  Fixed Width Format  How to Split Different Records?  Using the “FIELD” Option.  Using “0xXX” for Any Characters.  How to Split Different Fields?  Using the “RECORD” Option.  Using “0xXX” for Any Characters.  Example  sqluldr2 … field=0x07 record=0x06 …

Output File Name  Dynamic File Name  %y=Year  %m=Month  %d=Day  %w=Week  %b=Batch Count  %p=Thread ID  %t=Timestamp (now() function)

Multiple Output Files  Split Output File by “SIZE” Options.  Unit Megabytes  sqluldr2 … size=500 file=data_%b.txt  Split Output File by “BATCH” Options.  Store each rows in a single file  sqlldr2 … rows= batch=yes file=data_%b.txt …

SQL*Loader Control File  SQL * Loader need a parameter file (describing the format of the flat file) to load flat text file into Oracle database.  “TABLE” for the table name of target database.  “MODE” for the SQL * Loader option, default is “INSERT”, other options are “APPEND”, “REPLACE” and “TRUNCATE”.  “CONTROL” for the SQL*Loader control file name, default is “ _sqlldr.ctl”.

MYSQL2ORA From MySQL to Oracle

Reference  Target Operation Please Refer DATACOPY.

Attention  LONG/LOB values larger than 64KB Not Supported Now.

Multiple Thread Copy  Automatically Split Into Pieces by Given Column.  Using “SPLIT”, “SPLITKEY” and “DEGREE” Option.  “SPLIT” for the base table.  “SPLITKEY” for the key prefix column of the base table.  “DEGREE” for the parallel degree.  Example  mysql2ora … split=emp splitkey=empno degree=4 …

Why “SPLIT” Option  Source Query Can be Complex.  select … from emp, deptno where emp.deptno = dept.deptno and emp.empno >= :minrid and emp.empno < :maxrid  select deptno, count(*) from emp where empno >= :minrid and empno < :maxrid group by deptno  Parallel Can Only Be One Dimemsion.  Reference The ROWID Range by “:MINRID” and “:MAXRID”.

The “SPLITKEY” Logic  Minimum Value  SELECT FROM ORDER BY LIMIT 1  Maximum Value  SELECT FROM ORDER BY DESC LIMIT 1  Split The Range Into Degree Pieces.  Only Number/Date/Char Columns Supported.  Data May Not Be Evenly Distributed.

SYNC Option (datacopy)  Auto Generate Target SQL or PL/SQL Script without specify the “QUERY2” option.  Cooperation with “TABLE2” option.  SYNC=INSERT  Cooperation with “TABLE2” and “UNIQUE” option.  SYNC=UPDATE/DELETE  SYNC=DELINS/INSUPD/UPDINS

MYSQLCOPY From MySQL to MySQL

Reference  Multiple Thread Please Refer MYSQL2ORA.

Attention  Source & Target Database Connection Using the Same Character Set.  Will Support Different Character Set Soon.

SYNC Option (mysqlcopy)  Auto Generate Target SQL without specify the “QUERY2” option.  Cooperation with “TABLE2” option.  SYNC=INSERT/ARRINS  Cooperation with “TABLE2” and “UNIQUE” option.  SYNC=UPDATE/DELETE/INSUPD/ARRUPD

Target SQL (mysqlcopy)  ARRINS  Insert into emp (…) values (…), (…), (…)  INSUPD  Insert into emp (…) values (…) on duplicate key …  ARRUPD  Insert into emp (…) values (…) (…) (…) on duplicate key …

MYSQLULDR2 From MySQL to Text File

Reference  Text File Format Please Refer SQLULDR2.  Multiple Thread Please Refer MYSQL2ORA.

Load Into Target Directly  Support In Memory “Load Local Infile” Interface by “LOAD” and “TABLE” option with File Format.  Example  mysqluldr2 table=emp2

DOWNLOAD Resrouce

Links          