SlideShare uma empresa Scribd logo
1 de 91
Baixar para ler 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

Mais conteúdo relacionado

Mais procurados

Blue Medora Oracle Enterprise Manager (EM12c) Plug-in for PostgreSQL
Blue Medora Oracle Enterprise Manager (EM12c) Plug-in for PostgreSQLBlue Medora Oracle Enterprise Manager (EM12c) Plug-in for PostgreSQL
Blue Medora Oracle Enterprise Manager (EM12c) Plug-in for PostgreSQLBlue Medora
 
ProxySQL Cluster - Percona Live 2022
ProxySQL Cluster - Percona Live 2022ProxySQL Cluster - Percona Live 2022
ProxySQL Cluster - Percona Live 2022René Cannaò
 
Introduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterIntroduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterFrederic Descamps
 
Percona Toolkit for Effective MySQL Administration
Percona Toolkit for Effective MySQL AdministrationPercona Toolkit for Effective MySQL Administration
Percona Toolkit for Effective MySQL AdministrationMydbops
 
Best Practice for Achieving High Availability in MariaDB
Best Practice for Achieving High Availability in MariaDBBest Practice for Achieving High Availability in MariaDB
Best Practice for Achieving High Availability in MariaDBMariaDB plc
 
Percona Live 2022 - MySQL Architectures
Percona Live 2022 - MySQL ArchitecturesPercona Live 2022 - MySQL Architectures
Percona Live 2022 - MySQL ArchitecturesFrederic Descamps
 
InnoDB Performance Optimisation
InnoDB Performance OptimisationInnoDB Performance Optimisation
InnoDB Performance OptimisationMydbops
 
MariaDB Server Performance Tuning & Optimization
MariaDB Server Performance Tuning & OptimizationMariaDB Server Performance Tuning & Optimization
MariaDB Server Performance Tuning & OptimizationMariaDB plc
 
Using all of the high availability options in MariaDB
Using all of the high availability options in MariaDBUsing all of the high availability options in MariaDB
Using all of the high availability options in MariaDBMariaDB plc
 
MySQL InnoDB Cluster and NDB Cluster
MySQL InnoDB Cluster and NDB ClusterMySQL InnoDB Cluster and NDB Cluster
MySQL InnoDB Cluster and NDB ClusterMario Beck
 
Docker Networking Overview
Docker Networking OverviewDocker Networking Overview
Docker Networking OverviewSreenivas Makam
 
Running MariaDB in multiple data centers
Running MariaDB in multiple data centersRunning MariaDB in multiple data centers
Running MariaDB in multiple data centersMariaDB plc
 
MariaDB 10.11 key features overview for DBAs
MariaDB 10.11 key features overview for DBAsMariaDB 10.11 key features overview for DBAs
MariaDB 10.11 key features overview for DBAsFederico Razzoli
 
Docker Compose Setup for MySQL InnoDB Cluster
Docker Compose Setup for MySQL InnoDB ClusterDocker Compose Setup for MySQL InnoDB Cluster
Docker Compose Setup for MySQL InnoDB ClusterBalasubramanian Kandasamy
 
High Availability in MySQL 8 using InnoDB Cluster
High Availability in MySQL 8 using InnoDB ClusterHigh Availability in MySQL 8 using InnoDB Cluster
High Availability in MySQL 8 using InnoDB ClusterSven Sandberg
 
MariaDB High Availability
MariaDB High AvailabilityMariaDB High Availability
MariaDB High AvailabilityMariaDB plc
 
Oracle RAC 12c Practical Performance Management and Tuning OOW13 [CON8825]
Oracle RAC 12c Practical Performance Management and Tuning OOW13 [CON8825]Oracle RAC 12c Practical Performance Management and Tuning OOW13 [CON8825]
Oracle RAC 12c Practical Performance Management and Tuning OOW13 [CON8825]Markus Michalewicz
 
MySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdf
MySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdfMySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdf
MySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdfAlkin Tezuysal
 

Mais procurados (20)

Blue Medora Oracle Enterprise Manager (EM12c) Plug-in for PostgreSQL
Blue Medora Oracle Enterprise Manager (EM12c) Plug-in for PostgreSQLBlue Medora Oracle Enterprise Manager (EM12c) Plug-in for PostgreSQL
Blue Medora Oracle Enterprise Manager (EM12c) Plug-in for PostgreSQL
 
