SlideShare a Scribd company logo
1 of 91
Download to read offline
MySQL for
Oracle Developers



    Ronald Bradford
   www.arabx.com.au



                 Version 1.2 20 April 2006
MySQL for Oracle Developers

           MySQL Introduction


Solid peneration in open source community

LAMP Stack

Large number of open source projects

Included by default in most Linux distros




                                       Slide: 2
MySQL for Oracle Developers

        Purpose of Presentation


Maximise existing Oracle skill set

Preparation for management requests

Open Source introduction

Terminology/Product Knowledge Transfer




                                      Slide: 3
MySQL for Oracle Developers

             My Background                      INFO




16 years in Database Design Experience (1989)

10 years Oracle Experience (1996)

7 years MySQL Experience (1999)

Active in MySQL, Java, XP, Oracle User Groups 




                                     Slide: 4
MySQL for Oracle Developers

                  Presentation Conventions


    Associated Talk for DBA's                              MySQL for Oracle DBA's


    Oracle Specific Syntax                                     Oracle Command/Syntax




ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server

MYSQL_HOME=/usr/lib/mysql (*)       MYSQL_DATA=/var/lib/mysql (*)

(*) For RPM install. Will differ depending on Distro, or .tar.gz install



                                                                           Slide: 5
MySQL for Oracle Developers

                   Product Comparision

Current Versions at March 2006 (used in examples)




   MySQL 5.0 GA  (5.0.20)  Standard/Max
                                       http://www.mysql.com/products/database/


   Oracle 10g Release 2 Express Edition (10.2.0.1)
                          http://www.oracle.com/technology/products/database/xe




                                                              Slide: 6
MySQL for Oracle Developers

                  Product Comparision                 INFO




Other Production Versions




   Oracle 10g Release 2 (PE, SE1, SE, EE)
   Oracle 9i, 8i, 7.3
   MySQL 4.1, 4.0, 3.23
   MySQL MaxDB 7.6



                                           Slide: 7
MySQL for Oracle Developers

                 Product Comparision

Development Versions




   MySQL 5.1  (currently beta 5.1.7)    5.1


   MySQL 5.2


   Open Source Availability     OS




                                          Slide: 8
MySQL for Oracle Developers

   Oracle Developer Environments                 INFO




Oracle JDeveloper Java Application

J2EE Application Development Framework (ADF)

Application Express (HTMLDB)

Oracle Forms 4.5, 6i, 9i,10g 

PHP (Zend Core)


                                      Slide: 9
MySQL for Oracle Developers




             Forrester Research

             December 29, 2004
             Open Source Databases 
             Come Of Age




                Slide: 10
MySQL for Oracle Developers

                       Technical Resources
                                                               MYSQL
             ORACLE
                             otn.oracle.com        dev.mysql.com    forge.mysql.com
                        forums.oracle.com          forums.mysql.com
                 www.oracle.com/support            www.mysql.com/network
                     education.oracle.com          www.mysql.com/training
www.oracle.com/education/certification/            www.mysql.com/certification
                          blogs.oracle.com         www.planetmysql.org
www.oracle.com/technology/community/user_groups    dev.mysql.com/user­groups
                                                   www.mysql.com/doc
www.oracle.com/technology/documentation

                           www.orafaq.com          dev.mysql.com/tech­resources/faq.html



                                                                         Slide: 11
MySQL for Oracle Developers

        MySQL 5.0 For Developers (5 days)                                                  INFO


                              http://www.mysql.com/training/workshops/mysql_dev.html


Objectives
  Describe the MySQL client/server architecture
  Understand the steps necessary to invoke MySQL client programs
  Utilize the general­purpose mysql client program to run queries and retrieve results
  Perform queries and analysis of data utilizing the MySQL Query Browser graphical user interface
  Explain the MySQL connectors that provide connectivity for client programs
  Select the best data type for representing information in MySQL
  Manage the structural characteristics of your databases
  Manage the structural characteristics of the tables within your databases
  Utilize the SELECT statement to retrieve information from database tables




                                                                               Slide: 12
MySQL for Oracle Developers

             MySQL 5.0 For Developers                                                      INFO




Utilize expressions in SQL statements to retrieve more detailed information
Utilize SQL statements to modify the contents of database tables
Write join expressions in your SQL statements to obtain information from multiple tables
Utilize subqueries in your SQL statements
Create views utilizing SELECT statements to produce quot;virtual tablesquot; of specific data
Perform bulk data import and export operations
Create user defined variables, prepared statements and stored routines
Create and manage triggers
Use the INFORMATION_SCHEMA database to access metadata
Debug MySQL applications
Configure and Optimize MySQL




                                                                              Slide: 13
MySQL for Oracle Developers

           MySQL Installation                                    INFO



                                         MySQL for Oracle DBA's


Two Initial Databases
 mysql
 test

                  http://dev.mysql.com/doc/refman/5.0/en/installing.html


Access Privileges
 root

           http://dev.mysql.com/doc/refman/5.0/en/privilege_system.html


                                                     Slide: 14
MySQL for Oracle Developers

             Configuration/Log Files                                  INFO


                                          MySQL for Oracle DBA's


my.cnf                                      $ORACLE_HOME/dbs/init.ora


 $MYSQL_HOME/my.cnf,  /etc/my.cnf

Database Log                               .../admin/XE/bdump/alert_XE.log


 $MYSQL_DATA/`hostname`.err 


N/A                               $ORACLE_HOME/network/admin/tnsnames.ora


 User Security (host)



                                                        Slide: 15
MySQL for Oracle Developers

                  Terminology                               INFO



                                          MYSQL
       ORACLE
           Database (files)    Database Server Instance
Database Instance (memory)     Database Server Instance
             Schema User       Database
                      User     User
              Table Space      Table Space

                               Storage Engine




                                                Slide: 16
MySQL for Oracle Developers

       MySQL Sample Database
                                                scott/tiger




Sakila Sample Database
 Announced at this Conference

 Showcases Current MySQL features



                                http://forums.mysql.com/list.php?121




                                                  Slide: 17
MySQL for Oracle Developers

MySQL Sample Database                INFO




                         Slide: 18
MySQL for Oracle Developers

               Command Line SQL
mysql
                                                 sqlplus system/manager@netname



                            http://dev.mysql.com/doc/refman/5.0/en/mysql.html 

Command line syntax
  mysql ­u[username] ­p[password] ­h[host] [dbname]
  mysql ­p [dbname]
  mysql ­­help
Navigation commands
  help or ?        clear   c
  quit  q           edit
  ;   g  G         tee [file]



                                                             Slide: 19
MySQL for Oracle Developers

       Immediate SQL Differences

DUAL                   Date Functions
SYSDATE                Sequences   
DECODE()               Data Types
ROWNUM                 Naming Standards
NVL
                         Case Sensitivity 
JOIN (+) Syntax
                         Reserved Words 




                                   Slide: 20
MySQL for Oracle Developers

              Case Sensitivity
DDL Structure Names as Case sensitive
 e.g.  CREATE TABLE FilmActor (...);
 Operating System Dependent

LIKE for Data is Case insensitive
 e.g.  SELECT title FROM film WHERE title LIKE 'A%'
 Returns rows starting with 'ALIEN' and 'alien'

BINARY  DDL syntax
 e.g.   title VARCHAR(100) NOT NULL BINARY,

                                           Slide: 21
MySQL for Oracle Developers

           DLL Structure Syntax


Escaped Reserved Words are allowed
 e.g.  CREATE TABLE `group` (...);
 e.g.  CREATE TABLE “insert” (...);     * sql_mode

Tables/Columns/Triggers/Stored Procedures
Space and other special characters allowed
 Operating System Dependent
 e.g.  CREATE TABLE `My Table Name` (...);

                                              Slide: 22
MySQL for Oracle Developers

        Sequences Replacement
AUTO_INCREMENT                    CREATE SEQUENCE seq;



e.g.  id INT NOT NULL AUTO_INCREMENT,

  Must be tied to a [table].[column]
  Only one per table
  No system wide capability
  LAST_INSERT_ID()                      seq.CURRVAL



  No get next capability                seq.NEXTVAL




                                           Slide: 23
MySQL for Oracle Developers

          Optional Table Name
                                       DUAL



SELECT 1+1
 No Table Required

Provided for Oracle Compatibility
 e.g. SELECT 1+1 FROM DUAL

 e.g. SELECT DUMMY FROM DUAL    *** Fails



                                       Slide: 24
MySQL for Oracle Developers

                  Transactions


MySQL provides ACID compliant transactions
XA transactions  (Distributed Transaction Processing)
                               http://dev.mysql.com/doc/refman/5.0/en/xa.html


Supports transactional and non­transactional databases

Satisfy both mission­critical 24/7 usage and heavy Web or 
logging usage 



                                                       Slide: 25
MySQL for Oracle Developers

                    Transactions


By default, SQL commands are auto­committed
Transaction support with appropiate Storage Engines
  START TRANSACTION / BEGIN [WORK]
  ROLLBACK [WORK] / COMMIT [WORK]
  SET AUTOCOMMIT = {0 | 1};
  SAVEPOINT / ROLLBACK [WORK] TO SAVEPOINT
  SET TRANSACTION  (Isolation Level)
       http://dev.mysql.com/doc/refman/5.0/en/transactional­commands.html 


                                                        Slide: 26
MySQL for Oracle Developers

          Storage Engines                                     INFO



MyISAM                           FEDERATED
MERGE                            NDB (Cluster)
InnoDB                           CSV
BDB                              BLACKHOLE
MEMORY                           Example
ARCHIVE
          http://dev.mysql.com/doc/refman/5.0/en/storage­engines.html


                                                  Slide: 27
MySQL for Oracle Developers

                              Storage Engines
                                                                                        INFO




                                                           High




MySQL 5.0's Pluggable Storage Engine Architecture
                              http://www.mysql.com/why­mysql/white­papers/mysql_wp_pluggable.php


                                                                            Slide: 28
MySQL for Oracle Developers

                   Locking


Storage Engine Dependent
 Table Level Locking (MyISAM, Memory)
 Page Level Locking (BDB)
 Row Level Locking (InnoDB, Archive, NDB)


LOW_PRIORITY, HIGH_PRIORITY 
 changes WRITE/READ Lock Handling


                                            Slide: 29
MySQL for Oracle Developers

                      Locking

                                            Most Commonly 
InnoDB                                     Used Transactional 
                                             Storage Engine
  row­level locking

  multi­versioning 

  non­locking repeatable reads

  all four SQL standard isolation levels




                                                  Slide: 30
MySQL for Oracle Developers

                     NULL


[column] IS NULL, [column] IS NOT NULL

IFNULL([value],'')               NVL(), COALESCE()




ISNULL([value])

COALESCE([value],[value],[value])




                                        Slide: 31
MySQL for Oracle Developers

              SELECT
SELECT/FROM/WHERE/GROUP BY/HAVING
LIMIT n[,m]                               ROWNUM




LIKE
                                           ROWID

REGEXP
              http://dev.mysql.com/doc/refman/5.0/en/select.html
                                       UNION, UNION ALL

UNION, UNION ALL                      INTERSECT, MINUS



              http://dev.mysql.com/doc/refman/5.0/en/union.html



                                              Slide: 32
MySQL for Oracle Developers

                                         JOIN
  INNER JOIN                                                       ON, NATURAL, USING
                                                                      PARTITION BY
  OUTER JOIN
  NO FULL OUTER JOIN
                                         http://dev.mysql.com/doc/refman/5.0/en/join.html
