MySQL for Oracle DBAs

980 views

Published on

Introduction to, and highlights about, MySQL, from the perspective of an Oracle DBA. Contains many pointers and references for further study.

Published in: Data & Analytics
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
980
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
35
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • <number>
  • This is a Title Slide with Picture slide ideal for including a picture with a brief title, subtitle and presenter information.
    To customize this slide with your own picture:
    Right-click the slide area and choose Format Background from the pop-up menu. From the Fill menu, click Picture and texture fill. Under Insert from: click File. Locate your new picture and click Insert.
    To copy the Customized Background from Another Presentation on PC
    Click New Slide from the Home tab's Slides group and select Reuse Slides.
    Click Browse in the Reuse Slides panel and select Browse Files. Double-click the PowerPoint presentation that contains the background you wish to copy.
    Check Keep Source Formatting and click the slide that contains the background you want.
    Click the left-hand slide preview to which you wish to apply the new master layout.
    Apply New Layout (Important): Right-click any selected slide, point to Layout, and click the slide containing the desired layout from the layout gallery.
    Delete any unwanted slides or duplicates.
    To copy the Customized Background from Another Presentation on Mac
    Click New Slide from the Home tab's Slides group and select Insert Slides from Other Presentation…
    Navigate to the PowerPoint presentation file that contains the background you wish to copy. Double-click or press Insert. This prompts the Slide Finder dialogue box.
    Make sure Keep design of original slides is unchecked and click the slide(s) that contains the background you want. Hold Shift key to select multiple slides.
    Click the left-hand slide preview to which you wish to apply the new master layout.
    Apply New Layout (Important): Click Layout from the Home tab's Slides group, and click the slide containing the desired layout from the layout gallery.
    Delete any unwanted slides or duplicates.
    <number>
  • This is a Safe Harbor Front slide, one of two Safe Harbor Statement slides included in this template.
    One of the Safe Harbor slides must be used if your presentation covers material affected by Oracle’s Revenue Recognition Policy
    To learn more about this policy, e-mail: Revrec-americasiebc_us@oracle.com
    For internal communication, Safe Harbor Statements are not required. However, there is an applicable disclaimer (Exhibit E) that should be used, found in the Oracle Revenue Recognition Policy for Future Product Communications. Copy and paste this link into a web browser, to find out more information.  
    http://my.oracle.com/site/fin/gfo/GlobalProcesses/cnt452504.pdf
    For all external communications such as press release, roadmaps, PowerPoint presentations, Safe Harbor Statements are required. You can refer to the link mentioned above to find out additional information/disclaimers required depending on your audience.
    <number>
  • <number>
  • <number>
  • <number>
  • <number>
  • <number>
  • <number>
  • <number>
  • <number>
  • <number>
  • <number>
  • <number>
  • <number>
  • <number>
  • <number>
  • <number>
  • This is a Title Slide with Picture slide ideal for including a picture with a brief title, subtitle and presenter information.
    To customize this slide with your own picture:
    Right-click the slide area and choose Format Background from the pop-up menu. From the Fill menu, click Picture and texture fill. Under Insert from: click File. Locate your new picture and click Insert.
    To copy the Customized Background from Another Presentation on PC
    Click New Slide from the Home tab's Slides group and select Reuse Slides.
    Click Browse in the Reuse Slides panel and select Browse Files. Double-click the PowerPoint presentation that contains the background you wish to copy.
    Check Keep Source Formatting and click the slide that contains the background you want.
    Click the left-hand slide preview to which you wish to apply the new master layout.
    Apply New Layout (Important): Right-click any selected slide, point to Layout, and click the slide containing the desired layout from the layout gallery.
    Delete any unwanted slides or duplicates.
    To copy the Customized Background from Another Presentation on Mac
    Click New Slide from the Home tab's Slides group and select Insert Slides from Other Presentation…
    Navigate to the PowerPoint presentation file that contains the background you wish to copy. Double-click or press Insert. This prompts the Slide Finder dialogue box.
    Make sure Keep design of original slides is unchecked and click the slide(s) that contains the background you want. Hold Shift key to select multiple slides.
    Click the left-hand slide preview to which you wish to apply the new master layout.
    Apply New Layout (Important): Click Layout from the Home tab's Slides group, and click the slide containing the desired layout from the layout gallery.
    Delete any unwanted slides or duplicates.
    <number>
  • <number>
  • <number>
  • <number>
  • <number>
  • <number>
  • This is a Title Slide with Picture slide ideal for including a picture with a brief title, subtitle and presenter information.
    To customize this slide with your own picture:
    Right-click the slide area and choose Format Background from the pop-up menu. From the Fill menu, click Picture and texture fill. Under Insert from: click File. Locate your new picture and click Insert.
    To copy the Customized Background from Another Presentation on PC
    Click New Slide from the Home tab's Slides group and select Reuse Slides.
    Click Browse in the Reuse Slides panel and select Browse Files. Double-click the PowerPoint presentation that contains the background you wish to copy.
    Check Keep Source Formatting and click the slide that contains the background you want.
    Click the left-hand slide preview to which you wish to apply the new master layout.
    Apply New Layout (Important): Right-click any selected slide, point to Layout, and click the slide containing the desired layout from the layout gallery.
    Delete any unwanted slides or duplicates.
    To copy the Customized Background from Another Presentation on Mac
    Click New Slide from the Home tab's Slides group and select Insert Slides from Other Presentation…
    Navigate to the PowerPoint presentation file that contains the background you wish to copy. Double-click or press Insert. This prompts the Slide Finder dialogue box.
    Make sure Keep design of original slides is unchecked and click the slide(s) that contains the background you want. Hold Shift key to select multiple slides.
    Click the left-hand slide preview to which you wish to apply the new master layout.
    Apply New Layout (Important): Click Layout from the Home tab's Slides group, and click the slide containing the desired layout from the layout gallery.
    Delete any unwanted slides or duplicates.
    <number>
  • <number>
  • <number>
  • This is a Title Slide with Picture slide ideal for including a picture with a brief title, subtitle and presenter information.
    To customize this slide with your own picture:
    Right-click the slide area and choose Format Background from the pop-up menu. From the Fill menu, click Picture and texture fill. Under Insert from: click File. Locate your new picture and click Insert.
    To copy the Customized Background from Another Presentation on PC
    Click New Slide from the Home tab's Slides group and select Reuse Slides.
    Click Browse in the Reuse Slides panel and select Browse Files. Double-click the PowerPoint presentation that contains the background you wish to copy.
    Check Keep Source Formatting and click the slide that contains the background you want.
    Click the left-hand slide preview to which you wish to apply the new master layout.
    Apply New Layout (Important): Right-click any selected slide, point to Layout, and click the slide containing the desired layout from the layout gallery.
    Delete any unwanted slides or duplicates.
    To copy the Customized Background from Another Presentation on Mac
    Click New Slide from the Home tab's Slides group and select Insert Slides from Other Presentation…
    Navigate to the PowerPoint presentation file that contains the background you wish to copy. Double-click or press Insert. This prompts the Slide Finder dialogue box.
    Make sure Keep design of original slides is unchecked and click the slide(s) that contains the background you want. Hold Shift key to select multiple slides.
    Click the left-hand slide preview to which you wish to apply the new master layout.
    Apply New Layout (Important): Click Layout from the Home tab's Slides group, and click the slide containing the desired layout from the layout gallery.
    Delete any unwanted slides or duplicates.
    <number>
  • <number>
  • This is a Title Slide with Picture slide ideal for including a picture with a brief title, subtitle and presenter information.
    To customize this slide with your own picture:
    Right-click the slide area and choose Format Background from the pop-up menu. From the Fill menu, click Picture and texture fill. Under Insert from: click File. Locate your new picture and click Insert.
    To copy the Customized Background from Another Presentation on PC
    Click New Slide from the Home tab's Slides group and select Reuse Slides.
    Click Browse in the Reuse Slides panel and select Browse Files. Double-click the PowerPoint presentation that contains the background you wish to copy.
    Check Keep Source Formatting and click the slide that contains the background you want.
    Click the left-hand slide preview to which you wish to apply the new master layout.
    Apply New Layout (Important): Right-click any selected slide, point to Layout, and click the slide containing the desired layout from the layout gallery.
    Delete any unwanted slides or duplicates.
    To copy the Customized Background from Another Presentation on Mac
    Click New Slide from the Home tab's Slides group and select Insert Slides from Other Presentation…
    Navigate to the PowerPoint presentation file that contains the background you wish to copy. Double-click or press Insert. This prompts the Slide Finder dialogue box.
    Make sure Keep design of original slides is unchecked and click the slide(s) that contains the background you want. Hold Shift key to select multiple slides.
    Click the left-hand slide preview to which you wish to apply the new master layout.
    Apply New Layout (Important): Click Layout from the Home tab's Slides group, and click the slide containing the desired layout from the layout gallery.
    Delete any unwanted slides or duplicates.
    <number>
  • This is a Safe Harbor Front slide, one of two Safe Harbor Statement slides included in this template.
    One of the Safe Harbor slides must be used if your presentation covers material affected by Oracle’s Revenue Recognition Policy
    To learn more about this policy, e-mail: Revrec-americasiebc_us@oracle.com
    For internal communication, Safe Harbor Statements are not required. However, there is an applicable disclaimer (Exhibit E) that should be used, found in the Oracle Revenue Recognition Policy for Future Product Communications. Copy and paste this link into a web browser, to find out more information.  
    http://my.oracle.com/site/fin/gfo/GlobalProcesses/cnt452504.pdf
    For all external communications such as press release, roadmaps, PowerPoint presentations, Safe Harbor Statements are required. You can refer to the link mentioned above to find out additional information/disclaimers required depending on your audience.
    <number>
  • <number>
  • MySQL for Oracle DBAs

    1. 1. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |
    2. 2. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL for Oracle DBAs • Ben Krug • Senior Technical Support Engineer • ben.krug@oracle.com • August 2015
    3. 3. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Introduction to MySQL – What is MySQL? • Open-source RDBMS – Beginning: One element of historical LAMP stack (Linux, Apache, MySQL, PHP) – Present: RDBMS, yet also supports high-performance NoSQL ● http://www.mysql.com/why-mysql/white-papers/guide-to-mysql-and-nosql-delivering-the-best-of-both-worlds/ – Future: 5.7 (not yet GA) also introduces native JSON support (and much more!) ● http://mysqlserverteam.com/json-labs-release-native-json-data-type-and-binary-format/ • Several core products, for different needs and environments – Enterprise, Cluster, Community, and more ● http://www.oracle.com/us/products/mysql/overview/index.html ● https://www.mysql.com/products/ • The world's most popular open-source database - www.mysql.com 4
    4. 4. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Why Use MySQL? • Choose the right tool for each job – Simple and efficient – Low cost – Widely tested and used – Highly scalable • Ideal for web applications – http://www.mysql.com/why-mysql/white-papers/top-10-reasons-to-choose-mysql-for-next-generation-web-applications/ • Supported by Oracle and integrates with Oracle databases and environments 5
    5. 5. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL for the Oracle DBA • This talk will give an overview and highlights of MySQL – From an Oracle DBA's perspective ● I started out as an Oracle DBA – Highlighting aspects that an Oracle DBA might not expect ● Similarities and differences – Since it is an overview, we can't cover every detail ● Therefore, many references are provided in the slides • Let's get started... 6
    6. 6. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL – Community or Enterprise? • The Community version of MySQL is free to download and use – http://www.oracle.com/us/products/mysql/mysqlcommunityserver/overview/index.html • Why use Enterprise, then? – Enhanced scalability – Management and online backup tools – Features for Security and Regulatory Compliance – http://www.oracle.com/us/products/mysql/mysqlenterprise/overview/index.html • What about Cluster? – Suited for particular needs, in-memory, more specialized, more complex – http://www.oracle.com/us/products/mysql/mysqlcluster/overview/index.html • Before you start, know the products 7
    7. 7. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Terminology • No schemas; users don't own objects • Instead, multiple databases per instance (almost like schemas) • Log files have different names – Binary logs, or binlogs, are similar to archived redo log files – InnoDB log files (ib_logfile) are like online redo logs – Error log is the alert log (you might have guessed that one!) • What is a storage engine? ... • Terminology is similar, with minor differences – eg: 8
    8. 8. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Terminology • MySQL code is modular – storage engine covers storage – tables, etc • Can think of it as a table type, but it's more than that • Default is InnoDB, which supports ACID, foreign keys, and much more – 'CREATE TABLE t (a int);' is the same as 'CREATE TABLE t (a int) ENGINE=InnoDB;' • Other storage engines exist for specialized needs – First S.E. was MyISAM – Others include Archive, ndb, etc – InnoDB will suffice in many cases • Storage Engine 9
    9. 9. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Terminology • Scale-up – buy a bigger, faster server with more storage • Scale-out – buy more “commodity” servers – Scale-out is common approach with MySQL – Divide the data into “shards” and spread it across servers and databases – Add rack units as needed – https://oracle2mysql.wordpress.com/2007/08/22/12/ • What is “scale-out” vs “scale-up”? 10
    10. 10. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | How to get and install MySQL • .rpm's are the simplest and most common way – “sudo yum install ...” – Get Enterprise packages from edelivery.oracle.com – Or, official community yum repo, see http://dev.mysql.com/doc/mysql-repo-excerpt/5.6/en/index.html – Creates mysql user, group, installs, sets up service – ready to go! • There are also debian packages • GUI installer for Windows • Manually - tar or zip files for more control over placement, etc • http://dev.mysql.com/doc/refman/5.6/en/installing.html • There are many ways... 11
    11. 11. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | How to get and install MySQL, continued • For testing, or other constraints – Docker: https://hub.docker.com/_/mysql/ – Pre-built Virtualbox VMs ● Enterprise: http://www.oracle.com/technetwork/server-storage/vm/overview/mysql-358840.html ● Community: http://www.oracle.com/technetwork/community/developer-vm/index.html#mysql – A popular community tool (not official Oracle) – MySQL Sandbox ● http://mysqlsandbox.net/ • There are many ways... 12
    12. 12. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | How will users connect? • Mysql command-line client – “mysql -u root -p” can connect to your new installation – Like using sql*plus, with a little less “plus” – Some sample commands to try: http://www.nparikh.org/unix/mysql.php – https://dev.mysql.com/doc/refman/5.6/en/mysql.html • MySQL Workbench for GUI – Development and DBA tools – Server and user admin (backups, auditing, configuration, and much more) – https://www.mysql.com/products/workbench , https://www.mysql.com/products/workbench/admin/ • How will you connect? 13
    13. 13. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL Privileges • Privileges depend on user, and the host they are connecting from – Eg, root can be set to only allow local connection – Or, a user or app can only connect from a certain host or subnet – Privileges may vary, depending on where the user is – This can lead to some surprises... ● Eg, https://oracle2mysql.wordpress.com/2007/08/24/playing-with-permissions/ • No roles, but Workbench simulates them for convenience – https://dev.mysql.com/doc/workbench/en/wb-mysql-connections-navigator-management-users-and-privileges.html ● Native MySQL security 14
    14. 14. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL Privileges, continued • Authentication plugins allow for more flexibility and integration – External authentication via PAM, Windows login IDs, LDAP, or Kerberos – Stronger encryption – Proxy users ● Roles? http://mysqlblog.fivefarmers.com/2015/04/08/emulating-roles-with-expanded-proxy-user-support-in-5-7-7/ ● Authentication plugins - http://dev.mysql.com/doc/refman/5.6/en/pluggable-authentication.html 15
    15. 15. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Things to be aware of... • Character sets and collations – In strings, does 'a'='A'? You may want to set your character sets and collations ● https://dev.mysql.com/doc/refman/5.6/en/charset.html • Case-sensitive table names – For tables, does 'TableName' = 'tablename'? Check lower_case_table_names ● https://dev.mysql.com/doc/refman/5.6/en/identifier-case-sensitivity.html • You commit without saying “commit”? set autocommit off – https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_autocommit • You might not have thought to even think of these things 16
    16. 16. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | System databases • mysql – Contains data about all databases, users, plugins, procedures, etc • information_schema – Contains metadata views ● (note: here databases are called schemas! See information_schema.schemata.) • performance_schema – Contains instrumentation about performance, highly configurable • SQL commands: SHOW DATABASES; USE dbname; SHOW TABLES; 17
    17. 17. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | System databases, continued • A sys schema is incorporated into coming 5.7 releases – http://mysqlserverteam.com/the-mysql-sys-schema-in-mysql-5-7-7/ – Contributed by Mark Leith – Available to install now, https://github.com/MarkLeith/mysql-sys/ • Also, some “helper” views and scripts to make performance_schema more readable – http://www.markleith.co.uk/ps_helper/ • Where is sys? (for advanced users...) 18
    18. 18. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL for Oracle DBAs • OK, so how do I administer? • • • Let's get to the DBA tasks and tools...
    19. 19. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL Server Administration • https://dev.mysql.com/doc/refman/5.6/en/server-administration.html – Contains details on the things you expect – file placements, configuration files, how to set variables, and more • Also references further reading on: – Tuning (InnoDB) – Backups – Replication • First, read the overview 20
    20. 20. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL Server Administration, continued • InnoDB buffer pool is like db buffer cache, crucial to set – innodb_buffer_pool_size and innodb_buffer_pool_instances, to start • InnoDB is highly configurable, take it one step at a time – https://dev.mysql.com/doc/refman/5.6/en/innodb-configuration.html • Running SHOW STATUS; and SHOW ENGINE INNODB STATUSG – Like running utlbstat and utlestat in older days – Compare outputs over time, deltas • • Tuning (especially InnoDB) 21
    21. 21. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL Server Administration, tuning continued • Enable slow query log for a quick start – mysqldumpslow – tool to analyze slow query log content – https://dev.mysql.com/doc/refman/5.6/en/mysqldumpslow.html • Performance_schema (and ps_helper) – Provide wait instrumentation • MySQL Enterprise Monitor (“MEM”) – Performance advisors – Query analyzer • OEM – use the MySQL plugin for Oracle Enterprise Manager – More on this to come... 22
    22. 22. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL Server Administration, continued • Generic methods: – Cold backups – shut down and copy files – Snapshots (eg LVM) • mysqldump provides logical backup, like export – Use –single-transaction option for InnoDB – Or, take mysqldump from a replication slave (...replication?) • MySQL Enterprise Backup (“MEB”) - “hot” backups for InnoDB • Backups 23
    23. 23. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL Server Administration, continued • Replication is a basic skill for a MySQL DBA • Easy to set up – Slaves replay changes from master, creating a copy – Uses binary logs from master to create relay logs on slave • Can offload heavy queries or backups to a slave • Simple, or complex: there are many possible options and configurations – http://dev.mysql.com/doc/refman/5.6/en/replication.html • Replication 24
    24. 24. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL for Oracle DBAs • Enterprise tools •
    25. 25. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL DBA tools • MySQL Utilities – free tools to simplify many DBA tasks – Simplify MySQL administration, replication, and much more – https://dev.mysql.com/downloads/utilities/ • MySQL Enterprise Backup – Online and incremental backups • MySQL Enterprise Monitor – Manage and monitor MySQL installations • Many more, including tools for encryption, firewall, and auditing – https://www.mysql.com/products/enterprise/ 26
    26. 26. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL for Oracle DBAs • Further questions and support •
    27. 27. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | For further questions and support • Enterprise licensing includes MySQL Support – https://www.mysql.com/support/ • For general understanding, the online manuals – http://dev.mysql.com/doc/ • For comparing products and features – http://www.mysql.com/products/enterprise/ • For the OEM MySQL plugin – http://dev.mysql.com/doc/mysql-em-plugin/en/index.html • Enterprise support 29
    28. 28. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | MySQL for Oracle DBAs • Q&A • • • Ben Krug, Senior MySQL Support Engineer • ben.krug@oracle.com •
    29. 29. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Safe Harbor Statement The preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. 31
    30. 30. Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |

    ×