ProxySQL Cluster - Percona Live 2022
ProxySQL Cluster - Percona Live 2022ProxySQL Cluster - Percona Live 2022
ProxySQL Cluster - Percona Live 2022
 
Introduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterIntroduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB Cluster
 
Percona Toolkit for Effective MySQL Administration
Percona Toolkit for Effective MySQL AdministrationPercona Toolkit for Effective MySQL Administration
Percona Toolkit for Effective MySQL Administration
 
Best Practice for Achieving High Availability in MariaDB
Best Practice for Achieving High Availability in MariaDBBest Practice for Achieving High Availability in MariaDB
Best Practice for Achieving High Availability in MariaDB
 
Percona Live 2022 - MySQL Architectures
Percona Live 2022 - MySQL ArchitecturesPercona Live 2022 - MySQL Architectures
Percona Live 2022 - MySQL Architectures
 
InnoDB Performance Optimisation
InnoDB Performance OptimisationInnoDB Performance Optimisation
InnoDB Performance Optimisation
 
MariaDB Server Performance Tuning & Optimization
MariaDB Server Performance Tuning & OptimizationMariaDB Server Performance Tuning & Optimization
MariaDB Server Performance Tuning & Optimization
 
Using all of the high availability options in MariaDB
Using all of the high availability options in MariaDBUsing all of the high availability options in MariaDB
Using all of the high availability options in MariaDB
 
MySQL InnoDB Cluster and NDB Cluster
MySQL InnoDB Cluster and NDB ClusterMySQL InnoDB Cluster and NDB Cluster
MySQL InnoDB Cluster and NDB Cluster
 
Docker Networking Overview
Docker Networking OverviewDocker Networking Overview
Docker Networking Overview
 
Running MariaDB in multiple data centers
Running MariaDB in multiple data centersRunning MariaDB in multiple data centers
Running MariaDB in multiple data centers
 
MariaDB 10.11 key features overview for DBAs
MariaDB 10.11 key features overview for DBAsMariaDB 10.11 key features overview for DBAs
MariaDB 10.11 key features overview for DBAs
 
Docker Compose Setup for MySQL InnoDB Cluster
Docker Compose Setup for MySQL InnoDB ClusterDocker Compose Setup for MySQL InnoDB Cluster
Docker Compose Setup for MySQL InnoDB Cluster
 
InnoDb Vs NDB Cluster
InnoDb Vs NDB ClusterInnoDb Vs NDB Cluster
InnoDb Vs NDB Cluster
 
High Availability in MySQL 8 using InnoDB Cluster
High Availability in MySQL 8 using InnoDB ClusterHigh Availability in MySQL 8 using InnoDB Cluster
High Availability in MySQL 8 using InnoDB Cluster
 
MariaDB High Availability
MariaDB High AvailabilityMariaDB High Availability
MariaDB High Availability
 
Curso de MySQL 5.7
Curso de MySQL 5.7Curso de MySQL 5.7
Curso de MySQL 5.7
 
Oracle RAC 12c Practical Performance Management and Tuning OOW13 [CON8825]
Oracle RAC 12c Practical Performance Management and Tuning OOW13 [CON8825]Oracle RAC 12c Practical Performance Management and Tuning OOW13 [CON8825]
Oracle RAC 12c Practical Performance Management and Tuning OOW13 [CON8825]
 
MySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdf
MySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdfMySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdf
MySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdf
 

Destaque

Advanced SQL Injection
Advanced SQL InjectionAdvanced SQL Injection
Advanced SQL Injectionamiable_indian
 
MySQL Atchitecture and Concepts
MySQL Atchitecture and ConceptsMySQL Atchitecture and Concepts
MySQL Atchitecture and ConceptsTuyen Vuong
 
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
 

Destaque (9)

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
 
MySQL Atchitecture and Concepts
MySQL Atchitecture and ConceptsMySQL Atchitecture and Concepts
MySQL Atchitecture and Concepts
 
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
 

Semelhante a 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
 

Semelhante a 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
 

Mais de 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
 

Mais de 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
 

Último

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 

Último (20)

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 

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