join_table:
  table_reference [INNER | CROSS] JOIN table_factor [join_condition]
  table_reference STRAIGHT_JOIN table_factor
  table_reference STRAIGHT_JOIN table_factor ON condition
  table_reference LEFT [OUTER] JOIN table_reference join_condition
  table_reference NATURAL [LEFT [OUTER]] JOIN table_factor
  table_reference RIGHT [OUTER] JOIN table_reference join_condition
  table_reference NATURAL [RIGHT [OUTER]] JOIN table_factor



                                                                           Slide: 33
MySQL for Oracle Developers

              Sub Queries


IN, NOT IN

ALL, ANY, SOME                        WITH




EXISTS, NOT EXISTS

Correlated subqueries

In FROM Clause

                                       Slide: 34
MySQL for Oracle Developers

                      Full Text Search
FULLTEXT Index                                                     ORACLE TEXT



 MyISAM Storage Engine Only
  e.g. FULLTEXT KEY indx_title_description(title,description)
    SELECT f.film_id, f.title, f.description FROM film_text f
    WHERE MATCH (title,description) AGAINST ('MySQL');
    SELECT f.film_id, f.title, f.description  FROM film_text f  
    WHERE MATCH (title,description)
    AGAINST ('+MySQL ­Monkey' IN BOOLEAN MODE);
    SELECT f.film_id, f.title, f.description  FROM film_text f  
    WHERE MATCH (title,description)
    AGAINST ('database' WITH QUERY EXPANSION);


                      http://dev.mysql.com/doc/refman/5.0/en/fulltext­search.html


                                                                      Slide: 35
MySQL for Oracle Developers

                 INSERT


INSERT INTO [table] SET [col]=[value], ...
Multiple Row Insert                       INSERT ALL ... WHEN



DEFAULT values
 DEFAULT  or  DEFAULT(col_name)

AUTO_INCREMENT ­  NULL,0 or col not stated 
                  http://dev.mysql.com/doc/refman/5.0/en/insert.html



                                                  Slide: 36
MySQL for Oracle Developers

                        UPDATE


ORDER BY/LIMIT
 e.g. UPDATE CacheTable SET expiry = NOW()                               
        ORDER BY oldest LIMIT 10

Multiple Table Update
 UPDATE items,month SET items.price=month.price           
 WHERE items.id=month.id;

                         http://dev.mysql.com/doc/refman/5.0/en/update.html


                                                         Slide: 37
MySQL for Oracle Developers

                      DELETE


ORDER BY/LIMIT
 e.g. DELETE FROM CacheTable ORDER BY oldest LIMIT 10;

Multiple Table Delete
 DELETE t1, t2 FROM t1, t2, t3 WHERE t1.id=t2.id AND t2.id=t3.id;
 DELETE FROM t1, t2 USING t1, t2, t3 WHERE t1.id=t2.id AND 
 t2.id=t3.id;
                       http://dev.mysql.com/doc/refman/5.0/en/delete.html



                                                       Slide: 38
MySQL for Oracle Developers

                  REPLACE

                                          MERGE (very cumbersome)
Combined Insert/Update
REPLACE works exactly like INSERT, except that if 
an old record in the table has the same value as a 
new record on a unique index, the old record is 
deleted before the new record is inserted.

  Affects Trigger Operation
                  http://dev.mysql.com/doc/refman/5.0/en/replace.html


                                                    Slide: 39
MySQL for Oracle Developers

          DML Syntax Differences                                    INFO




LOW_PRIORITY 
 execution of the INSERT is delayed until no other clients are 

 reading from the table. 

 Not good on read­heavy environment

INSERT, UPDATE, DELETE, REPLACE
                                                                 Bad Idea
 INSERT LOW_PRIORITY INTO LogTable VALUES ();



                                                     Slide: 40
MySQL for Oracle Developers

          DML Syntax Differences                                INFO




HIGH_PRIORITY 
 gives the SELECT higher priority than a statement that updates
 Only for queries that are very fast and must be done at once

SELECT, INSERT
 SELECT HIGH_PRIORITY FROM CacheTable; 




                                                    Slide: 41
MySQL for Oracle Developers

          DML Syntax Differences                                               INFO




DELAYED 
 the server puts the row or rows to be inserted into a buffer, and the 
 client issuing the INSERT DELAYED  statement can then continue 
 immediately.


INSERT, REPLACE Statements                                           Good Idea
                                                                     Non Critical Data

 INSERT DELAYED INTO LogTable VALUES ();
                 http://dev.mysql.com/doc/refman/5.0/en/insert­delayed.html



                                                         Slide: 42
MySQL for Oracle Developers

          DML Syntax Differences                                      INFO




IGNORE
 errors that occur while executing the INSERT  statement are 
 treated as warnings instead

INSERT, UPDATE, DELETE Statements                                 Poor 
                                                               Programming

 INSERT IGNORE INTO LogTable VALUES ();                          Practice




                                                   Slide: 43
MySQL for Oracle Developers

                     Data Types


Numeric
 TINYINT,SMALLINT,MEDIUMINT,INT,BIGINT
 FLOAT,DOUBLE,DECIMAL,BIT

Date
 DATE,TIME,DATETIME,TIMESTAMP,YEAR
                    http://dev.mysql.com/doc/refman/5.0/en/data­types.html

          http://dev.mysql.com/doc/refman/5.0/en/storage­requirements.html


                                                        Slide: 44
MySQL for Oracle Developers

                    Data Types


String
  CHAR,VARCHAR,BINARY,VARBINARY,
  TINYTEXT,MEDIUMTEXT,TEXT,LONGTEXT
  TINYBLOB,MEDIUMBLOB,BLOG,LONGBLOB
  ENUM,SET
                   http://dev.mysql.com/doc/refman/5.0/en/data­types.html

         http://dev.mysql.com/doc/refman/5.0/en/storage­requirements.html



                                                       Slide: 45
MySQL for Oracle Developers

                  Data Types


Spatial
  GEOMETRY, POINT, LINESTRING, POLYGON,
  GEOMETRYCOLLECTION, MULTILINESTRING,
  MULTIPOINT, MULTIPOLYGON




          http://dev.mysql.com/doc/refman/5.0/en/spatial­extensions.html




                                                      Slide: 46
MySQL for Oracle Developers

                Numeric Data Types


FLOAT, DOUBLE – floating point types
  e.g. lat FLOAT(10,6), lon FLOAT(10,6)   Floating Point  NUMBER
                                          Fixed Point      NUMBER(p,s)

DECIMAL – fixed point type
                                          Integer             NUMBER(p)



  e.g.  amt DECIMAL(10,2) NOT NULL,
INT ­ Integer

UNSIGNED, ZEROFILL
  e.g  cnt INT(6) UNSIGNED ZEROFILL,

                                                Slide: 47
MySQL for Oracle Developers

                         Date Data Types
                                                                     TIMESTAMP (faction precision)
                                                                       WITH [LOCAL] TIMEZONE


TIMESTAMP
 First TIMESTAMP column defaults to last update date/time
 Good for behind the scenes auditing
 Second only granularity

 CREATE TABLE ...  
   last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP 
                                                           ON UPDATE CURRENT_TIMESTAMP,
   created  TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
   ...




                                                                                  Slide: 48
MySQL for Oracle Developers

           Constraint Data Types


ENUM
 size ENUM('S','M','L','XL','XXL')
                        http://dev.mysql.com/doc/refman/5.0/en/enum.html

SET
 color SET ('Red','Blue','Green','White','Black')
                          http://dev.mysql.com/doc/refman/5.0/en/set.html

              http://dev.mysql.com/doc/refman/5.0/en/constraint­enum.html


                                                       Slide: 49
MySQL for Oracle Developers

        Large Objects (LOB)
                                     CLOB, BLOB,NCLOB, BFILE



TINYBLOB, BLOB, MEDIUMBLOB, LONGBLOB

TINYTEXT, TEXT, MEDIUMTEXT,  LONGTEXT

 255 bytes, 64K, 16M, 4G


                http://dev.mysql.com/doc/refman/5.0/en/blob.html




                                              Slide: 50
MySQL for Oracle Developers

                String Functions
                                                       'A' || 'B'
                                                    CONCAT('A','B')

SELECT CONCAT('A','B');

