SlideShare une entreprise Scribd logo
1  sur  65
Télécharger pour lire hors ligne
MySQL for Oracle
DBAs and Developers
MySQL for Oracle Dudes



How can you tell an
   Oracle DBA
 has touched your
MySQL Installation?



        Ronald Bradford, MySQL Inc
       MySQL Conference & Expo 2007     Page: 2
MySQL for Oracle Dudes




MYSQL_HOME=/home/oracle/products/mysql-version


          mysqld_safe –user=oracle &




                     Ronald Bradford, MySQL Inc
                    MySQL Conference & Expo 2007     Page: 3
MySQL for Oracle Dudes

                       Outline

    DBA Tips, Tricks, Gotcha's & Tools

    Key Differences for Developers

    Migrating from Oracle to MySQL

    Questions & Answers





                           Ronald Bradford, MySQL Inc
                          MySQL Conference & Expo 2007     Page: 4
MySQL for Oracle Dudes

                 My Background

    18 years in Database Technologies (1989)

    10 years Oracle Experience (1996)

    8 years MySQL Experience (1999)

    Active in MySQL, Java, XP User Groups

    Joined MySQL Professional Services (2006)





                          Ronald Bradford, MySQL Inc
                         MySQL Conference & Expo 2007     Page: 5
MySQL for Oracle Dudes




DBA


 Ronald Bradford, MySQL Inc
MySQL Conference & Expo 2007     Page: 6
MySQL for Oracle Dudes

                   Important DBA Stuff

    Terminology                        MySQL Data Dictionary
                               
    Installation                       Backup
                               
    Directories                        Tools
                               
    Log Files                          Inherited LAMP Stack
                               
    Processes

    Ports & Sockets



                          Ronald Bradford, MySQL Inc
                         MySQL Conference & Expo 2007          Page: 7
MySQL for Oracle Dudes

                        Terminology


Database (files)              -->     Database Server Instance
Database Instance (memory)    -->     Database Server Instance
Schema User                   -->     Database
User                          -->     User
Table Space                   -->     Table Space
                              -->     Storage Engine



                              Ronald Bradford, MySQL Inc
                             MySQL Conference & Expo 2007        Page: 8
MySQL for Oracle Dudes

                     MySQL Installation

      OS packages place files in many areas and varies

                                                                 Tip
    - e.g. /usr/lib, /var/lib, /var/log, /etc
      Recommend installing using .tar.gz

    - Centrally Manageable e.g. /opt/mysql-version
    - Upgradeable
    - Multiple Versions possible
      $MYSQL_HOME


                                   Ronald Bradford, MySQL Inc
                                  MySQL Conference & Expo 2007         Page: 9
MySQL for Oracle Dudes

                MySQL Configuration
                                                               GOTCHA
     Multiple MySQL Instances

     my.cnf

    - Watch out for /etc/my.cnf, /etc/mysql/my.cnf
    - Best Practice $MYSQL_HOME/my.cnf
    - --defaults-file=<file>


                    http://dev.mysql.com/doc/refman/5.1/en/option-files.html

                                 Ronald Bradford, MySQL Inc
                                MySQL Conference & Expo 2007               Page: 10
MySQL for Oracle Dudes

                    MySQL Directories
                                                                my.cnf options
     basedir
               ($MYSQL_HOME)
      - e.g. /opt/mysql-5.1.16-beta-linux-i686-glib23

     datadir
                (defaults to $MYSQL_HOME/data)

     tmpdir
               (important as mysql behaves unpredictability if full)

     innodb_[...]_home_dir


    - mysql> SHOW GLOBAL VARIABLES LIKE '%dir'


                                  Ronald Bradford, MySQL Inc
                                 MySQL Conference & Expo 2007                    Page: 11
MySQL for Oracle Dudes

               MySQL Ports & Sockets

     Configured to listen on TCP/IP Port (default 3306)

     Additional Instances

    - Different Ports
    - Different IP's using default Port
     Local connection uses Socket

    - Even specifying Port, local client may use socket



                                Ronald Bradford, MySQL Inc
                               MySQL Conference & Expo 2007     Page: 12
MySQL for Oracle Dudes

                   MySQL Log Files
                                                             my.cnf options
                                                              mysqld arg
    Error Log

    - log-error
    Binary Log

    - log-bin     (my.cnf or mysqld arg)
    Slow Query Log

    - log-slow-queries,slow-query-time,log-queries-not-using-indexes
    General Log

    - log
                  http://dev.mysql.com/doc/refman/5.0/en/log-files.html

                               Ronald Bradford, MySQL Inc
                              MySQL Conference & Expo 2007                    Page: 13
MySQL for Oracle Dudes

                    MySQL Meta Data
                                                                New Feature
     mysql Database

    - general_log, slow_log (5.1)
        mysql> SET GLOBAL GENERAL_LOG=1;
        mysql> ...
        mysql> SELECT * FROM mysql.general_log;


                  http://dev.mysql.com/doc/refman/5.1/en/log-tables.html




                                  Ronald Bradford, MySQL Inc
                                 MySQL Conference & Expo 2007             Page: 14
MySQL for Oracle Dudes

                 MySQL Data Dictionary
                                                        [DBA|USER|ALL]_ tables, V$
     INFORMATION_SCHEMA

    - TABLES, COLUMNS, VIEWS, USER_PRIVILEGES
    - PROCESSLIST (5.1)
    - [GLOBAL|SESSION]_[STATUS|VARIABLES] (5.1)


                    http://dev.mysql.com/doc/refman/5.1/en/information-schema.html
http://www.xcdsql.org/MySQL/information_schema/5.1/MySQL_5_1_INFORMATION_SCHEMA.html


                                      Ronald Bradford, MySQL Inc
                                     MySQL Conference & Expo 2007                    Page: 15
MySQL for Oracle Dudes




 Ronald Bradford, MySQL Inc
MySQL Conference & Expo 2007     Page: 16
MySQL for Oracle Dudes

                 MySQL Data Dictionary

     SQL 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';



                                     Ronald Bradford, MySQL Inc
                                    MySQL Conference & Expo 2007               Page: 17
MySQL for Oracle Dudes

                   MySQL Data Dictionary

     SQL 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




                                         Ronald Bradford, MySQL Inc
                                        MySQL Conference & Expo 2007                     Page: 18
MySQL for Oracle Dudes

              SHOW Commands
    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';



                        Ronald Bradford, MySQL Inc
                       MySQL Conference & Expo 2007     Page: 19
MySQL for Oracle Dudes

                               Backup

        Missing Functionality

        Commercial strength – unbreakable (Planned 6.0)
    




        Storage Engine Driven

        Innodb

                                                                 Also PBXT, Falcon
    - Hot Backup
      - mysqldump --single-transaction --master-data
        - InnoDB Hot Backup

                                   Ronald Bradford, MySQL Inc
                                  MySQL Conference & Expo 2007                       Page: 20
MySQL for Oracle Dudes

                          Backup

     MyISAM Only

    - Cold Backup via File Copy
    - LVM Snapshot
     SE Mixture

    - Use Replication Slave




                               Ronald Bradford, MySQL Inc
                              MySQL Conference & Expo 2007     Page: 21