SELECT CONCAT_WS(',','a','b','c',d');



SET sql_mode='PIPES_AS_CONCAT';
SELECT 'A'||'B';


               http://dev.mysql.com/doc/refman/5.0/en/string­functions.html



                                                         Slide: 51
MySQL for Oracle Developers

                 String Functions


Multiple Character Set Support
  SHOW CHARACTER SET;
  SELECT 'Test' = 'TEST';
  SELECT _latin1 'Test' = 'TEST';
  SELECT _latin1 'Test' = BINARY 'TEST';

Collation
  Defines String Comparisions
  Defines Sorting Order
                          http://dev.mysql.com/doc/refman/5.0/en/charset.html


                                                           Slide: 52
MySQL for Oracle Developers

                   Date Calendar                                         INFO




                                                       Julian Dates?
                                         http://www.orafaq.com/papers/dates_o.doc

Proleptic Gregorian calendar
October 4­15 1582 cutover
  Pre Julian
  Post Gregorian
The “Year­Zero” rule
The “Leap­Year Calculation” rule
               http://dev.mysql.com/doc/refman/5.0/en/mysql­calendar.html


                                                           Slide: 53
MySQL for Oracle Developers

                  Date Functions

SELECT CURDATE(), NOW(), SYSDATE()
 Second only granularity
        http://dev.mysql.com/doc/refman/5.0/en/date­and­time­functions.html

TimeZones  ­ UTC or named
 e.g. SET time_zone = '+10:00'; 
 'Europe/Helsinki', 'US/Eastern',  'MET',  'SYSTEM'
 Manual Installation step to seed data
             http://dev.mysql.com/doc/refman/5.0/en/time­zone­support.html


                                                         Slide: 54
MySQL for Oracle Developers

                Control Flow Functions
IF
                                                          DECODE()   CASE()
 SELECT IF(1>0,'yes','no');
     ­> 'yes'

CASE
 SELECT CASE WHEN 1>0 THEN 'yes' ELSE 'no' END;
 ­> 'true'
 SELECT CASE  'B' WHEN 'a' THEN 1 WHEN 'b' THEN 2 END;
 ­> 2
 SELECT CASE BINARY 'B' WHEN 'a' THEN 1 WHEN 'b' THEN 2 END;
 ­> NULL
                http://dev.mysql.com/doc/refman/5.0/en/control­flow­functions.html


                                                                Slide: 55
MySQL for Oracle Developers

                System Variables                               INFO




Server (e.g. /etc/my.cnf)
  sort_buffer_size=500000

GLOBAL 
  SET GLOBAL sort_buffer_size=750000;

SESSION 
  SET SESSION sort_buffer_size=1000000;
  SELECT @@global.sort_buffer_size, @@session.sort_buffer_size;


                                                   Slide: 56
MySQL for Oracle Developers

                  SHOW
SHOW TABLES;
SHOW WARNINGS;
SHOW STATUS;  FLUSH STATUS;
SHOW VARIABLES;
SHOW VARIABLES LIKE '%size%';
SHOW VARIABLES LIKE 'sort_buffer_size';
SHOW GLOBAL VARIABLES LIKE 'sort_buffer_size';


                                      Slide: 57
MySQL for Oracle Developers

                SQL Mode


Key Modes
 ANSI 
 STRICT_TRANS_TABLES 
 TRADITIONAL

SHOW VARIABLES LIKE 'sql_mode';

SET sql_mode='strict_all_tables';

                                      Slide: 58
MySQL for Oracle Developers

                      SQL Mode


Oracle Compatibility
 SET sql_mode='PIPES_AS_CONCAT,ANSI_QUOTES, 
 IGNORE_SPACE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS, 
 NO_FIELD_OPTIONS, NO_AUTO_CREATE_USER';



              http://dev.mysql.com/doc/refman/5.0/en/server­sql­mode.html

       http://dev.mysql.com/tech­resources/articles/mysql­data­integrity.html




                                                          Slide: 59
MySQL for Oracle Developers

    Procedural Language Support


Stored Procedures

Functions

UDF  ­ User Defined Functions

Triggers




                                    Slide: 60
MySQL for Oracle Developers

                         Procedures


No Package Capabilites

   http://bugs.mysql.com/bug.php?id=11696                       OS

NO RAISE Error Capability
No Named Parameters
No Overloading
                           http://dev.mysql.com/doc/refman/5.0/en/stored­procedures.html

General Purpose Stored Routines Library  http://www.nongnu.org/mysql­sr­lib/ 



                                                                   Slide: 61
MySQL for Oracle Developers

                                                       Procedures                                          INFO

DELIMITER //
CREATE PROCEDURE rewards_report (
    IN min_monthly_purchases TINYINT UNSIGNED
    , IN min_dollar_amount_purchased DECIMAL(10,2) UNSIGNED
    , OUT count_rewardees INT
)
LANGUAGE SQL
NOT DETERMINISTIC
READS SQL DATA
SQL SECURITY DEFINER
COMMENT 'Provides a customizable report on best customers'
proc: BEGIN

    DECLARE last_month_start DATE;
    DECLARE last_month_end DATE;

    /* Some sanity checks... */
    IF min_monthly_purchases = 0 THEN
        SELECT 'Minimum monthly purchases parameter must be > 0';
        LEAVE proc;
    END IF;
    SET last_month_start = DATE_SUB(CURRENT_DATE(), INTERVAL 1 MONTH);
    CREATE TEMPORARY TABLE tmpCustomer (customer_id SMALLINT UNSIGNED NOT NULL PRIMARY KEY);
   ...
    SELECT COUNT(*) FROM tmpCustomer INTO count_rewardees;
    DROP TABLE tmpCustomer;
END //




                                                                                               Slide: 62
MySQL for Oracle Developers

                                  Functions

Example – Wrap IFNULL with NVL for Oracle Compatibility

DELIMITER //
CREATE FUNCTION NVL(IN col VARCHAR(100), IN nullvalue VARCHAR(100)) 
                                            RETURNS VARCHAR(100)
BEGIN
  RETURN IFNULL(col,nullvalue);
END;
//
DELIMITER ;

SELECT NVL(col,'Unknown') FROM table




                                                                   Slide: 63
MySQL for Oracle Developers

                      Functions


SHOW CREATE FUNCTION 'NVL';

SHOW FUNCTION STATUS LIKE 'NVL';

SELECT routine_name, routine_schema, routine_type 
FROM INFORMATION_SHEMA.routines;




                                              Slide: 64
MySQL for Oracle Developers

      User Defined Functions (UDF)                                                    INFO




Added as Object Files
   $ gcc ­I /usr/include/mysql/ ­shared ­o syslogudf.so syslogudf.c
   $ cp syslogudf.so /usr/lib
   mysql> create function logger returns integer soname 'syslogudf.so';
   mysql> select logger('logging from ' + version());
   $ tail /var/log/messages




                     http://dev.mysql.com/doc/refman/5.0/en/adding­functions.html




                                                                          Slide: 65
MySQL for Oracle Developers

                      User Defined Functions (UDF)                                                        INFO

#include <mysql.h>
#include <string.h>
#include <syslog.h>

my_bool logger_init(UDF_INIT *initid, UDF_ARGS *args, char *message) {
        initid­>maybe_null=0;
        return 0;
}

long long logger(UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error) {
        if (args­>arg_count != 1) {
                strcpy(error, quot;LOGGER(): needs messagequot;);
                return 1;
        }
        if (args­>arg_type[0] != STRING_RESULT) {
                strcpy(error, quot;LOGGER() message should be stringquot;);
                return 1;
        }

        syslog(LOG_INFO,quot;%squot;,args­>args[0]);
        *is_null = 0;
        *error = 0;
        return 0;
                                                                                    http://dammit.lt/stream/mysql/
}




                                                                                            Slide: 66
MySQL for Oracle Developers

   User Defined Functions (UDF)                             INFO




MySQL Message API

 Utilises Spread Toolkit 
                                                   www.spread.org



                     http://forge.mysql.com/projects/view.php?id=2




                                                Slide: 67
MySQL for Oracle Developers

                     Triggers
[BEFORE|AFTER] [INSERT|UPDATE|DELETE]

Only one trigger per table per DML statement

Missing
  INSTEAD OF (used in Views)
  No OR DML (e.g. INSERT OR UPDATE)
  No OR REPLACE  (e.g. CREATE OR REPLACE
  No WHEN Condition
  Only for DML statements (e.g. No DROP)
                     http://dev.mysql.com/doc/refman/5.0/en/triggers.html


                                                       Slide: 68
MySQL for Oracle Developers

                                          Triggers                                    INFO


DELIMITER ;;
CREATE TRIGGER `ins_film` AFTER INSERT ON `film` FOR EACH ROW BEGIN
    INSERT INTO film_text (film_id, title, description)
        VALUES (new.film_id, new.title, new.description);
  END;;

CREATE TRIGGER `upd_film` AFTER UPDATE ON `film` FOR EACH ROW BEGIN
    IF (old.title != new.title) or (old.description != new.description)
    THEN
        UPDATE film_text
            SET title=new.title,
                description=new.description,
                film_id=new.film_id
        WHERE film_id=old.film_id;
    END IF;
  END;;

CREATE TRIGGER `del_film` AFTER DELETE ON `film` FOR EACH ROW BEGIN
    DELETE FROM film_text WHERE film_id = old.film_id;
END;;
DELIMITER ;




                                                                          Slide: 69
MySQL for Oracle Developers

    Query Performance Analysis                              INFO




EXPLAIN [EXTENDED] SELECT select_options
                                   EXPLAIN PLAN FOR [statement]
SELECT only                        PLAN_TABLE



[SELECT] PROCEDURE ANALYSE();


              http://dev.mysql.com/doc/refman/5.0/en/explain.html




                                                Slide: 70
MySQL for Oracle Developers

     Query Performance Analysis                                 INFO




The Slow Query Log
 long_query_time=5  (my.cnf)
 mysqld ­­log­slow­queries=[filename] 
   ­­log­queries­not­using­indexes 
   ­­log­slow­admin­statements
           http://dev.mysql.com/doc/refman/5.0/en/slow­query­log.html 


                                                    Slide: 71
MySQL for Oracle Developers

          MySQL Commands                                                INFO



mysql                                myisamchk
mysqld                               myisamlog
mysqladmin                           myisampack
mysqlmanager                         mysqlbinlog
mysqlcheck                           perror
mysqldump                            mysqlupgrade
mysqlimport                          mysqlslap               5.1


mysqlcheck     http://dev.mysql.com/doc/refman/5.0/en/client­utility­programs.html



                                                           Slide: 72
MySQL for Oracle Developers

           INFORMATION_SCHEMA

                                                          Oracle Data Dictionary
Smaller set of tables
  TABLES, COLUMNS, VIEWS, ROUTINES, 
  USER_PREVILEGES
                                                      Dynamic Performance Views (V$)




  PROCESSLIST                        5.1


                http://dev.mysql.com/doc/refman/5.0/en/information­schema.html

 http://www.xcdsql.org/MySQL/information_schema/5.1/MySQL_5_1_INFORMATION_SCHEMA.html



                                                                  Slide: 73
MySQL for Oracle Developers




               Slide: 74
MySQL for Oracle Developers

              INFORMATION_SCHEMA                                            INFO



Examples
 SELECT TABLE_SCHEMA, SUM((DATA_LENGTH + INDEX_LENGTH) / (1024 * 1024)) AS 
 SIZE_MB  FROM INFORMATION_SCHEMA.TABLES
 GROUP BY TABLE_SCHEMA ORDER BY SIZE_MB DESC

 SELECT ROUTINE_TYPE, ROUTINE_NAME FROM INFORMATION_SCHEMA.ROUTINES 
 WHERE ROUTINE_SCHEMA='dbname';

 SELECT TRIGGER_NAME,EVENT_MANIPULATION,EVENT_OBJECT_TABLE, 
 ACTION_STATEMENT FROM INFORMATION_SCHEMA.TRIGGERS WHERE 
 TRIGGER_SCHEMA='dbname';

 SELECT CONCAT('DROP TABLE ',table_name,';')
 INTO OUTFILE '/sql/drop_tables.sql'
 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test';



                                                                Slide: 75
MySQL for Oracle Developers

                  INFORMATION_SCHEMA                                                        INFO



Examples
 SELECT s.schema_name, CONCAT(IFNULL(ROUND((SUM(t.data_length)+           
 SUM(t.index_length))/1024/1024,2),0.00),'Mb') total_size,  
 CONCAT(IFNULL(ROUND(((SUM(t.data_length)+SUM(t.index_length))­
 SUM(t.data_free))/1024/1024,2),0.00),'Mb') data_used,
 CONCAT(IFNULL(ROUND(SUM(data_free)/1024/1024,2),0.00),'Mb') data_free,
 IFNULL(ROUND((((SUM(t.data_length)+SUM(t.index_length))­   
 SUM(t.data_free))/((SUM(t.data_length)+SUM(t.index_length)))*100),2),0) pct_used,       
 COUNT(table_name) total_tables
 FROM information_schema.schemata s
 LEFT JOIN information_schema.tables t ON s.schema_name = t.table_schema
 WHERE s.schema_name != 'information_schema'
 GROUP BY s.schema_name  ORDER BY pct_used DESCG




                                                                               Slide: 76
MySQL for Oracle Developers

         Helpful SQL Additions


LOAD DATA INFILE

SELECT INTO OUTFILE

DROP [object] IF EXISTS [name] 
   DROP TABLE IF EXISTS TableName;




                                        Slide: 77
MySQL for Oracle Developers

       MySQL 5.1 Major Features

                                                   5.1

Partitioning
Log Tables
Row Based Replication
Events
Federated Tables
Cluster Replication
                                       Slide: 78
MySQL for Oracle Developers

            End User Tools


MySQL Query Browser
MySQL Administrator
MySQL Workbench
3  Party Products
 rd




                                     Slide: 79
MySQL for Oracle Developers

           MySQL Query Browser

                                                SQL Developer / TOAD
Query Toolbar
  Easily Create, Edit, and Debug SQL Statements

Script Editor
Object Browser
Database Explorer
Table Editor
  Visually Create and Modify Tables
                              http://www.mysql.com/products/tools/query­browser/


                                                           Slide: 80
MySQL for Oracle Developers

         MySQL Administrator
User Administration                            OEM,  APEX


Single View Dynamic Health Monitoring
Quickly Optimize MySQL
Rapid Disaster Prevention and Recovery
Server Information At­a­Glance
View Replication Status
View Server Logs 
                      http://www.mysql.com/products/tools/administrator/



                                                  Slide: 81
MySQL for Oracle Developers

            MySQL Workbench
Reverse Engineer Database                      Oracle Designer



Database/Model synchronization
Concept/Logical/Physical Designs
DBDesigner4 import/export model
Extending
 Figure Stylesheets
 Scripts
 Plugins       http://forge.mysql.com/wiki/index.php/MySQL_Workbench


                                                   Slide: 82
MySQL for Oracle Developers

              rd
             3 Party Tools

PhpMyAdmin
                              http://www.phpmyadmin.net

Toad for MySQL
                       http://www.toadsoft.com/toadmysql/




                                       Slide: 83
MySQL for Oracle Developers

          Other MySQL Products                  INFO




MySQL Connectors
 ODBC, JDBC, ADO.NET, MPX

MySQL Migration Toolkit

MySQL Network – Commercial Support

Eventum


                                    Slide: 84
MySQL for Oracle Developers

                   What's Missing


Object Structure                 CREATE TYPE [obj] AS OBJECT



Table Snapshots

Materialized Views

Check Constraints

  CREATE VIEW ... WITH CHECK OPTION;

Flashback queries

Synonyms

                                              Slide: 85
MySQL for Oracle Developers

                 What's Missing

                                       COLUMN name FORMAT a40
                                       SET LINESIZE 100
SQL reports                            SPOOL [file]


No Memory Pinning capabilities

No wrapping capability (protect source)

No Java procedural language support




                                                  Slide: 86
MySQL for Oracle Developers

              What we covered?
SQL
SQL*Plus
PL/SQL
Tools Suite

Open Source Opportunity
Documentation References



                                     Slide: 87
MySQL for Oracle Developers




For access to this paper, more detailed notes    
       and other information, please visit.

           http://www.arabx.com.au




                                       Slide: 88
MySQL for Oracle Developers

                       References                                  INFO


http://www.mysql.com   ­  MySQL Web Site

http://dev.mysql.com   ­  MySQL Developer Zone

http://forums.mysql.com   ­  MySQL Forums

http://www.mysql.com/training/certification/   ­ MySQL Certification

http://www.planetmysql.org  ­  MySQL Blogs

www.mysqldevelopment.com ­ MySQL resources/tutorials




                                                       Slide: 89
MySQL for Oracle Developers

                             References                                      INFO


Storage Engines

   http://dev.mysql.com/tech­resources/articles/mysql_5.0_psea1.html

   http://dev.mysql.com/tech­resources/articles/mysql_5.0_psea2.html

   http://dev.mysql.com/tech­resources/articles/creating­new­storage­engine.html

   http://www.mysql.com/why­mysql/white­papers/mysql_wp_pluggable.php

Stored Procedures

   http://www.nongnu.org/mysql­sr­lib/ ­ General Purpose Stored Routines Library

   http://dev.mysql.com/tech­resources/articles/mysql­storedprocedures.html



                                                                 Slide: 90
MySQL for Oracle Developers

                        References                      INFO




Recommended Reading
 MySQL by Paul DuBois




                                            Slide: 91

More Related Content

What's hot

MySQL Spider Architecture
MySQL Spider ArchitectureMySQL Spider Architecture
MySQL Spider ArchitectureI Goo Lee
 
MySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptxMySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptxNeoClova
 
MySQL Architecture and Engine
MySQL Architecture and EngineMySQL Architecture and Engine
MySQL Architecture and EngineAbdul Manaf
 
MariaDB MaxScale
MariaDB MaxScaleMariaDB MaxScale
MariaDB MaxScaleMariaDB plc
 
Maxscale_메뉴얼
Maxscale_메뉴얼Maxscale_메뉴얼
Maxscale_메뉴얼NeoClova
 
MaxScale이해와활용-2023.11
MaxScale이해와활용-2023.11MaxScale이해와활용-2023.11
MaxScale이해와활용-2023.11NeoClova
 
Advanced MySQL Query Tuning
Advanced MySQL Query TuningAdvanced MySQL Query Tuning
Advanced MySQL Query TuningAlexander Rubin
 
Understanding my database through SQL*Plus using the free tool eDB360
Understanding my database through SQL*Plus using the free tool eDB360Understanding my database through SQL*Plus using the free tool eDB360
Understanding my database through SQL*Plus using the free tool eDB360Carlos Sierra
 
MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바NeoClova
 
Kevin Kempter PostgreSQL Backup and Recovery Methods @ Postgres Open
Kevin Kempter PostgreSQL Backup and Recovery Methods @ Postgres OpenKevin Kempter PostgreSQL Backup and Recovery Methods @ Postgres Open
Kevin Kempter PostgreSQL Backup and Recovery Methods @ Postgres OpenPostgresOpen
 
Galera cluster for high availability
Galera cluster for high availability Galera cluster for high availability
Galera cluster for high availability Mydbops
 
MySQL Indexing - Best practices for MySQL 5.6
MySQL Indexing - Best practices for MySQL 5.6MySQL Indexing - Best practices for MySQL 5.6
MySQL Indexing - Best practices for MySQL 5.6MYXPLAIN
 
MariaDB: in-depth (hands on training in Seoul)
MariaDB: in-depth (hands on training in Seoul)MariaDB: in-depth (hands on training in Seoul)
MariaDB: in-depth (hands on training in Seoul)Colin Charles
 
MySQL Parallel Replication by Booking.com
MySQL Parallel Replication by Booking.comMySQL Parallel Replication by Booking.com
MySQL Parallel Replication by Booking.comJean-François Gagné
 
Top 10 Mistakes When Migrating From Oracle to PostgreSQL
Top 10 Mistakes When Migrating From Oracle to PostgreSQLTop 10 Mistakes When Migrating From Oracle to PostgreSQL
Top 10 Mistakes When Migrating From Oracle to PostgreSQLJim Mlodgenski
 
MySQL Performance schema missing_manual_flossuk
MySQL Performance schema missing_manual_flossukMySQL Performance schema missing_manual_flossuk
MySQL Performance schema missing_manual_flossukValeriy Kravchuk
 
HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18Derek Downey
 
MySQL Atchitecture and Concepts
MySQL Atchitecture and ConceptsMySQL Atchitecture and Concepts
MySQL Atchitecture and ConceptsTuyen Vuong
 
MySQL Performance Schema in 20 Minutes
 MySQL Performance Schema in 20 Minutes MySQL Performance Schema in 20 Minutes
MySQL Performance Schema in 20 MinutesSveta Smirnova
 
Understanding PostgreSQL LW Locks
Understanding PostgreSQL LW LocksUnderstanding PostgreSQL LW Locks
Understanding PostgreSQL LW LocksJignesh Shah
 

What's hot (20)

MySQL Spider Architecture
MySQL Spider ArchitectureMySQL Spider Architecture
MySQL Spider Architecture
 
MySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptxMySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptx
 
MySQL Architecture and Engine
MySQL Architecture and EngineMySQL Architecture and Engine
MySQL Architecture and Engine
 
MariaDB MaxScale
MariaDB MaxScaleMariaDB MaxScale
MariaDB MaxScale
 
Maxscale_메뉴얼
Maxscale_메뉴얼Maxscale_메뉴얼
Maxscale_메뉴얼
 
MaxScale이해와활용-2023.11
MaxScale이해와활용-2023.11MaxScale이해와활용-2023.11
MaxScale이해와활용-2023.11
 
Advanced MySQL Query Tuning
Advanced MySQL Query TuningAdvanced MySQL Query Tuning
Advanced MySQL Query Tuning
 
Understanding my database through SQL*Plus using the free tool eDB360
Understanding my database through SQL*Plus using the free tool eDB360Understanding my database through SQL*Plus using the free tool eDB360
Understanding my database through SQL*Plus using the free tool eDB360
 
MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바
 
Kevin Kempter PostgreSQL Backup and Recovery Methods @ Postgres Open
Kevin Kempter PostgreSQL Backup and Recovery Methods @ Postgres OpenKevin Kempter PostgreSQL Backup and Recovery Methods @ Postgres Open
Kevin Kempter PostgreSQL Backup and Recovery Methods @ Postgres Open
 
Galera cluster for high availability
Galera cluster for high availability Galera cluster for high availability
Galera cluster for high availability
 
MySQL Indexing - Best practices for MySQL 5.6
MySQL Indexing - Best practices for MySQL 5.6MySQL Indexing - Best practices for MySQL 5.6
MySQL Indexing - Best practices for MySQL 5.6
 
MariaDB: in-depth (hands on training in Seoul)
MariaDB: in-depth (hands on training in Seoul)MariaDB: in-depth (hands on training in Seoul)
MariaDB: in-depth (hands on training in Seoul)
 
MySQL Parallel Replication by Booking.com
MySQL Parallel Replication by Booking.comMySQL Parallel Replication by Booking.com
MySQL Parallel Replication by Booking.com
 
Top 10 Mistakes When Migrating From Oracle to PostgreSQL
Top 10 Mistakes When Migrating From Oracle to PostgreSQLTop 10 Mistakes When Migrating From Oracle to PostgreSQL
Top 10 Mistakes When Migrating From Oracle to PostgreSQL
 
MySQL Performance schema missing_manual_flossuk
MySQL Performance schema missing_manual_flossukMySQL Performance schema missing_manual_flossuk
MySQL Performance schema missing_manual_flossuk
 
HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18
 
MySQL Atchitecture and Concepts
MySQL Atchitecture and ConceptsMySQL Atchitecture and Concepts
MySQL Atchitecture and Concepts
 
MySQL Performance Schema in 20 Minutes
 MySQL Performance Schema in 20 Minutes MySQL Performance Schema in 20 Minutes
MySQL Performance Schema in 20 Minutes
 
Understanding PostgreSQL LW Locks
Understanding PostgreSQL LW LocksUnderstanding PostgreSQL LW Locks
Understanding PostgreSQL LW Locks
 

Viewers also liked

Advanced SQL Injection
Advanced SQL InjectionAdvanced SQL Injection
Advanced SQL Injectionamiable_indian
 
CBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL PresentationCBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL PresentationGuru Ji
 
Mysql Datadictionary
Mysql DatadictionaryMysql Datadictionary
Mysql Datadictionaryrootuser
 

Viewers also liked (8)

MySql slides (ppt)
MySql slides (ppt)MySql slides (ppt)
MySql slides (ppt)
 
Advanced SQL Injection
Advanced SQL InjectionAdvanced SQL Injection
Advanced SQL Injection
 
MYSQL.ppt
MYSQL.pptMYSQL.ppt
MYSQL.ppt
 
MySQL
MySQLMySQL
MySQL
 
Introduction to MySQL
Introduction to MySQLIntroduction to MySQL
Introduction to MySQL
 
Introduction to Mysql
Introduction to MysqlIntroduction to Mysql
Introduction to Mysql
 
CBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL PresentationCBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL Presentation
 
Mysql Datadictionary
Mysql DatadictionaryMysql Datadictionary
Mysql Datadictionary
 

Similar to MySQL For Oracle Developers

MySQL For Oracle DBA's and Developers
MySQL For Oracle DBA's and DevelopersMySQL For Oracle DBA's and Developers
MySQL For Oracle DBA's and DevelopersRonald Bradford
 
My sql crashcourse_2012
My sql crashcourse_2012My sql crashcourse_2012
My sql crashcourse_2012sqlhjalp
 
Mysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesMysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesTarique Saleem
 
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
 Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL SupportMysql User Camp
 
My sql susecon_crashcourse_2012
My sql susecon_crashcourse_2012My sql susecon_crashcourse_2012
My sql susecon_crashcourse_2012sqlhjalp
 
MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...
MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...
MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...GeneXus
 
MySQL Community and Commercial Edition
MySQL Community and Commercial EditionMySQL Community and Commercial Edition
MySQL Community and Commercial EditionMario Beck
 
Oracle MySQL Tutorial -- MySQL NoSQL Cloud Buenos Aires Nov, 13 2014
Oracle MySQL Tutorial -- MySQL NoSQL Cloud Buenos Aires Nov, 13 2014Oracle MySQL Tutorial -- MySQL NoSQL Cloud Buenos Aires Nov, 13 2014
Oracle MySQL Tutorial -- MySQL NoSQL Cloud Buenos Aires Nov, 13 2014Manuel Contreras
 
2012 replication
2012 replication2012 replication
2012 replicationsqlhjalp
 
State of The Dolphin - May 2021
State of The Dolphin - May 2021State of The Dolphin - May 2021
State of The Dolphin - May 2021Frederic Descamps
 
20200613 my sql-ha-deployment
20200613 my sql-ha-deployment20200613 my sql-ha-deployment
20200613 my sql-ha-deploymentIvan Ma
 
MySQL Document Store
MySQL Document StoreMySQL Document Store
MySQL Document StoreMario Beck
 
Tutorial MySQL com Java
Tutorial MySQL com JavaTutorial MySQL com Java
Tutorial MySQL com JavaMySQL Brasil
 
2012 ohiolinuxfest replication
2012 ohiolinuxfest replication2012 ohiolinuxfest replication
2012 ohiolinuxfest replicationsqlhjalp
 
MySQL Webinar 2/4 Performance tuning, hardware, optimisation
MySQL Webinar 2/4 Performance tuning, hardware, optimisationMySQL Webinar 2/4 Performance tuning, hardware, optimisation
MySQL Webinar 2/4 Performance tuning, hardware, optimisationMark Swarbrick
 

Similar to MySQL For Oracle Developers (20)

MySQL For Oracle DBA's and Developers
MySQL For Oracle DBA's and DevelopersMySQL For Oracle DBA's and Developers
MySQL For Oracle DBA's and Developers
 
Simple Way for MySQL to NoSQL
Simple Way for MySQL to NoSQLSimple Way for MySQL to NoSQL
Simple Way for MySQL to NoSQL
 
My sql crashcourse_2012
My sql crashcourse_2012My sql crashcourse_2012
My sql crashcourse_2012
 
Mysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesMysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New Features
 
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
 Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
 
My sql susecon_crashcourse_2012
My sql susecon_crashcourse_2012My sql susecon_crashcourse_2012
My sql susecon_crashcourse_2012
 
Sunshine php my sql 8.0 v2
Sunshine php my sql 8.0 v2Sunshine php my sql 8.0 v2
Sunshine php my sql 8.0 v2
 
MySQL Shell for DBAs
MySQL Shell for DBAsMySQL Shell for DBAs
MySQL Shell for DBAs
 
MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...
MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...
MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...
 
MySQL Community and Commercial Edition
MySQL Community and Commercial EditionMySQL Community and Commercial Edition
MySQL Community and Commercial Edition
 
Oracle MySQL Tutorial -- MySQL NoSQL Cloud Buenos Aires Nov, 13 2014
Oracle MySQL Tutorial -- MySQL NoSQL Cloud Buenos Aires Nov, 13 2014Oracle MySQL Tutorial -- MySQL NoSQL Cloud Buenos Aires Nov, 13 2014
Oracle MySQL Tutorial -- MySQL NoSQL Cloud Buenos Aires Nov, 13 2014
 
MySQL Latest News
MySQL Latest NewsMySQL Latest News
MySQL Latest News
 
2012 replication
2012 replication2012 replication
2012 replication
 
State of The Dolphin - May 2021
State of The Dolphin - May 2021State of The Dolphin - May 2021
State of The Dolphin - May 2021
 
Michael_Dickens
Michael_DickensMichael_Dickens
Michael_Dickens
 
20200613 my sql-ha-deployment
20200613 my sql-ha-deployment20200613 my sql-ha-deployment
20200613 my sql-ha-deployment
 
MySQL Document Store
MySQL Document StoreMySQL Document Store
MySQL Document Store
 
Tutorial MySQL com Java
Tutorial MySQL com JavaTutorial MySQL com Java
Tutorial MySQL com Java
 
2012 ohiolinuxfest replication
2012 ohiolinuxfest replication2012 ohiolinuxfest replication
2012 ohiolinuxfest replication
 
MySQL Webinar 2/4 Performance tuning, hardware, optimisation
MySQL Webinar 2/4 Performance tuning, hardware, optimisationMySQL Webinar 2/4 Performance tuning, hardware, optimisation
MySQL Webinar 2/4 Performance tuning, hardware, optimisation
 

More from Ronald Bradford

Successful Scalability Principles - Part 1
Successful Scalability Principles - Part 1Successful Scalability Principles - Part 1
Successful Scalability Principles - Part 1Ronald Bradford
 
MySQL Backup and Recovery Essentials
MySQL Backup and Recovery EssentialsMySQL Backup and Recovery Essentials
MySQL Backup and Recovery EssentialsRonald Bradford
 
The History and Future of the MySQL ecosystem
The History and Future of the MySQL ecosystemThe History and Future of the MySQL ecosystem
The History and Future of the MySQL ecosystemRonald Bradford
 
Lessons Learned Managing Large AWS Environments
Lessons Learned Managing Large AWS EnvironmentsLessons Learned Managing Large AWS Environments
Lessons Learned Managing Large AWS EnvironmentsRonald Bradford
 
Monitoring your technology stack with New Relic
Monitoring your technology stack with New RelicMonitoring your technology stack with New Relic
Monitoring your technology stack with New RelicRonald Bradford
 
MySQL Best Practices - OTN
MySQL Best Practices - OTNMySQL Best Practices - OTN
MySQL Best Practices - OTNRonald Bradford
 
MySQL Scalability Mistakes - OTN
MySQL Scalability Mistakes - OTNMySQL Scalability Mistakes - OTN
MySQL Scalability Mistakes - OTNRonald Bradford
 
My SQL Idiosyncrasies That Bite OTN
My SQL Idiosyncrasies That Bite OTNMy SQL Idiosyncrasies That Bite OTN
My SQL Idiosyncrasies That Bite OTNRonald Bradford
 
MySQL Best Practices - OTN LAD Tour
MySQL Best Practices - OTN LAD TourMySQL Best Practices - OTN LAD Tour
MySQL Best Practices - OTN LAD TourRonald Bradford
 
MySQL Idiosyncrasies That Bite SF
MySQL Idiosyncrasies That Bite SFMySQL Idiosyncrasies That Bite SF
MySQL Idiosyncrasies That Bite SFRonald Bradford
 
Successful MySQL Scalability
Successful MySQL ScalabilitySuccessful MySQL Scalability
Successful MySQL ScalabilityRonald Bradford
 
MySQL Idiosyncrasies That Bite 2010.07
MySQL Idiosyncrasies That Bite 2010.07MySQL Idiosyncrasies That Bite 2010.07
MySQL Idiosyncrasies That Bite 2010.07Ronald Bradford
 
Capturing, Analyzing and Optimizing MySQL
Capturing, Analyzing and Optimizing MySQLCapturing, Analyzing and Optimizing MySQL
Capturing, Analyzing and Optimizing MySQLRonald Bradford
 
MySQL Idiosyncrasies That Bite
MySQL Idiosyncrasies That BiteMySQL Idiosyncrasies That Bite
MySQL Idiosyncrasies That BiteRonald Bradford
 
10x Performance Improvements
10x Performance Improvements10x Performance Improvements
10x Performance ImprovementsRonald Bradford
 
LIFTOFF - MySQLCamp for the Oracle DBA
LIFTOFF - MySQLCamp for the Oracle DBALIFTOFF - MySQLCamp for the Oracle DBA
LIFTOFF - MySQLCamp for the Oracle DBARonald Bradford
 
IGNITION - MySQLCamp for the Oracle DBA
IGNITION - MySQLCamp for the Oracle DBAIGNITION - MySQLCamp for the Oracle DBA
IGNITION - MySQLCamp for the Oracle DBARonald Bradford
 
10x Performance Improvements - A Case Study
10x Performance Improvements - A Case Study10x Performance Improvements - A Case Study
10x Performance Improvements - A Case StudyRonald Bradford
 
Dolphins Now And Beyond - FOSDEM 2010
Dolphins Now And Beyond - FOSDEM 2010Dolphins Now And Beyond - FOSDEM 2010
Dolphins Now And Beyond - FOSDEM 2010Ronald Bradford
 
Drizzle - Status, Principles and Ecosystem
Drizzle - Status, Principles and EcosystemDrizzle - Status, Principles and Ecosystem
Drizzle - Status, Principles and EcosystemRonald Bradford
 

More from Ronald Bradford (20)

Successful Scalability Principles - Part 1
Successful Scalability Principles - Part 1Successful Scalability Principles - Part 1
Successful Scalability Principles - Part 1
 
MySQL Backup and Recovery Essentials
MySQL Backup and Recovery EssentialsMySQL Backup and Recovery Essentials
MySQL Backup and Recovery Essentials
 
The History and Future of the MySQL ecosystem
The History and Future of the MySQL ecosystemThe History and Future of the MySQL ecosystem
The History and Future of the MySQL ecosystem
 
Lessons Learned Managing Large AWS Environments
Lessons Learned Managing Large AWS EnvironmentsLessons Learned Managing Large AWS Environments
Lessons Learned Managing Large AWS Environments
 
Monitoring your technology stack with New Relic
Monitoring your technology stack with New RelicMonitoring your technology stack with New Relic
Monitoring your technology stack with New Relic
 
MySQL Best Practices - OTN
MySQL Best Practices - OTNMySQL Best Practices - OTN
MySQL Best Practices - OTN
 
MySQL Scalability Mistakes - OTN
MySQL Scalability Mistakes - OTNMySQL Scalability Mistakes - OTN
MySQL Scalability Mistakes - OTN
 
My SQL Idiosyncrasies That Bite OTN
My SQL Idiosyncrasies That Bite OTNMy SQL Idiosyncrasies That Bite OTN
My SQL Idiosyncrasies That Bite OTN
 
MySQL Best Practices - OTN LAD Tour
MySQL Best Practices - OTN LAD TourMySQL Best Practices - OTN LAD Tour
MySQL Best Practices - OTN LAD Tour
 
MySQL Idiosyncrasies That Bite SF
MySQL Idiosyncrasies That Bite SFMySQL Idiosyncrasies That Bite SF
MySQL Idiosyncrasies That Bite SF
 
Successful MySQL Scalability
Successful MySQL ScalabilitySuccessful MySQL Scalability
Successful MySQL Scalability
 
MySQL Idiosyncrasies That Bite 2010.07
MySQL Idiosyncrasies That Bite 2010.07MySQL Idiosyncrasies That Bite 2010.07
MySQL Idiosyncrasies That Bite 2010.07
 
Capturing, Analyzing and Optimizing MySQL
Capturing, Analyzing and Optimizing MySQLCapturing, Analyzing and Optimizing MySQL
Capturing, Analyzing and Optimizing MySQL
 
MySQL Idiosyncrasies That Bite
MySQL Idiosyncrasies That BiteMySQL Idiosyncrasies That Bite
MySQL Idiosyncrasies That Bite
 
10x Performance Improvements
10x Performance Improvements10x Performance Improvements
10x Performance Improvements
 
LIFTOFF - MySQLCamp for the Oracle DBA
LIFTOFF - MySQLCamp for the Oracle DBALIFTOFF - MySQLCamp for the Oracle DBA
LIFTOFF - MySQLCamp for the Oracle DBA
 
IGNITION - MySQLCamp for the Oracle DBA
IGNITION - MySQLCamp for the Oracle DBAIGNITION - MySQLCamp for the Oracle DBA
IGNITION - MySQLCamp for the Oracle DBA
 
10x Performance Improvements - A Case Study
10x Performance Improvements - A Case Study10x Performance Improvements - A Case Study
10x Performance Improvements - A Case Study
 
Dolphins Now And Beyond - FOSDEM 2010
Dolphins Now And Beyond - FOSDEM 2010Dolphins Now And Beyond - FOSDEM 2010
Dolphins Now And Beyond - FOSDEM 2010
 
Drizzle - Status, Principles and Ecosystem
Drizzle - Status, Principles and EcosystemDrizzle - Status, Principles and Ecosystem
Drizzle - Status, Principles and Ecosystem
 

Recently uploaded

COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 

Recently uploaded (20)

COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 

MySQL For Oracle Developers

  • 1. MySQL for Oracle Developers Ronald Bradford www.arabx.com.au Version 1.2 20 April 2006
  • 2. MySQL for Oracle Developers MySQL Introduction Solid peneration in open source community LAMP Stack Large number of open source projects Included by default in most Linux distros Slide: 2
  • 3. MySQL for Oracle Developers Purpose of Presentation Maximise existing Oracle skill set Preparation for management requests Open Source introduction Terminology/Product Knowledge Transfer Slide: 3
  • 4. MySQL for Oracle Developers My Background INFO 16 years in Database Design Experience (1989) 10 years Oracle Experience (1996) 7 years MySQL Experience (1999) Active in MySQL, Java, XP, Oracle User Groups  Slide: 4
  • 5. MySQL for Oracle Developers Presentation Conventions Associated Talk for DBA's MySQL for Oracle DBA's Oracle Specific Syntax Oracle Command/Syntax ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server MYSQL_HOME=/usr/lib/mysql (*)       MYSQL_DATA=/var/lib/mysql (*) (*) For RPM install. Will differ depending on Distro, or .tar.gz install Slide: 5
  • 6. MySQL for Oracle Developers Product Comparision Current Versions at March 2006 (used in examples) MySQL 5.0 GA  (5.0.20)  Standard/Max http://www.mysql.com/products/database/ Oracle 10g Release 2 Express Edition (10.2.0.1) http://www.oracle.com/technology/products/database/xe Slide: 6
  • 7. MySQL for Oracle Developers Product Comparision INFO Other Production Versions Oracle 10g Release 2 (PE, SE1, SE, EE) Oracle 9i, 8i, 7.3 MySQL 4.1, 4.0, 3.23 MySQL MaxDB 7.6 Slide: 7
  • 8. MySQL for Oracle Developers Product Comparision Development Versions MySQL 5.1  (currently beta 5.1.7) 5.1 MySQL 5.2 Open Source Availability OS Slide: 8
  • 9. MySQL for Oracle Developers Oracle Developer Environments INFO Oracle JDeveloper Java Application J2EE Application Development Framework (ADF) Application Express (HTMLDB) Oracle Forms 4.5, 6i, 9i,10g  PHP (Zend Core) Slide: 9
  • 10. MySQL for Oracle Developers Forrester Research December 29, 2004 Open Source Databases  Come Of Age Slide: 10
  • 11. MySQL for Oracle Developers Technical Resources MYSQL ORACLE otn.oracle.com dev.mysql.com    forge.mysql.com forums.oracle.com forums.mysql.com www.oracle.com/support www.mysql.com/network education.oracle.com www.mysql.com/training www.oracle.com/education/certification/ www.mysql.com/certification blogs.oracle.com www.planetmysql.org www.oracle.com/technology/community/user_groups dev.mysql.com/user­groups www.mysql.com/doc www.oracle.com/technology/documentation www.orafaq.com dev.mysql.com/tech­resources/faq.html Slide: 11
  • 12. MySQL for Oracle Developers MySQL 5.0 For Developers (5 days) INFO http://www.mysql.com/training/workshops/mysql_dev.html Objectives Describe the MySQL client/server architecture Understand the steps necessary to invoke MySQL client programs Utilize the general­purpose mysql client program to run queries and retrieve results Perform queries and analysis of data utilizing the MySQL Query Browser graphical user interface Explain the MySQL connectors that provide connectivity for client programs Select the best data type for representing information in MySQL Manage the structural characteristics of your databases Manage the structural characteristics of the tables within your databases Utilize the SELECT statement to retrieve information from database tables Slide: 12
  • 13. MySQL for Oracle Developers MySQL 5.0 For Developers INFO Utilize expressions in SQL statements to retrieve more detailed information Utilize SQL statements to modify the contents of database tables Write join expressions in your SQL statements to obtain information from multiple tables Utilize subqueries in your SQL statements Create views utilizing SELECT statements to produce quot;virtual tablesquot; of specific data Perform bulk data import and export operations Create user defined variables, prepared statements and stored routines Create and manage triggers Use the INFORMATION_SCHEMA database to access metadata Debug MySQL applications Configure and Optimize MySQL Slide: 13
  • 14. MySQL for Oracle Developers MySQL Installation INFO MySQL for Oracle DBA's Two Initial Databases mysql test http://dev.mysql.com/doc/refman/5.0/en/installing.html Access Privileges root http://dev.mysql.com/doc/refman/5.0/en/privilege_system.html Slide: 14
  • 15. MySQL for Oracle Developers Configuration/Log Files INFO MySQL for Oracle DBA's my.cnf $ORACLE_HOME/dbs/init.ora $MYSQL_HOME/my.cnf,  /etc/my.cnf Database Log .../admin/XE/bdump/alert_XE.log $MYSQL_DATA/`hostname`.err  N/A $ORACLE_HOME/network/admin/tnsnames.ora User Security (host) Slide: 15
  • 16. MySQL for Oracle Developers Terminology INFO MYSQL ORACLE Database (files) Database Server Instance Database Instance (memory) Database Server Instance Schema User Database User User Table Space Table Space Storage Engine Slide: 16
  • 17. MySQL for Oracle Developers MySQL Sample Database scott/tiger Sakila Sample Database Announced at this Conference Showcases Current MySQL features http://forums.mysql.com/list.php?121 Slide: 17
  • 18. MySQL for Oracle Developers MySQL Sample Database INFO Slide: 18
  • 19. MySQL for Oracle Developers Command Line SQL mysql sqlplus system/manager@netname http://dev.mysql.com/doc/refman/5.0/en/mysql.html  Command line syntax mysql ­u[username] ­p[password] ­h[host] [dbname] mysql ­p [dbname] mysql ­­help Navigation commands help or ?        clear   c quit  q           edit ;   g  G         tee [file] Slide: 19
  • 20. MySQL for Oracle Developers Immediate SQL Differences DUAL Date Functions SYSDATE Sequences    DECODE() Data Types ROWNUM Naming Standards NVL Case Sensitivity  JOIN (+) Syntax Reserved Words  Slide: 20
  • 21. MySQL for Oracle Developers Case Sensitivity DDL Structure Names as Case sensitive e.g.  CREATE TABLE FilmActor (...); Operating System Dependent LIKE for Data is Case insensitive e.g.  SELECT title FROM film WHERE title LIKE 'A%' Returns rows starting with 'ALIEN' and 'alien' BINARY  DDL syntax e.g.   title VARCHAR(100) NOT NULL BINARY, Slide: 21
  • 22. MySQL for Oracle Developers DLL Structure Syntax Escaped Reserved Words are allowed e.g.  CREATE TABLE `group` (...); e.g.  CREATE TABLE “insert” (...);     * sql_mode Tables/Columns/Triggers/Stored Procedures Space and other special characters allowed Operating System Dependent e.g.  CREATE TABLE `My Table Name` (...); Slide: 22
  • 23. MySQL for Oracle Developers Sequences Replacement AUTO_INCREMENT CREATE SEQUENCE seq; e.g.  id INT NOT NULL AUTO_INCREMENT, Must be tied to a [table].[column] Only one per table No system wide capability LAST_INSERT_ID() seq.CURRVAL No get next capability seq.NEXTVAL Slide: 23
  • 24. MySQL for Oracle Developers Optional Table Name DUAL SELECT 1+1 No Table Required Provided for Oracle Compatibility e.g. SELECT 1+1 FROM DUAL e.g. SELECT DUMMY FROM DUAL    *** Fails Slide: 24
  • 25. MySQL for Oracle Developers Transactions MySQL provides ACID compliant transactions XA transactions  (Distributed Transaction Processing) http://dev.mysql.com/doc/refman/5.0/en/xa.html Supports transactional and non­transactional databases Satisfy both mission­critical 24/7 usage and heavy Web or  logging usage  Slide: 25
  • 26. MySQL for Oracle Developers Transactions By default, SQL commands are auto­committed Transaction support with appropiate Storage Engines START TRANSACTION / BEGIN [WORK] ROLLBACK [WORK] / COMMIT [WORK] SET AUTOCOMMIT = {0 | 1}; SAVEPOINT / ROLLBACK [WORK] TO SAVEPOINT SET TRANSACTION  (Isolation Level) http://dev.mysql.com/doc/refman/5.0/en/transactional­commands.html  Slide: 26
  • 27. MySQL for Oracle Developers Storage Engines INFO MyISAM FEDERATED MERGE NDB (Cluster) InnoDB CSV BDB BLACKHOLE MEMORY Example ARCHIVE http://dev.mysql.com/doc/refman/5.0/en/storage­engines.html Slide: 27
  • 28. MySQL for Oracle Developers Storage Engines INFO High MySQL 5.0's Pluggable Storage Engine Architecture http://www.mysql.com/why­mysql/white­papers/mysql_wp_pluggable.php Slide: 28
  • 29. MySQL for Oracle Developers Locking Storage Engine Dependent Table Level Locking (MyISAM, Memory) Page Level Locking (BDB) Row Level Locking (InnoDB, Archive, NDB) LOW_PRIORITY, HIGH_PRIORITY  changes WRITE/READ Lock Handling Slide: 29
  • 30. MySQL for Oracle Developers Locking Most Commonly  InnoDB   Used Transactional  Storage Engine row­level locking multi­versioning  non­locking repeatable reads all four SQL standard isolation levels Slide: 30
  • 31. MySQL for Oracle Developers NULL [column] IS NULL, [column] IS NOT NULL IFNULL([value],'') NVL(), COALESCE() ISNULL([value]) COALESCE([value],[value],[value]) Slide: 31
  • 32. MySQL for Oracle Developers SELECT SELECT/FROM/WHERE/GROUP BY/HAVING LIMIT n[,m] ROWNUM LIKE ROWID REGEXP http://dev.mysql.com/doc/refman/5.0/en/select.html UNION, UNION ALL UNION, UNION ALL INTERSECT, MINUS http://dev.mysql.com/doc/refman/5.0/en/union.html Slide: 32
  • 33. MySQL for Oracle Developers JOIN INNER JOIN ON, NATURAL, USING PARTITION BY OUTER JOIN NO FULL OUTER JOIN http://dev.mysql.com/doc/refman/5.0/en/join.html join_table:   table_reference [INNER | CROSS] JOIN table_factor [join_condition]   table_reference STRAIGHT_JOIN table_factor   table_reference STRAIGHT_JOIN table_factor ON condition   table_reference LEFT [OUTER] JOIN table_reference join_condition   table_reference NATURAL [LEFT [OUTER]] JOIN table_factor   table_reference RIGHT [OUTER] JOIN table_reference join_condition   table_reference NATURAL [RIGHT [OUTER]] JOIN table_factor Slide: 33
  • 34. MySQL for Oracle Developers Sub Queries IN, NOT IN ALL, ANY, SOME WITH EXISTS, NOT EXISTS Correlated subqueries In FROM Clause Slide: 34
  • 35. MySQL for Oracle Developers Full Text Search FULLTEXT Index  ORACLE TEXT MyISAM Storage Engine Only  e.g. FULLTEXT KEY indx_title_description(title,description) SELECT f.film_id, f.title, f.description FROM film_text f WHERE MATCH (title,description) AGAINST ('MySQL'); SELECT f.film_id, f.title, f.description  FROM film_text f   WHERE MATCH (title,description) AGAINST ('+MySQL ­Monkey' IN BOOLEAN MODE); SELECT f.film_id, f.title, f.description  FROM film_text f   WHERE MATCH (title,description) AGAINST ('database' WITH QUERY EXPANSION); http://dev.mysql.com/doc/refman/5.0/en/fulltext­search.html Slide: 35
  • 36. MySQL for Oracle Developers INSERT INSERT INTO [table] SET [col]=[value], ... Multiple Row Insert INSERT ALL ... WHEN DEFAULT values DEFAULT  or  DEFAULT(col_name) AUTO_INCREMENT ­  NULL,0 or col not stated  http://dev.mysql.com/doc/refman/5.0/en/insert.html Slide: 36
  • 37. MySQL for Oracle Developers UPDATE ORDER BY/LIMIT e.g. UPDATE CacheTable SET expiry = NOW()                                       ORDER BY oldest LIMIT 10 Multiple Table Update UPDATE items,month SET items.price=month.price            WHERE items.id=month.id; http://dev.mysql.com/doc/refman/5.0/en/update.html Slide: 37
  • 38. MySQL for Oracle Developers DELETE ORDER BY/LIMIT e.g. DELETE FROM CacheTable ORDER BY oldest LIMIT 10; Multiple Table Delete DELETE t1, t2 FROM t1, t2, t3 WHERE t1.id=t2.id AND t2.id=t3.id; DELETE FROM t1, t2 USING t1, t2, t3 WHERE t1.id=t2.id AND  t2.id=t3.id; http://dev.mysql.com/doc/refman/5.0/en/delete.html Slide: 38
  • 39. MySQL for Oracle Developers REPLACE MERGE (very cumbersome) Combined Insert/Update REPLACE works exactly like INSERT, except that if  an old record in the table has the same value as a  new record on a unique index, the old record is  deleted before the new record is inserted. Affects Trigger Operation http://dev.mysql.com/doc/refman/5.0/en/replace.html Slide: 39
  • 40. MySQL for Oracle Developers DML Syntax Differences INFO LOW_PRIORITY  execution of the INSERT is delayed until no other clients are  reading from the table.  Not good on read­heavy environment INSERT, UPDATE, DELETE, REPLACE Bad Idea INSERT LOW_PRIORITY INTO LogTable VALUES (); Slide: 40
  • 41. MySQL for Oracle Developers DML Syntax Differences INFO HIGH_PRIORITY  gives the SELECT higher priority than a statement that updates Only for queries that are very fast and must be done at once SELECT, INSERT SELECT HIGH_PRIORITY FROM CacheTable;  Slide: 41
  • 42. MySQL for Oracle Developers DML Syntax Differences INFO DELAYED  the server puts the row or rows to be inserted into a buffer, and the  client issuing the INSERT DELAYED  statement can then continue  immediately. INSERT, REPLACE Statements Good Idea Non Critical Data INSERT DELAYED INTO LogTable VALUES (); http://dev.mysql.com/doc/refman/5.0/en/insert­delayed.html Slide: 42
  • 43. MySQL for Oracle Developers DML Syntax Differences INFO IGNORE errors that occur while executing the INSERT  statement are  treated as warnings instead INSERT, UPDATE, DELETE Statements Poor  Programming INSERT IGNORE INTO LogTable VALUES (); Practice Slide: 43
  • 44. MySQL for Oracle Developers Data Types Numeric TINYINT,SMALLINT,MEDIUMINT,INT,BIGINT FLOAT,DOUBLE,DECIMAL,BIT Date DATE,TIME,DATETIME,TIMESTAMP,YEAR http://dev.mysql.com/doc/refman/5.0/en/data­types.html http://dev.mysql.com/doc/refman/5.0/en/storage­requirements.html Slide: 44
  • 45. MySQL for Oracle Developers Data Types String CHAR,VARCHAR,BINARY,VARBINARY, TINYTEXT,MEDIUMTEXT,TEXT,LONGTEXT TINYBLOB,MEDIUMBLOB,BLOG,LONGBLOB ENUM,SET http://dev.mysql.com/doc/refman/5.0/en/data­types.html http://dev.mysql.com/doc/refman/5.0/en/storage­requirements.html Slide: 45
  • 46. MySQL for Oracle Developers Data Types Spatial GEOMETRY, POINT, LINESTRING, POLYGON, GEOMETRYCOLLECTION, MULTILINESTRING, MULTIPOINT, MULTIPOLYGON http://dev.mysql.com/doc/refman/5.0/en/spatial­extensions.html Slide: 46
  • 47. MySQL for Oracle Developers Numeric Data Types FLOAT, DOUBLE – floating point types e.g. lat FLOAT(10,6), lon FLOAT(10,6) Floating Point  NUMBER Fixed Point      NUMBER(p,s) DECIMAL – fixed point type Integer             NUMBER(p) e.g.  amt DECIMAL(10,2) NOT NULL, INT ­ Integer UNSIGNED, ZEROFILL e.g  cnt INT(6) UNSIGNED ZEROFILL, Slide: 47
  • 48. MySQL for Oracle Developers Date Data Types TIMESTAMP (faction precision) WITH [LOCAL] TIMEZONE TIMESTAMP First TIMESTAMP column defaults to last update date/time Good for behind the scenes auditing Second only granularity CREATE TABLE ...     last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP                                                            ON UPDATE CURRENT_TIMESTAMP,   created  TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,   ... Slide: 48
  • 49. MySQL for Oracle Developers Constraint Data Types ENUM size ENUM('S','M','L','XL','XXL') http://dev.mysql.com/doc/refman/5.0/en/enum.html SET color SET ('Red','Blue','Green','White','Black') http://dev.mysql.com/doc/refman/5.0/en/set.html http://dev.mysql.com/doc/refman/5.0/en/constraint­enum.html Slide: 49
  • 50. MySQL for Oracle Developers Large Objects (LOB) CLOB, BLOB,NCLOB, BFILE TINYBLOB, BLOB, MEDIUMBLOB, LONGBLOB TINYTEXT, TEXT, MEDIUMTEXT,  LONGTEXT 255 bytes, 64K, 16M, 4G http://dev.mysql.com/doc/refman/5.0/en/blob.html Slide: 50
  • 51. MySQL for Oracle Developers String Functions 'A' || 'B' CONCAT('A','B') SELECT CONCAT('A','B'); SELECT CONCAT_WS(',','a','b','c',d'); SET sql_mode='PIPES_AS_CONCAT'; SELECT 'A'||'B'; http://dev.mysql.com/doc/refman/5.0/en/string­functions.html Slide: 51
  • 52. MySQL for Oracle Developers String Functions Multiple Character Set Support SHOW CHARACTER SET; SELECT 'Test' = 'TEST'; SELECT _latin1 'Test' = 'TEST'; SELECT _latin1 'Test' = BINARY 'TEST'; Collation Defines String Comparisions Defines Sorting Order http://dev.mysql.com/doc/refman/5.0/en/charset.html Slide: 52
  • 53. MySQL for Oracle Developers Date Calendar INFO Julian Dates? http://www.orafaq.com/papers/dates_o.doc Proleptic Gregorian calendar October 4­15 1582 cutover Pre Julian Post Gregorian The “Year­Zero” rule The “Leap­Year Calculation” rule http://dev.mysql.com/doc/refman/5.0/en/mysql­calendar.html Slide: 53
  • 54. MySQL for Oracle Developers Date Functions SELECT CURDATE(), NOW(), SYSDATE() Second only granularity http://dev.mysql.com/doc/refman/5.0/en/date­and­time­functions.html TimeZones  ­ UTC or named e.g. SET time_zone = '+10:00';  'Europe/Helsinki', 'US/Eastern',  'MET',  'SYSTEM' Manual Installation step to seed data http://dev.mysql.com/doc/refman/5.0/en/time­zone­support.html Slide: 54
  • 55. MySQL for Oracle Developers Control Flow Functions IF DECODE()   CASE() SELECT IF(1>0,'yes','no');     ­> 'yes' CASE SELECT CASE WHEN 1>0 THEN 'yes' ELSE 'no' END; ­> 'true' SELECT CASE  'B' WHEN 'a' THEN 1 WHEN 'b' THEN 2 END; ­> 2 SELECT CASE BINARY 'B' WHEN 'a' THEN 1 WHEN 'b' THEN 2 END; ­> NULL http://dev.mysql.com/doc/refman/5.0/en/control­flow­functions.html Slide: 55
  • 56. MySQL for Oracle Developers System Variables INFO Server (e.g. /etc/my.cnf) sort_buffer_size=500000 GLOBAL  SET GLOBAL sort_buffer_size=750000; SESSION  SET SESSION sort_buffer_size=1000000; SELECT @@global.sort_buffer_size, @@session.sort_buffer_size; Slide: 56
  • 57. MySQL for Oracle Developers SHOW SHOW TABLES; SHOW WARNINGS; SHOW STATUS;  FLUSH STATUS; SHOW VARIABLES; SHOW VARIABLES LIKE '%size%'; SHOW VARIABLES LIKE 'sort_buffer_size'; SHOW GLOBAL VARIABLES LIKE 'sort_buffer_size'; Slide: 57
  • 58. MySQL for Oracle Developers SQL Mode Key Modes ANSI  STRICT_TRANS_TABLES  TRADITIONAL SHOW VARIABLES LIKE 'sql_mode'; SET sql_mode='strict_all_tables'; Slide: 58
  • 59. MySQL for Oracle Developers SQL Mode Oracle Compatibility SET sql_mode='PIPES_AS_CONCAT,ANSI_QUOTES,  IGNORE_SPACE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,  NO_FIELD_OPTIONS, NO_AUTO_CREATE_USER'; http://dev.mysql.com/doc/refman/5.0/en/server­sql­mode.html http://dev.mysql.com/tech­resources/articles/mysql­data­integrity.html Slide: 59
  • 60. MySQL for Oracle Developers Procedural Language Support Stored Procedures Functions UDF  ­ User Defined Functions Triggers Slide: 60
  • 61. MySQL for Oracle Developers Procedures No Package Capabilites http://bugs.mysql.com/bug.php?id=11696 OS NO RAISE Error Capability No Named Parameters No Overloading http://dev.mysql.com/doc/refman/5.0/en/stored­procedures.html General Purpose Stored Routines Library  http://www.nongnu.org/mysql­sr­lib/  Slide: 61
  • 62. MySQL for Oracle Developers Procedures INFO DELIMITER // CREATE PROCEDURE rewards_report (     IN min_monthly_purchases TINYINT UNSIGNED     , IN min_dollar_amount_purchased DECIMAL(10,2) UNSIGNED     , OUT count_rewardees INT ) LANGUAGE SQL NOT DETERMINISTIC READS SQL DATA SQL SECURITY DEFINER COMMENT 'Provides a customizable report on best customers' proc: BEGIN     DECLARE last_month_start DATE;     DECLARE last_month_end DATE;     /* Some sanity checks... */     IF min_monthly_purchases = 0 THEN         SELECT 'Minimum monthly purchases parameter must be > 0';         LEAVE proc;     END IF;     SET last_month_start = DATE_SUB(CURRENT_DATE(), INTERVAL 1 MONTH);     CREATE TEMPORARY TABLE tmpCustomer (customer_id SMALLINT UNSIGNED NOT NULL PRIMARY KEY);    ...     SELECT COUNT(*) FROM tmpCustomer INTO count_rewardees;     DROP TABLE tmpCustomer; END // Slide: 62
  • 63. MySQL for Oracle Developers Functions Example – Wrap IFNULL with NVL for Oracle Compatibility DELIMITER // CREATE FUNCTION NVL(IN col VARCHAR(100), IN nullvalue VARCHAR(100))                                              RETURNS VARCHAR(100) BEGIN   RETURN IFNULL(col,nullvalue); END; // DELIMITER ; SELECT NVL(col,'Unknown') FROM table Slide: 63
  • 64. MySQL for Oracle Developers Functions SHOW CREATE FUNCTION 'NVL'; SHOW FUNCTION STATUS LIKE 'NVL'; SELECT routine_name, routine_schema, routine_type  FROM INFORMATION_SHEMA.routines; Slide: 64
  • 65. MySQL for Oracle Developers User Defined Functions (UDF) INFO Added as Object Files $ gcc ­I /usr/include/mysql/ ­shared ­o syslogudf.so syslogudf.c $ cp syslogudf.so /usr/lib mysql> create function logger returns integer soname 'syslogudf.so'; mysql> select logger('logging from ' + version()); $ tail /var/log/messages http://dev.mysql.com/doc/refman/5.0/en/adding­functions.html Slide: 65
  • 66. MySQL for Oracle Developers User Defined Functions (UDF) INFO #include <mysql.h> #include <string.h> #include <syslog.h> my_bool logger_init(UDF_INIT *initid, UDF_ARGS *args, char *message) {         initid­>maybe_null=0;         return 0; } long long logger(UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error) {         if (args­>arg_count != 1) {                 strcpy(error, quot;LOGGER(): needs messagequot;);                 return 1;         }         if (args­>arg_type[0] != STRING_RESULT) {                 strcpy(error, quot;LOGGER() message should be stringquot;);                 return 1;         }         syslog(LOG_INFO,quot;%squot;,args­>args[0]);         *is_null = 0;         *error = 0;         return 0; http://dammit.lt/stream/mysql/ } Slide: 66
  • 67. MySQL for Oracle Developers User Defined Functions (UDF) INFO MySQL Message API Utilises Spread Toolkit  www.spread.org http://forge.mysql.com/projects/view.php?id=2 Slide: 67
  • 68. MySQL for Oracle Developers Triggers [BEFORE|AFTER] [INSERT|UPDATE|DELETE] Only one trigger per table per DML statement Missing INSTEAD OF (used in Views) No OR DML (e.g. INSERT OR UPDATE) No OR REPLACE  (e.g. CREATE OR REPLACE No WHEN Condition Only for DML statements (e.g. No DROP) http://dev.mysql.com/doc/refman/5.0/en/triggers.html Slide: 68
  • 69. MySQL for Oracle Developers Triggers INFO DELIMITER ;; CREATE TRIGGER `ins_film` AFTER INSERT ON `film` FOR EACH ROW BEGIN     INSERT INTO film_text (film_id, title, description)         VALUES (new.film_id, new.title, new.description);   END;; CREATE TRIGGER `upd_film` AFTER UPDATE ON `film` FOR EACH ROW BEGIN     IF (old.title != new.title) or (old.description != new.description)     THEN         UPDATE film_text             SET title=new.title,                 description=new.description,                 film_id=new.film_id         WHERE film_id=old.film_id;     END IF;   END;; CREATE TRIGGER `del_film` AFTER DELETE ON `film` FOR EACH ROW BEGIN     DELETE FROM film_text WHERE film_id = old.film_id; END;; DELIMITER ; Slide: 69
  • 70. MySQL for Oracle Developers Query Performance Analysis INFO EXPLAIN [EXTENDED] SELECT select_options EXPLAIN PLAN FOR [statement] SELECT only PLAN_TABLE [SELECT] PROCEDURE ANALYSE(); http://dev.mysql.com/doc/refman/5.0/en/explain.html Slide: 70
  • 71. MySQL for Oracle Developers Query Performance Analysis INFO The Slow Query Log long_query_time=5  (my.cnf) mysqld ­­log­slow­queries=[filename]  ­­log­queries­not­using­indexes  ­­log­slow­admin­statements http://dev.mysql.com/doc/refman/5.0/en/slow­query­log.html  Slide: 71
  • 72. MySQL for Oracle Developers MySQL Commands INFO mysql myisamchk mysqld myisamlog mysqladmin myisampack mysqlmanager mysqlbinlog mysqlcheck perror mysqldump mysqlupgrade mysqlimport mysqlslap 5.1 mysqlcheck http://dev.mysql.com/doc/refman/5.0/en/client­utility­programs.html Slide: 72
  • 73. MySQL for Oracle Developers INFORMATION_SCHEMA Oracle Data Dictionary Smaller set of tables TABLES, COLUMNS, VIEWS, ROUTINES,  USER_PREVILEGES Dynamic Performance Views (V$) PROCESSLIST  5.1 http://dev.mysql.com/doc/refman/5.0/en/information­schema.html http://www.xcdsql.org/MySQL/information_schema/5.1/MySQL_5_1_INFORMATION_SCHEMA.html Slide: 73
  • 74. MySQL for Oracle Developers Slide: 74
  • 75. MySQL for Oracle Developers INFORMATION_SCHEMA INFO Examples SELECT TABLE_SCHEMA, SUM((DATA_LENGTH + INDEX_LENGTH) / (1024 * 1024)) AS  SIZE_MB  FROM INFORMATION_SCHEMA.TABLES GROUP BY TABLE_SCHEMA ORDER BY SIZE_MB DESC SELECT ROUTINE_TYPE, ROUTINE_NAME FROM INFORMATION_SCHEMA.ROUTINES  WHERE ROUTINE_SCHEMA='dbname'; SELECT TRIGGER_NAME,EVENT_MANIPULATION,EVENT_OBJECT_TABLE,  ACTION_STATEMENT FROM INFORMATION_SCHEMA.TRIGGERS WHERE  TRIGGER_SCHEMA='dbname'; SELECT CONCAT('DROP TABLE ',table_name,';') INTO OUTFILE '/sql/drop_tables.sql' FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test'; Slide: 75
  • 76. MySQL for Oracle Developers INFORMATION_SCHEMA INFO Examples SELECT s.schema_name, CONCAT(IFNULL(ROUND((SUM(t.data_length)+            SUM(t.index_length))/1024/1024,2),0.00),'Mb') total_size,   CONCAT(IFNULL(ROUND(((SUM(t.data_length)+SUM(t.index_length))­ SUM(t.data_free))/1024/1024,2),0.00),'Mb') data_used, CONCAT(IFNULL(ROUND(SUM(data_free)/1024/1024,2),0.00),'Mb') data_free, IFNULL(ROUND((((SUM(t.data_length)+SUM(t.index_length))­    SUM(t.data_free))/((SUM(t.data_length)+SUM(t.index_length)))*100),2),0) pct_used,        COUNT(table_name) total_tables FROM information_schema.schemata s LEFT JOIN information_schema.tables t ON s.schema_name = t.table_schema WHERE s.schema_name != 'information_schema' GROUP BY s.schema_name  ORDER BY pct_used DESCG Slide: 76
  • 77. MySQL for Oracle Developers Helpful SQL Additions LOAD DATA INFILE SELECT INTO OUTFILE DROP [object] IF EXISTS [name]  DROP TABLE IF EXISTS TableName; Slide: 77
  • 78. MySQL for Oracle Developers MySQL 5.1 Major Features 5.1 Partitioning Log Tables Row Based Replication Events Federated Tables Cluster Replication Slide: 78
  • 79. MySQL for Oracle Developers End User Tools MySQL Query Browser MySQL Administrator MySQL Workbench 3  Party Products rd Slide: 79
  • 80. MySQL for Oracle Developers MySQL Query Browser SQL Developer / TOAD Query Toolbar Easily Create, Edit, and Debug SQL Statements Script Editor Object Browser Database Explorer Table Editor Visually Create and Modify Tables http://www.mysql.com/products/tools/query­browser/ Slide: 80
  • 81. MySQL for Oracle Developers MySQL Administrator User Administration OEM,  APEX Single View Dynamic Health Monitoring Quickly Optimize MySQL Rapid Disaster Prevention and Recovery Server Information At­a­Glance View Replication Status View Server Logs  http://www.mysql.com/products/tools/administrator/ Slide: 81
  • 82. MySQL for Oracle Developers MySQL Workbench Reverse Engineer Database Oracle Designer Database/Model synchronization Concept/Logical/Physical Designs DBDesigner4 import/export model Extending Figure Stylesheets Scripts Plugins http://forge.mysql.com/wiki/index.php/MySQL_Workbench Slide: 82
  • 83. MySQL for Oracle Developers rd 3 Party Tools PhpMyAdmin http://www.phpmyadmin.net Toad for MySQL http://www.toadsoft.com/toadmysql/ Slide: 83
  • 84. MySQL for Oracle Developers Other MySQL Products INFO MySQL Connectors ODBC, JDBC, ADO.NET, MPX MySQL Migration Toolkit MySQL Network – Commercial Support Eventum Slide: 84
  • 85. MySQL for Oracle Developers What's Missing Object Structure CREATE TYPE [obj] AS OBJECT Table Snapshots Materialized Views Check Constraints CREATE VIEW ... WITH CHECK OPTION; Flashback queries Synonyms Slide: 85
  • 86. MySQL for Oracle Developers What's Missing    COLUMN name FORMAT a40    SET LINESIZE 100 SQL reports    SPOOL [file] No Memory Pinning capabilities No wrapping capability (protect source) No Java procedural language support Slide: 86
  • 87. MySQL for Oracle Developers What we covered? SQL SQL*Plus PL/SQL Tools Suite Open Source Opportunity Documentation References Slide: 87
  • 88. MySQL for Oracle Developers For access to this paper, more detailed notes     and other information, please visit. http://www.arabx.com.au Slide: 88
  • 89. MySQL for Oracle Developers References INFO http://www.mysql.com   ­  MySQL Web Site http://dev.mysql.com   ­  MySQL Developer Zone http://forums.mysql.com   ­  MySQL Forums http://www.mysql.com/training/certification/   ­ MySQL Certification http://www.planetmysql.org  ­  MySQL Blogs www.mysqldevelopment.com ­ MySQL resources/tutorials Slide: 89
  • 90. MySQL for Oracle Developers References INFO Storage Engines http://dev.mysql.com/tech­resources/articles/mysql_5.0_psea1.html http://dev.mysql.com/tech­resources/articles/mysql_5.0_psea2.html http://dev.mysql.com/tech­resources/articles/creating­new­storage­engine.html http://www.mysql.com/why­mysql/white­papers/mysql_wp_pluggable.php Stored Procedures http://www.nongnu.org/mysql­sr­lib/ ­ General Purpose Stored Routines Library http://dev.mysql.com/tech­resources/articles/mysql­storedprocedures.html Slide: 90
  • 91. MySQL for Oracle Developers References INFO Recommended Reading MySQL by Paul DuBois Slide: 91