MySQL for Oracle Dudes

            Online Backup/Recovery
                                                                  MySQL 6.0 Demo

    Cross-engine. All major internal engines supported.

    Online, non-blocking for DML. DDL still blocked.

    SQL-command driven. Run from any mysql client.

    Backup to local disk, tape or remote file system.

    Full Server, database, and point-in-time recovery.



                     Backup ALL…




                                    Ronald Bradford, MySQL Inc
                                   MySQL Conference & Expo 2007                Page: 22
MySQL for Oracle Dudes

                                 Tools

        Missing Functionality

    -    Enterprise Level Monitoring

        SHOW PROFILE (5.0.38 - Community)

        Microsecond Patch
                               (5.0.33 - Slow query granularity)

        mytop/innotop/ndbtop

        MySQL Toolkit
                          http://sourceforge.net/projects/mysqltoolkit

        phpMyAdmin


                                    Ronald Bradford, MySQL Inc
                                   MySQL Conference & Expo 2007           Page: 23
MySQL for Oracle Dudes

                             SHOW PROFILE
       mysql> show profile SOURCE,MEMORY for query 4;
       +--------------------+------------+-----------------------+---------------+-------------+
       | Status             | Duration   | Source_function       | Source_file   | Source_line |
       +--------------------+------------+-----------------------+---------------+-------------+
       | Opening tables     | 0.00013200 | open_tables           | sql_base.cc   |        2106 |
       | System lock        | 0.00001800 | mysql_lock_tables     | lock.cc       |         153 |
       | Table lock         | 0.00000600 | mysql_lock_tables     | lock.cc       |         162 |
       | init               | 0.00001300 | mysql_select          | sql_select.cc |        2073 |
       | optimizing         | 0.00004800 | optimize              | sql_select.cc |         617 |
       | statistics         | 0.00002500 | optimize              | sql_select.cc |         773 |
       | preparing          | 0.00005200 | optimize              | sql_select.cc |         783 |
       | executing          | 0.00002200 | exec                  | sql_select.cc |        1407 |
       | Sending data       | 0.00000500 | exec                  | sql_select.cc |        1925 |
       | end                | 0.00786600 | mysql_select          | sql_select.cc |        2118 |
       | query end          | 0.00001400 | mysql_execute_command | sql_parse.cc |         5085 |
       | freeing items      | 0.00000700 | mysql_parse           | sql_parse.cc |         5973 |
       | closing tables     | 0.00001900 | dispatch_command      | sql_parse.cc |         2120 |
       | logging slow query | 0.00001000 | log_slow_statement    | sql_parse.cc |         2178 |
       | cleaning up        | 0.00000500 | dispatch_command      | sql_parse.cc |         2143 |
       +--------------------+------------+-----------------------+---------------+-------------+
       15 rows in set (0.01 sec)


    95% time in one step

    Reference to Source Code

    “poor” Status names (internal code)

                                                  Ronald Bradford, MySQL Inc
                                                MySQL Conference & Expo 2007                       Page: 24
MySQL for Oracle Dudes

                      GUI Tools

    MySQL Administrator

    Quest Spotlight

    Toad

                                                          MySQL
                                                         Enterprise

    MySQL Network Monitoring & Network Services





                           Ronald Bradford, MySQL Inc
                          MySQL Conference & Expo 2007                Page: 25
MySQL for Oracle Dudes

                          Tools
                                                          TIP
    mysqladmin -r -i 1 extended-status

    - Gives change in status variables per second
    - Lacks timestamp
    Monitor specifics

      -   Com_*
      -   Innodb_*, Innodb_buffer_pool_*
      -   Connections
      -   Created_tmp_*
                            Ronald Bradford, MySQL Inc
                           MySQL Conference & Expo 2007         Page: 26
MySQL for Oracle Dudes

                                 Tools
                                                                 Example
     Idle

    - $ mysqladmin -r -i 1 extended-status | grep -v “ | 0 “

+-----------------------------------+------------+
| Variable_name                     | Value      |
+-----------------------------------+------------+
| Bytes_received                    | 35         |
| Bytes_sent                        | 6155       |
| Com_show_status                   |1           |
| Created_tmp_tables                |1           |
| Handler_read_rnd_next             | 246        |
| Handler_write                     | 245        |
| Questions                         |1           |
| Select_scan                       |1           |
| Uptime                            |1           |
+-----------------------------------+------------+


                                   Ronald Bradford, MySQL Inc
                                  MySQL Conference & Expo 2007             Page: 27
MySQL for Oracle Dudes

                                 Tools

     Under load

    - $ mysqladmin -r -i 1 extended-status | grep -v “ | 0 “
                                                                 Erroneous Commands
+-----------------------------------+------------+
                                                                 Causing Round Trips
| Variable_name                     | Value      |
+-----------------------------------+------------+
| Bytes_received                    | 1020909    |
                                                                 Buried in JDBC Usage
| Bytes_sent                        | 195358     |
                                                                  PreparedStatement
| Com_insert                        | 274        |
| Com_select                        | 132        |
                                                                     .setMaxRows()
| Com_set_option                    | 264        |
| Handler_read_key                  | 505        |
| Handler_update                    | 252        |
| Handler_write                     | 519        |
| Questions                         | 1356       |
| Table_locks_immediate             | 536        |
| Table_locks_waited                |2           |
+-----------------------------------+------------+
                                   Ronald Bradford, MySQL Inc
                                  MySQL Conference & Expo 2007                      Page: 28
MySQL for Oracle Dudes

       Inherited LAMP Stack Product
                                                       TIP
    Problem: Frozen, some functions work

    - Lack of Free Disk Space
    Problem: Running slow

    - Increase Buffers
    - Change Storage Engine
    Problem: Can't connect

    - Connections

                         Ronald Bradford, MySQL Inc
                        MySQL Conference & Expo 2007         Page: 29
MySQL for Oracle Dudes

       Inherited LAMP Stack Product

    A lot of products are non-transactional

    Not designed for large volume enterprises





                           Ronald Bradford, MySQL Inc
                          MySQL Conference & Expo 2007     Page: 30
MySQL for Oracle Dudes

                  Default Installation

                                                               GOTCHA
    No 'root' user password

    Anonymous users mess with host based security

    Improve overall security

    $ mysql_secure_installation
       http://dev.mysql.com/doc/refman/5.0/en/mysql-secure-installation.html




                                 Ronald Bradford, MySQL Inc
                                MySQL Conference & Expo 2007               Page: 31
MySQL for Oracle Dudes

                   AUTO COMMIT
                                                          GOTCHA
     By Default enabled in MySQL

    - Ops I deleted the wrong data, I'll just ROLLBACK
    - Non Transactional Storage Engines
    - SET AUTOCOMMIT = {0 | 1};




                            Ronald Bradford, MySQL Inc
                           MySQL Conference & Expo 2007        Page: 32
MySQL for Oracle Dudes

               SQL*Plus Reporting

     No Alternative

     Nice Feature- Vertical Output Display

    - SELECT columns FROM table G


     Write your own in MySQL Source




                            Ronald Bradford, MySQL Inc
                           MySQL Conference & Expo 2007     Page: 33
MySQL for Oracle Dudes

             Nice MySQL Features
                                                        TIP
    SELECT INTO OUTFILE ...

    LOAD DATA FILE ...

    DROP [object] IF EXISTS ...

    ALTER TABLE .. ADD ... AFTER [column]

    Query Cache





                          Ronald Bradford, MySQL Inc
                         MySQL Conference & Expo 2007         Page: 34
MySQL for Oracle Dudes

                           Query Cache

        SELECT Cache (great for high read environments)

    -   Being Added to Oracle v11
                       http://dev.mysql.com/doc/refman/5.0/en/query-cache.html




                                     Ronald Bradford, MySQL Inc
                                    MySQL Conference & Expo 2007             Page: 35
MySQL for Oracle Dudes

                        Contrasting Buffers
Area                    MySQL                       Oracle                    Microsoft SQL Server

                        • MyISAM key caches         • Data cache (variants)   • Buffer cache
        Memory Caches
                        • InnoDB data cache         • Log buffer              • SQL cache
                        • InnoDB log cache          • Shared Pool             • Misc caches (lock,
                                                                                connection, workspace, etc.)
                        • Dictionary cache          • Java Pool
                        • Falcon caches             • Large Pool
                        • Query Cache               • PGA
                        • User caches



                        • InnoDB Undo Space         • Undo Tablespace (9i+)   • TempDB (2005+)
       Redo/Undo Logs
                        • InnoDB Logs               • Redo Logs               • Transaction Logs
                        • Falcon Log                • Archive Logs
                        • Binary Log


                        • Tablespaces               • Tablespaces             • Filegroups
       Data Storage
                        • Table/Index Files         • Datafiles               • Files
                        • Format files

                        • Cost-based                • Cost-based              • Cost-based
       Optimizer




                                               Ronald Bradford, MySQL Inc
                                              MySQL Conference & Expo 2007                                     Page: 36
MySQL for Oracle Dudes




DEVELOPER


    Ronald Bradford, MySQL Inc
   MySQL Conference & Expo 2007     Page: 37
MySQL for Oracle Dudes

              Important Developer Stuff

    Sequence Replacement              SQL_MODE
                              
    No DUAL Necessary                 TIMESTAMP Data Type
                              
    Data Comparison                   New things
                              
    DDL Syntax

    Stored Procedures

    Locking



                         Ronald Bradford, MySQL Inc
                        MySQL Conference & Expo 2007     Page: 38
MySQL for Oracle Dudes

           Sequences Replacement

    AUTO_INCREMENT

    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()
    - No get next capability



                         Ronald Bradford, MySQL Inc
                        MySQL Conference & Expo 2007     Page: 39
MySQL for Oracle Dudes

              Optional Table Name

    DUAL IS NOT REQUIRED

    - e.g.   SELECT 1+1
    Provided for Oracle Compatibility

    - e.g. SELECT 1+1 FROM DUAL
    - e.g. SELECT DUMMY FROM DUAL                        *** Fails




                           Ronald Bradford, MySQL Inc
                          MySQL Conference & Expo 2007               Page: 40
MySQL for Oracle Dudes

                   Data Comparison

     LIKE compares data case-insensitive

    - Character Set/Collation dependent
    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


                              Ronald Bradford, MySQL Inc
                             MySQL Conference & Expo 2007     Page: 41
MySQL for Oracle Dudes

                       DDL 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` (...);


                             Ronald Bradford, MySQL Inc
                            MySQL Conference & Expo 2007     Page: 42
MySQL for Oracle Dudes

                      Stored Procedures

        Earlier Session

         “Using Stored Routines for MySQL Administration”

        Not a PL/SQL Replacement

        Missing Functionality

        Types, Overloading, named parameters, pinning, packages
    



        Built-in Packages
    




                                   Ronald Bradford, MySQL Inc
                                  MySQL Conference & Expo 2007     Page: 43
MySQL for Oracle Dudes

                Stored Procedures

     MySQL Stored Routines Library

    - Globals
    - Arrays
    - Named Parameters


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


                           Ronald Bradford, MySQL Inc
                          MySQL Conference & Expo 2007     Page: 44
MySQL for Oracle Dudes

                         Locking

     Storage Engine Specific

    - MyISAM/Memory – Table
    - InnoDB/Falcon/PBXT/Solid – Row
    - Nitro – quasi nothing




                               Ronald Bradford, MySQL Inc
                              MySQL Conference & Expo 2007     Page: 45
MySQL for Oracle Dudes

                     SQL_MODE

    SET SQL_MODE=TRADITIONAL,ORACLE

       http://dev.mysql.com/doc/refman/5.1/en/server-sql-mode.html




                            Ronald Bradford, MySQL Inc
                           MySQL Conference & Expo 2007          Page: 46
MySQL for Oracle Dudes

                   SQL_MODE

    String Concatenation

    - SELECT CONCAT('A','B');
    - SELECT CONCAT_WS(',','a','b','c',d');
                                                  Emulate Oracle Behaviour


    SET sql_mode='PIPES_AS_CONCAT';

                                                           May break
    - SELECT 'A'||'B';
                                                           other tools

                          Ronald Bradford, MySQL Inc
                         MySQL Conference & Expo 2007                    Page: 47
MySQL for Oracle Dudes

                        TIMESTAMP
                                                              TIP
        Remove DB level auditing via triggers

    -   last_modified TIMESTAMP ON UPDATE CREATE_TIMESTAMP,




                                Ronald Bradford, MySQL Inc
                               MySQL Conference & Expo 2007         Page: 48
MySQL for Oracle Dudes

           New things you may see

    Multi-record INSERT

    REPLACE

    LOW_PRORITY | HIGH PRIORITY

    INSERT DELAYED





                           Ronald Bradford, MySQL Inc
                          MySQL Conference & Expo 2007     Page: 49
MySQL for Oracle Dudes




MIGRATION


    Ronald Bradford, MySQL Inc
   MySQL Conference & Expo 2007     Page: 50
MySQL for Oracle Dudes

                        Migration


MYSQL = (DESCRIPTION=
        (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))
        (CONNECT_DATA=(SID=MYSQL)) (HS=OK))

CREATE DATABASE LINK mysql
       CONNECT TO quot;my_userquot; IDENTIFIED BY quot;my_passwordquot;
        USING 'mysql';

                                   The Easy Way: Simply read/write
                                         directly to MySQL :)


                             Ronald Bradford, MySQL Inc
                            MySQL Conference & Expo 2007             Page: 51
MySQL for Oracle Dudes

                  Oracle Migration

    Good guide to identifying differences

    Schema

    Data

    Objects

    Application





                           Ronald Bradford, MySQL Inc
                          MySQL Conference & Expo 2007     Page: 52
MySQL for Oracle Dudes

                   Oracle Migration

      MySQL Migration Toolkit

    - Does
        - Tables/Views
        - Data
    - Does Not (yet)
        - Sequences
        - Stored Procedures
        - Triggers


                 http://www.mysql.com/products/tools/migration-toolkit/

                                Ronald Bradford, MySQL Inc
                               MySQL Conference & Expo 2007           Page: 53
MySQL for Oracle Dudes

            Oracle Migration - Schema

    Case Sensitive Table Names

                                                            NUMBER supports
    Data Types
                                                                * Integer
                                                             * Floating Point
    - INT, FLOAT/DOUBLE, NUMBER
                                                               * Fixed Point
    - UNSIGNED
    - BIT

    Sequences replacement – Auto Increment

    What's Missing

        Snapshots, Check Constraints, Flashback queries, synonyms
    




                              Ronald Bradford, MySQL Inc
                             MySQL Conference & Expo 2007                       Page: 54
MySQL for Oracle Dudes

            Oracle Migration - Data

    Date Format – no NLS_DATE_FORMAT

    Silent conversions

    - Less likely due to Oracle as Source
    No Oracle Timestamp (no ms support)



    Data Verification necessary

    - COUNT(), SUM(), MD5()

                          Ronald Bradford, MySQL Inc
                         MySQL Conference & Expo 2007     Page: 55
MySQL for Oracle Dudes

     Oracle Migration – Data Verification

     Numeric Precision/Rounding

     Character Sets (multi-byte data)

     CHAR usage

    - CHAR(5)
      - Oracle 'abc ' - 5 characters long
      - MySQL 'abc'   - 3 characters long


                            Ronald Bradford, MySQL Inc
                           MySQL Conference & Expo 2007     Page: 56
MySQL for Oracle Dudes

          Oracle Migration - Objects

    No Packages

    Restricted Triggers

    - Only one trigger per table per DML statement
    - Missing
      - INSTEAD,
      - INSERT OR UPDATE
      - OR REPLACE
      - Only for DML Statements
                           Ronald Bradford, MySQL Inc
                          MySQL Conference & Expo 2007     Page: 57
MySQL for Oracle Dudes

       Oracle Migration - Application

    NVL() --> IFNULL()

    ROWNUM --> LIMIT

    SEQ.CURRVAL --> LAST_INSERT_ID()

    SEQ.NEXTVAL --> NULL

    NO DUAL necessary
                        (SELECT NOW())

    NO DECODE() --> IF() CASE()

    JOIN (+) Syntax --> INNER|OUTER LEFT|RIGHT

                          Ronald Bradford, MySQL Inc
                         MySQL Conference & Expo 2007     Page: 58
MySQL for Oracle Dudes

       Oracle Migration - Application

    Date Functions

    - CURDATE(), NOW()
    Data Formats

    - Default is YYYY-MM-DD
    Case insensitive searching

    - no UPPER(column) = UPPER(value)
    - Character Set/Collation specific

                          Ronald Bradford, MySQL Inc
                         MySQL Conference & Expo 2007     Page: 59
MySQL for Oracle Dudes




CLOSING


   Ronald Bradford, MySQL Inc
  MySQL Conference & Expo 2007     Page: 60
MySQL for Oracle Dudes

         Pronunciation

quot;MySQLquot; is officially pronounced as


   quot;My Ess Queue Ellquot;



                Ronald Bradford, MySQL Inc
               MySQL Conference & Expo 2007     Page: 61
MySQL for Oracle Dudes

                      References

    Developer Zone http://dev.mysql.com

    Blog Aggregator     http://planetmysql.org

    Source Forge        http://forge.mysql.com

    Forums              http://forums.mysql.com

    Lists               http://lists.mysql.com

    User Groups         http://dev.mysql.com/user-groups

    Training            http://www.mysql.com/training

                          Ronald Bradford, MySQL Inc
                         MySQL Conference & Expo 2007     Page: 62
MySQL for Oracle Dudes

           Recommended Reading

    MySQL by Paul DuBois





                            Ronald Bradford, MySQL Inc
                           MySQL Conference & Expo 2007     Page: 63
MySQL for Oracle Dudes

Support Me




Buy a T-shirt !

      Ronald Bradford, MySQL Inc
     MySQL Conference & Expo 2007     Page: 64
MySQL for Oracle Dudes




Q&A


 Ronald Bradford, MySQL Inc
MySQL Conference & Expo 2007     Page: 65

Contenu connexe

Tendances

MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...
MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...
MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...Dave Stokes
 
MySQL 5.7 in a Nutshell
MySQL 5.7 in a NutshellMySQL 5.7 in a Nutshell
MySQL 5.7 in a NutshellEmily Ikuta
 
Upgrade to MySQL 5.6 without downtime
Upgrade to MySQL 5.6 without downtimeUpgrade to MySQL 5.6 without downtime
Upgrade to MySQL 5.6 without downtimeOlivier DASINI
 
Mysql nowwhat
Mysql nowwhatMysql nowwhat
Mysql nowwhatsqlhjalp
 
A26 MariaDB : The New&Implemented MySQL Branch by Colin Charles
A26 MariaDB : The New&Implemented MySQL Branch by Colin CharlesA26 MariaDB : The New&Implemented MySQL Branch by Colin Charles
A26 MariaDB : The New&Implemented MySQL Branch by Colin CharlesInsight Technology, Inc.
 
Tx lf propercareandfeedmysql
Tx lf propercareandfeedmysqlTx lf propercareandfeedmysql
Tx lf propercareandfeedmysqlDave Stokes
 
MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바NeoClova
 
MySQL 5.6 Updates
MySQL 5.6 UpdatesMySQL 5.6 Updates
MySQL 5.6 UpdatesDave Stokes
 
New awesome features in MySQL 5.7
New awesome features in MySQL 5.7New awesome features in MySQL 5.7
New awesome features in MySQL 5.7Zhaoyang Wang
 
Upgrade to MySQL 5.7 and latest news planned for MySQL 8
Upgrade to MySQL 5.7 and latest news planned for MySQL 8Upgrade to MySQL 5.7 and latest news planned for MySQL 8
Upgrade to MySQL 5.7 and latest news planned for MySQL 8Ted Wennmark
 
MySQL Performance Metrics that Matter
MySQL Performance Metrics that MatterMySQL Performance Metrics that Matter
MySQL Performance Metrics that MatterMorgan Tocker
 
Posscon my sql56
Posscon my sql56Posscon my sql56
Posscon my sql56Dave Stokes
 
My sql 5.7-upcoming-changes-v2
My sql 5.7-upcoming-changes-v2My sql 5.7-upcoming-changes-v2
My sql 5.7-upcoming-changes-v2Morgan Tocker
 
MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014Dave Stokes
 
MySQL High Availability -- InnoDB Clusters
MySQL High Availability -- InnoDB ClustersMySQL High Availability -- InnoDB Clusters
MySQL High Availability -- InnoDB ClustersMatt Lord
 
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017Ivan Ma
 
MySQL Database Architectures - 2020-10
MySQL Database Architectures -  2020-10MySQL Database Architectures -  2020-10
MySQL Database Architectures - 2020-10Kenny Gryp
 
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007eLiberatica
 
My sql crashcourse_2012
My sql crashcourse_2012My sql crashcourse_2012
My sql crashcourse_2012sqlhjalp
 

Tendances (20)

MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...
MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...
MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...
 
MySQL 5.7 in a Nutshell
MySQL 5.7 in a NutshellMySQL 5.7 in a Nutshell
MySQL 5.7 in a Nutshell
 
Upgrade to MySQL 5.6 without downtime
Upgrade to MySQL 5.6 without downtimeUpgrade to MySQL 5.6 without downtime
Upgrade to MySQL 5.6 without downtime
 
Mysql nowwhat
Mysql nowwhatMysql nowwhat
Mysql nowwhat
 
A26 MariaDB : The New&Implemented MySQL Branch by Colin Charles
A26 MariaDB : The New&Implemented MySQL Branch by Colin CharlesA26 MariaDB : The New&Implemented MySQL Branch by Colin Charles
A26 MariaDB : The New&Implemented MySQL Branch by Colin Charles
 
My sql 5.6&MySQL Cluster 7.3
My sql 5.6&MySQL Cluster 7.3My sql 5.6&MySQL Cluster 7.3
My sql 5.6&MySQL Cluster 7.3
 
Tx lf propercareandfeedmysql
Tx lf propercareandfeedmysqlTx lf propercareandfeedmysql
Tx lf propercareandfeedmysql
 
MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바
 
MySQL 5.6 Updates
MySQL 5.6 UpdatesMySQL 5.6 Updates
MySQL 5.6 Updates
 
New awesome features in MySQL 5.7
New awesome features in MySQL 5.7New awesome features in MySQL 5.7
New awesome features in MySQL 5.7
 
Upgrade to MySQL 5.7 and latest news planned for MySQL 8
Upgrade to MySQL 5.7 and latest news planned for MySQL 8Upgrade to MySQL 5.7 and latest news planned for MySQL 8
Upgrade to MySQL 5.7 and latest news planned for MySQL 8
 
MySQL Performance Metrics that Matter
MySQL Performance Metrics that MatterMySQL Performance Metrics that Matter
MySQL Performance Metrics that Matter
 
Posscon my sql56
Posscon my sql56Posscon my sql56
Posscon my sql56
 
My sql 5.7-upcoming-changes-v2
My sql 5.7-upcoming-changes-v2My sql 5.7-upcoming-changes-v2
My sql 5.7-upcoming-changes-v2
 
MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014
 
MySQL High Availability -- InnoDB Clusters
MySQL High Availability -- InnoDB ClustersMySQL High Availability -- InnoDB Clusters
MySQL High Availability -- InnoDB Clusters
 
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
 
MySQL Database Architectures - 2020-10
MySQL Database Architectures -  2020-10MySQL Database Architectures -  2020-10
MySQL Database Architectures - 2020-10
 
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
 
My sql crashcourse_2012
My sql crashcourse_2012My sql crashcourse_2012
My sql crashcourse_2012
 

En vedette

Percona tool kit for MySQL DBA's
Percona tool kit for MySQL DBA'sPercona tool kit for MySQL DBA's
Percona tool kit for MySQL DBA'sKarthik .P.R
 
NoSQL in MySQL
NoSQL in MySQLNoSQL in MySQL
NoSQL in MySQLUlf Wendel
 
Modern MySQL Monitoring and Dashboards.
Modern MySQL Monitoring and Dashboards.Modern MySQL Monitoring and Dashboards.
Modern MySQL Monitoring and Dashboards.Mydbops
 
Building Scalable High Availability Systems using MySQL Fabric
Building Scalable High Availability Systems using MySQL FabricBuilding Scalable High Availability Systems using MySQL Fabric
Building Scalable High Availability Systems using MySQL FabricMats Kindahl
 
MySQL Query And Index Tuning
MySQL Query And Index TuningMySQL Query And Index Tuning
MySQL Query And Index TuningManikanda kumar
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group ReplicationUlf Wendel
 
MySQL Sharding: Tools and Best Practices for Horizontal Scaling
MySQL Sharding: Tools and Best Practices for Horizontal ScalingMySQL Sharding: Tools and Best Practices for Horizontal Scaling
MySQL Sharding: Tools and Best Practices for Horizontal ScalingMats Kindahl
 
Mysql architecture&parameters
Mysql architecture&parametersMysql architecture&parameters
Mysql architecture&parametersPhilip Zhong
 
Designing Teams for Emerging Challenges
Designing Teams for Emerging ChallengesDesigning Teams for Emerging Challenges
Designing Teams for Emerging ChallengesAaron Irizarry
 

En vedette (9)

Percona tool kit for MySQL DBA's
Percona tool kit for MySQL DBA'sPercona tool kit for MySQL DBA's
Percona tool kit for MySQL DBA's
 
NoSQL in MySQL
NoSQL in MySQLNoSQL in MySQL
NoSQL in MySQL
 
Modern MySQL Monitoring and Dashboards.
Modern MySQL Monitoring and Dashboards.Modern MySQL Monitoring and Dashboards.
Modern MySQL Monitoring and Dashboards.
 
Building Scalable High Availability Systems using MySQL Fabric
Building Scalable High Availability Systems using MySQL FabricBuilding Scalable High Availability Systems using MySQL Fabric
Building Scalable High Availability Systems using MySQL Fabric
 
MySQL Query And Index Tuning
MySQL Query And Index TuningMySQL Query And Index Tuning
MySQL Query And Index Tuning
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group Replication
 
MySQL Sharding: Tools and Best Practices for Horizontal Scaling
MySQL Sharding: Tools and Best Practices for Horizontal ScalingMySQL Sharding: Tools and Best Practices for Horizontal Scaling
MySQL Sharding: Tools and Best Practices for Horizontal Scaling
 
Mysql architecture&parameters
Mysql architecture&parametersMysql architecture&parameters
Mysql architecture&parameters
 
Designing Teams for Emerging Challenges
Designing Teams for Emerging ChallengesDesigning Teams for Emerging Challenges
Designing Teams for Emerging Challenges
 

Similaire à MySQL For Oracle DBA's and Developers

DPC2007 MySQL Stored Routines for PHP Developers (Roland Bouman)
DPC2007 MySQL Stored Routines for PHP Developers (Roland Bouman)DPC2007 MySQL Stored Routines for PHP Developers (Roland Bouman)
DPC2007 MySQL Stored Routines for PHP Developers (Roland Bouman)dpc
 
Tutorial MySQL com Java
Tutorial MySQL com JavaTutorial MySQL com Java
Tutorial MySQL com JavaMySQL Brasil
 
20191001 bkk-secret-of inno-db_clusterv1
20191001 bkk-secret-of inno-db_clusterv120191001 bkk-secret-of inno-db_clusterv1
20191001 bkk-secret-of inno-db_clusterv1Ivan Ma
 
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
 
Ukoug 2011 mysql_arch_for_orcl_dba
Ukoug 2011 mysql_arch_for_orcl_dbaUkoug 2011 mysql_arch_for_orcl_dba
Ukoug 2011 mysql_arch_for_orcl_dbaorablue11
 
20190817 coscup-oracle my sql innodb cluster sharing
20190817 coscup-oracle my sql innodb cluster sharing20190817 coscup-oracle my sql innodb cluster sharing
20190817 coscup-oracle my sql innodb cluster sharingIvan Ma
 
MySQL Document Store
MySQL Document StoreMySQL Document Store
MySQL Document StoreMario Beck
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAsMark Leith
 
20201106 hk-py con-mysql-shell
20201106 hk-py con-mysql-shell20201106 hk-py con-mysql-shell
20201106 hk-py con-mysql-shellIvan Ma
 
My sql susecon_crashcourse_2012
My sql susecon_crashcourse_2012My sql susecon_crashcourse_2012
My sql susecon_crashcourse_2012sqlhjalp
 
Oracle OpenWorld 2013 - HOL9737 MySQL Replication Best Practices
Oracle OpenWorld 2013 - HOL9737 MySQL Replication Best PracticesOracle OpenWorld 2013 - HOL9737 MySQL Replication Best Practices
Oracle OpenWorld 2013 - HOL9737 MySQL Replication Best PracticesSven Sandberg
 
2012 replication
2012 replication2012 replication
2012 replicationsqlhjalp
 
MySQL no Paypal Tesla e Uber
MySQL no Paypal Tesla e UberMySQL no Paypal Tesla e Uber
MySQL no Paypal Tesla e UberMySQL Brasil
 
My First 100 days with a MySQL DBMS (WP)
My First 100 days with a MySQL DBMS (WP)My First 100 days with a MySQL DBMS (WP)
My First 100 days with a MySQL DBMS (WP)Gustavo Rene Antunez
 

Similaire à MySQL For Oracle DBA's and Developers (20)

DPC2007 MySQL Stored Routines for PHP Developers (Roland Bouman)
DPC2007 MySQL Stored Routines for PHP Developers (Roland Bouman)DPC2007 MySQL Stored Routines for PHP Developers (Roland Bouman)
DPC2007 MySQL Stored Routines for PHP Developers (Roland Bouman)
 
Tutorial MySQL com Java
Tutorial MySQL com JavaTutorial MySQL com Java
Tutorial MySQL com Java
 
Simple Way for MySQL to NoSQL
Simple Way for MySQL to NoSQLSimple Way for MySQL to NoSQL
Simple Way for MySQL to NoSQL
 
20191001 bkk-secret-of inno-db_clusterv1
20191001 bkk-secret-of inno-db_clusterv120191001 bkk-secret-of inno-db_clusterv1
20191001 bkk-secret-of inno-db_clusterv1
 
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
 
MySQL At Yelp
MySQL At YelpMySQL At Yelp
MySQL At Yelp
 
Ukoug 2011 mysql_arch_for_orcl_dba
Ukoug 2011 mysql_arch_for_orcl_dbaUkoug 2011 mysql_arch_for_orcl_dba
Ukoug 2011 mysql_arch_for_orcl_dba
 
20190817 coscup-oracle my sql innodb cluster sharing
20190817 coscup-oracle my sql innodb cluster sharing20190817 coscup-oracle my sql innodb cluster sharing
20190817 coscup-oracle my sql innodb cluster sharing
 
MySQL Document Store
MySQL Document StoreMySQL Document Store
MySQL Document Store
 
PHP - Intriduction to MySQL And PHP
PHP - Intriduction to MySQL And PHPPHP - Intriduction to MySQL And PHP
PHP - Intriduction to MySQL And PHP
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAs
 
20201106 hk-py con-mysql-shell
20201106 hk-py con-mysql-shell20201106 hk-py con-mysql-shell
20201106 hk-py con-mysql-shell
 
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
 
My sql susecon_crashcourse_2012
My sql susecon_crashcourse_2012My sql susecon_crashcourse_2012
My sql susecon_crashcourse_2012
 
MySQL Tech Tour Nov, 2013
MySQL Tech Tour Nov, 2013MySQL Tech Tour Nov, 2013
MySQL Tech Tour Nov, 2013
 
Oracle OpenWorld 2013 - HOL9737 MySQL Replication Best Practices
Oracle OpenWorld 2013 - HOL9737 MySQL Replication Best PracticesOracle OpenWorld 2013 - HOL9737 MySQL Replication Best Practices
Oracle OpenWorld 2013 - HOL9737 MySQL Replication Best Practices
 
2012 replication
2012 replication2012 replication
2012 replication
 
MySQL no Paypal Tesla e Uber
MySQL no Paypal Tesla e UberMySQL no Paypal Tesla e Uber
MySQL no Paypal Tesla e Uber
 
My First 100 days with a MySQL DBMS (WP)
My First 100 days with a MySQL DBMS (WP)My First 100 days with a MySQL DBMS (WP)
My First 100 days with a MySQL DBMS (WP)
 

Plus 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 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
 

Plus 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 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
 
SQL v No SQL
SQL v No SQLSQL v No SQL
SQL v No SQL
 

Dernier

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 

Dernier (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

MySQL For Oracle DBA's and Developers

  • 1. MySQL for Oracle DBAs and Developers
  • 2. MySQL for Oracle Dudes How can you tell an Oracle DBA has touched your MySQL Installation? Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 2
  • 3. MySQL for Oracle Dudes MYSQL_HOME=/home/oracle/products/mysql-version mysqld_safe –user=oracle & Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 3
  • 4. MySQL for Oracle Dudes Outline DBA Tips, Tricks, Gotcha's & Tools  Key Differences for Developers  Migrating from Oracle to MySQL  Questions & Answers  Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 4
  • 5. MySQL for Oracle Dudes My Background 18 years in Database Technologies (1989)  10 years Oracle Experience (1996)  8 years MySQL Experience (1999)  Active in MySQL, Java, XP User Groups  Joined MySQL Professional Services (2006)  Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 5
  • 6. MySQL for Oracle Dudes DBA Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 6
  • 7. MySQL for Oracle Dudes Important DBA Stuff Terminology MySQL Data Dictionary   Installation Backup   Directories Tools   Log Files Inherited LAMP Stack   Processes  Ports & Sockets  Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 7
  • 8. MySQL for Oracle Dudes Terminology Database (files) --> Database Server Instance Database Instance (memory) --> Database Server Instance Schema User --> Database User --> User Table Space --> Table Space --> Storage Engine Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 8
  • 9. MySQL for Oracle Dudes MySQL Installation OS packages place files in many areas and varies  Tip - e.g. /usr/lib, /var/lib, /var/log, /etc Recommend installing using .tar.gz  - Centrally Manageable e.g. /opt/mysql-version - Upgradeable - Multiple Versions possible $MYSQL_HOME  Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 9
  • 10. MySQL for Oracle Dudes MySQL Configuration GOTCHA Multiple MySQL Instances  my.cnf  - Watch out for /etc/my.cnf, /etc/mysql/my.cnf - Best Practice $MYSQL_HOME/my.cnf - --defaults-file=<file> http://dev.mysql.com/doc/refman/5.1/en/option-files.html Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 10
  • 11. MySQL for Oracle Dudes MySQL Directories my.cnf options basedir  ($MYSQL_HOME) - e.g. /opt/mysql-5.1.16-beta-linux-i686-glib23 datadir  (defaults to $MYSQL_HOME/data) tmpdir  (important as mysql behaves unpredictability if full) innodb_[...]_home_dir  - mysql> SHOW GLOBAL VARIABLES LIKE '%dir' Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 11
  • 12. MySQL for Oracle Dudes MySQL Ports & Sockets Configured to listen on TCP/IP Port (default 3306)  Additional Instances  - Different Ports - Different IP's using default Port Local connection uses Socket  - Even specifying Port, local client may use socket Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 12
  • 13. MySQL for Oracle Dudes MySQL Log Files my.cnf options mysqld arg Error Log  - log-error Binary Log  - log-bin (my.cnf or mysqld arg) Slow Query Log  - log-slow-queries,slow-query-time,log-queries-not-using-indexes General Log  - log http://dev.mysql.com/doc/refman/5.0/en/log-files.html Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 13
  • 14. MySQL for Oracle Dudes MySQL Meta Data New Feature mysql Database  - general_log, slow_log (5.1) mysql> SET GLOBAL GENERAL_LOG=1; mysql> ... mysql> SELECT * FROM mysql.general_log; http://dev.mysql.com/doc/refman/5.1/en/log-tables.html Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 14
  • 15. MySQL for Oracle Dudes MySQL Data Dictionary [DBA|USER|ALL]_ tables, V$ INFORMATION_SCHEMA  - TABLES, COLUMNS, VIEWS, USER_PRIVILEGES - PROCESSLIST (5.1) - [GLOBAL|SESSION]_[STATUS|VARIABLES] (5.1) http://dev.mysql.com/doc/refman/5.1/en/information-schema.html http://www.xcdsql.org/MySQL/information_schema/5.1/MySQL_5_1_INFORMATION_SCHEMA.html Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 15
  • 16. MySQL for Oracle Dudes Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 16
  • 17. MySQL for Oracle Dudes MySQL Data Dictionary SQL 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'; Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 17
  • 18. MySQL for Oracle Dudes MySQL Data Dictionary SQL 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 Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 18
  • 19. MySQL for Oracle Dudes SHOW Commands 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';  Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 19
  • 20. MySQL for Oracle Dudes Backup Missing Functionality  Commercial strength – unbreakable (Planned 6.0)  Storage Engine Driven  Innodb  Also PBXT, Falcon - Hot Backup - mysqldump --single-transaction --master-data - InnoDB Hot Backup Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 20
  • 21. MySQL for Oracle Dudes Backup MyISAM Only  - Cold Backup via File Copy - LVM Snapshot SE Mixture  - Use Replication Slave Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 21
  • 22. MySQL for Oracle Dudes Online Backup/Recovery MySQL 6.0 Demo Cross-engine. All major internal engines supported.  Online, non-blocking for DML. DDL still blocked.  SQL-command driven. Run from any mysql client.  Backup to local disk, tape or remote file system.  Full Server, database, and point-in-time recovery.  Backup ALL… Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 22
  • 23. MySQL for Oracle Dudes Tools Missing Functionality  - Enterprise Level Monitoring SHOW PROFILE (5.0.38 - Community)  Microsecond Patch  (5.0.33 - Slow query granularity) mytop/innotop/ndbtop  MySQL Toolkit  http://sourceforge.net/projects/mysqltoolkit phpMyAdmin  Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 23
  • 24. MySQL for Oracle Dudes SHOW PROFILE mysql> show profile SOURCE,MEMORY for query 4; +--------------------+------------+-----------------------+---------------+-------------+ | Status | Duration | Source_function | Source_file | Source_line | +--------------------+------------+-----------------------+---------------+-------------+ | Opening tables | 0.00013200 | open_tables | sql_base.cc | 2106 | | System lock | 0.00001800 | mysql_lock_tables | lock.cc | 153 | | Table lock | 0.00000600 | mysql_lock_tables | lock.cc | 162 | | init | 0.00001300 | mysql_select | sql_select.cc | 2073 | | optimizing | 0.00004800 | optimize | sql_select.cc | 617 | | statistics | 0.00002500 | optimize | sql_select.cc | 773 | | preparing | 0.00005200 | optimize | sql_select.cc | 783 | | executing | 0.00002200 | exec | sql_select.cc | 1407 | | Sending data | 0.00000500 | exec | sql_select.cc | 1925 | | end | 0.00786600 | mysql_select | sql_select.cc | 2118 | | query end | 0.00001400 | mysql_execute_command | sql_parse.cc | 5085 | | freeing items | 0.00000700 | mysql_parse | sql_parse.cc | 5973 | | closing tables | 0.00001900 | dispatch_command | sql_parse.cc | 2120 | | logging slow query | 0.00001000 | log_slow_statement | sql_parse.cc | 2178 | | cleaning up | 0.00000500 | dispatch_command | sql_parse.cc | 2143 | +--------------------+------------+-----------------------+---------------+-------------+ 15 rows in set (0.01 sec) 95% time in one step  Reference to Source Code  “poor” Status names (internal code)  Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 24
  • 25. MySQL for Oracle Dudes GUI Tools MySQL Administrator  Quest Spotlight  Toad  MySQL Enterprise MySQL Network Monitoring & Network Services  Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 25
  • 26. MySQL for Oracle Dudes Tools TIP mysqladmin -r -i 1 extended-status  - Gives change in status variables per second - Lacks timestamp Monitor specifics  - Com_* - Innodb_*, Innodb_buffer_pool_* - Connections - Created_tmp_* Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 26
  • 27. MySQL for Oracle Dudes Tools Example Idle  - $ mysqladmin -r -i 1 extended-status | grep -v “ | 0 “ +-----------------------------------+------------+ | Variable_name | Value | +-----------------------------------+------------+ | Bytes_received | 35 | | Bytes_sent | 6155 | | Com_show_status |1 | | Created_tmp_tables |1 | | Handler_read_rnd_next | 246 | | Handler_write | 245 | | Questions |1 | | Select_scan |1 | | Uptime |1 | +-----------------------------------+------------+ Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 27
  • 28. MySQL for Oracle Dudes Tools Under load  - $ mysqladmin -r -i 1 extended-status | grep -v “ | 0 “ Erroneous Commands +-----------------------------------+------------+ Causing Round Trips | Variable_name | Value | +-----------------------------------+------------+ | Bytes_received | 1020909 | Buried in JDBC Usage | Bytes_sent | 195358 | PreparedStatement | Com_insert | 274 | | Com_select | 132 | .setMaxRows() | Com_set_option | 264 | | Handler_read_key | 505 | | Handler_update | 252 | | Handler_write | 519 | | Questions | 1356 | | Table_locks_immediate | 536 | | Table_locks_waited |2 | +-----------------------------------+------------+ Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 28
  • 29. MySQL for Oracle Dudes Inherited LAMP Stack Product TIP Problem: Frozen, some functions work  - Lack of Free Disk Space Problem: Running slow  - Increase Buffers - Change Storage Engine Problem: Can't connect  - Connections Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 29
  • 30. MySQL for Oracle Dudes Inherited LAMP Stack Product A lot of products are non-transactional  Not designed for large volume enterprises  Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 30
  • 31. MySQL for Oracle Dudes Default Installation GOTCHA No 'root' user password  Anonymous users mess with host based security  Improve overall security  $ mysql_secure_installation http://dev.mysql.com/doc/refman/5.0/en/mysql-secure-installation.html Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 31
  • 32. MySQL for Oracle Dudes AUTO COMMIT GOTCHA By Default enabled in MySQL  - Ops I deleted the wrong data, I'll just ROLLBACK - Non Transactional Storage Engines - SET AUTOCOMMIT = {0 | 1}; Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 32
  • 33. MySQL for Oracle Dudes SQL*Plus Reporting No Alternative  Nice Feature- Vertical Output Display  - SELECT columns FROM table G Write your own in MySQL Source  Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 33
  • 34. MySQL for Oracle Dudes Nice MySQL Features TIP SELECT INTO OUTFILE ...  LOAD DATA FILE ...  DROP [object] IF EXISTS ...  ALTER TABLE .. ADD ... AFTER [column]  Query Cache  Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 34
  • 35. MySQL for Oracle Dudes Query Cache SELECT Cache (great for high read environments)  - Being Added to Oracle v11 http://dev.mysql.com/doc/refman/5.0/en/query-cache.html Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 35
  • 36. MySQL for Oracle Dudes Contrasting Buffers Area MySQL Oracle Microsoft SQL Server • MyISAM key caches • Data cache (variants) • Buffer cache Memory Caches • InnoDB data cache • Log buffer • SQL cache • InnoDB log cache • Shared Pool • Misc caches (lock, connection, workspace, etc.) • Dictionary cache • Java Pool • Falcon caches • Large Pool • Query Cache • PGA • User caches • InnoDB Undo Space • Undo Tablespace (9i+) • TempDB (2005+) Redo/Undo Logs • InnoDB Logs • Redo Logs • Transaction Logs • Falcon Log • Archive Logs • Binary Log • Tablespaces • Tablespaces • Filegroups Data Storage • Table/Index Files • Datafiles • Files • Format files • Cost-based • Cost-based • Cost-based Optimizer Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 36
  • 37. MySQL for Oracle Dudes DEVELOPER Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 37
  • 38. MySQL for Oracle Dudes Important Developer Stuff Sequence Replacement SQL_MODE   No DUAL Necessary TIMESTAMP Data Type   Data Comparison New things   DDL Syntax  Stored Procedures  Locking  Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 38
  • 39. MySQL for Oracle Dudes Sequences Replacement AUTO_INCREMENT  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() - No get next capability Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 39
  • 40. MySQL for Oracle Dudes Optional Table Name DUAL IS NOT REQUIRED  - e.g. SELECT 1+1 Provided for Oracle Compatibility  - e.g. SELECT 1+1 FROM DUAL - e.g. SELECT DUMMY FROM DUAL *** Fails Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 40
  • 41. MySQL for Oracle Dudes Data Comparison LIKE compares data case-insensitive  - Character Set/Collation dependent 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 Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 41
  • 42. MySQL for Oracle Dudes DDL 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` (...); Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 42
  • 43. MySQL for Oracle Dudes Stored Procedures Earlier Session  “Using Stored Routines for MySQL Administration” Not a PL/SQL Replacement  Missing Functionality  Types, Overloading, named parameters, pinning, packages  Built-in Packages  Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 43
  • 44. MySQL for Oracle Dudes Stored Procedures MySQL Stored Routines Library  - Globals - Arrays - Named Parameters http://forge.mysql.com/projects/view.php?id=35 Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 44
  • 45. MySQL for Oracle Dudes Locking Storage Engine Specific  - MyISAM/Memory – Table - InnoDB/Falcon/PBXT/Solid – Row - Nitro – quasi nothing Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 45
  • 46. MySQL for Oracle Dudes SQL_MODE SET SQL_MODE=TRADITIONAL,ORACLE  http://dev.mysql.com/doc/refman/5.1/en/server-sql-mode.html Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 46
  • 47. MySQL for Oracle Dudes SQL_MODE String Concatenation  - SELECT CONCAT('A','B'); - SELECT CONCAT_WS(',','a','b','c',d'); Emulate Oracle Behaviour SET sql_mode='PIPES_AS_CONCAT';  May break - SELECT 'A'||'B'; other tools Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 47
  • 48. MySQL for Oracle Dudes TIMESTAMP TIP Remove DB level auditing via triggers  - last_modified TIMESTAMP ON UPDATE CREATE_TIMESTAMP, Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 48
  • 49. MySQL for Oracle Dudes New things you may see Multi-record INSERT  REPLACE  LOW_PRORITY | HIGH PRIORITY  INSERT DELAYED  Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 49
  • 50. MySQL for Oracle Dudes MIGRATION Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 50
  • 51. MySQL for Oracle Dudes Migration MYSQL = (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)) (CONNECT_DATA=(SID=MYSQL)) (HS=OK)) CREATE DATABASE LINK mysql CONNECT TO quot;my_userquot; IDENTIFIED BY quot;my_passwordquot; USING 'mysql'; The Easy Way: Simply read/write directly to MySQL :) Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 51
  • 52. MySQL for Oracle Dudes Oracle Migration Good guide to identifying differences  Schema  Data  Objects  Application  Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 52
  • 53. MySQL for Oracle Dudes Oracle Migration MySQL Migration Toolkit  - Does - Tables/Views - Data - Does Not (yet) - Sequences - Stored Procedures - Triggers http://www.mysql.com/products/tools/migration-toolkit/ Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 53
  • 54. MySQL for Oracle Dudes Oracle Migration - Schema Case Sensitive Table Names  NUMBER supports Data Types  * Integer * Floating Point - INT, FLOAT/DOUBLE, NUMBER * Fixed Point - UNSIGNED - BIT Sequences replacement – Auto Increment  What's Missing  Snapshots, Check Constraints, Flashback queries, synonyms  Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 54
  • 55. MySQL for Oracle Dudes Oracle Migration - Data Date Format – no NLS_DATE_FORMAT  Silent conversions  - Less likely due to Oracle as Source No Oracle Timestamp (no ms support)  Data Verification necessary  - COUNT(), SUM(), MD5() Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 55
  • 56. MySQL for Oracle Dudes Oracle Migration – Data Verification Numeric Precision/Rounding  Character Sets (multi-byte data)  CHAR usage  - CHAR(5) - Oracle 'abc ' - 5 characters long - MySQL 'abc' - 3 characters long Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 56
  • 57. MySQL for Oracle Dudes Oracle Migration - Objects No Packages  Restricted Triggers  - Only one trigger per table per DML statement - Missing - INSTEAD, - INSERT OR UPDATE - OR REPLACE - Only for DML Statements Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 57
  • 58. MySQL for Oracle Dudes Oracle Migration - Application NVL() --> IFNULL()  ROWNUM --> LIMIT  SEQ.CURRVAL --> LAST_INSERT_ID()  SEQ.NEXTVAL --> NULL  NO DUAL necessary  (SELECT NOW()) NO DECODE() --> IF() CASE()  JOIN (+) Syntax --> INNER|OUTER LEFT|RIGHT  Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 58
  • 59. MySQL for Oracle Dudes Oracle Migration - Application Date Functions  - CURDATE(), NOW() Data Formats  - Default is YYYY-MM-DD Case insensitive searching  - no UPPER(column) = UPPER(value) - Character Set/Collation specific Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 59
  • 60. MySQL for Oracle Dudes CLOSING Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 60
  • 61. MySQL for Oracle Dudes Pronunciation quot;MySQLquot; is officially pronounced as quot;My Ess Queue Ellquot; Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 61
  • 62. MySQL for Oracle Dudes References Developer Zone http://dev.mysql.com  Blog Aggregator http://planetmysql.org  Source Forge http://forge.mysql.com  Forums http://forums.mysql.com  Lists http://lists.mysql.com  User Groups http://dev.mysql.com/user-groups  Training http://www.mysql.com/training  Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 62
  • 63. MySQL for Oracle Dudes Recommended Reading MySQL by Paul DuBois  Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 63
  • 64. MySQL for Oracle Dudes Support Me Buy a T-shirt ! Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 64
  • 65. MySQL for Oracle Dudes Q&A Ronald Bradford, MySQL Inc MySQL Conference & Expo 2007 Page: 65