DBA Tutorial Kai Voigt Senior MySQL Instructor Sun Microsystems kai@sun.com Santa Clara, April 12, 2010

Similar documents
Part 3. MySQL DBA I Exam

Database Administration with MySQL

MySQL Administration and Management Essentials

SQL Databases Course. by Applied Technology Research Center. This course provides training for MySQL, Oracle, SQL Server and PostgreSQL databases.

Using MySQL for Big Data Advantage Integrate for Insight Sastry Vedantam

MySQL Backup and Security. Best practices on how to run MySQL on Linux in a secure way Lenz Grimmer <lenz@mysql.com>

Tushar Joshi Turtle Networks Ltd

D61830GC30. MySQL for Developers. Summary. Introduction. Prerequisites. At Course completion After completing this course, students will be able to:

Percona Server features for OpenStack and Trove Ops

Lenz Grimmer

White Paper. Optimizing the Performance Of MySQL Cluster

<Insert Picture Here> MySQL Security In A Cloudy World

Databases and SQL. Homework. Matthias Danner. June 11, Matthias Danner Databases and SQL June 11, / 16

MySQL Cluster Deployment Best Practices

MySQL Backups: From strategy to Implementation

Preparing for the Big Oops! Disaster Recovery Sites for MySQL. Robert Hodges, CEO, Continuent MySQL Conference 2011

SCALABLE DATA SERVICES

High Availability Solutions for the MariaDB and MySQL Database

W I S E. SQL Server 2008/2008 R2 Advanced DBA Performance & WISE LTD.

How to Optimize the MySQL Server For Performance

Configuring Apache Derby for Performance and Durability Olav Sandstå

Setting Up Specify to use a Shared Workstation as a Database Server

S W I S S O R A C L E U S E R G R O U P. N e w s l e t t e r 3 / J u l i with MySQL 5.5. Spotlight on the SQL Tuning

Java DB Performance. Olav Sandstå Sun Microsystems, Trondheim, Norway Submission ID: 860

Introduction. Part I: Finding Bottlenecks when Something s Wrong. Chapter 1: Performance Tuning 3

Oracle DBA Course Contents

Oracle 11g Database Administration

Configuring Apache Derby for Performance and Durability Olav Sandstå

Tier Architectures. Kathleen Durant CS 3200

MySQL OLTP (Transactional) Load Testing

Applications Manager Best Practices document

A Guide to Securing MySQL on Windows

MySQL 6.0 Backup. Replication and Backup Team. Dr. Lars Thalmann Dr. Charles A. Bell Rafal Somla. Presented by, MySQL & O Reilly Media, Inc.

MySQL Enterprise Backup User's Guide (Version 3.5.4)

Monitoring MySQL. Kristian Köhntopp

MySQL Storage Engines

MySQL Administrator Copyright 2004 MySQL AB

What s New in MySQL 5.7 Security Georgi Joro Kodinov Team Lead MySQL Server General Team

MySQL Enterprise Backup User's Guide (Version 3.5.4)

StoreGrid Backup Server With MySQL As Backend Database:

Oracle. Brief Course Content This course can be done in modular form as per the detail below. ORA-1 Oracle Database 10g: SQL 4 Weeks 4000/-

Partitioning under the hood in MySQL 5.5

MySQL for Beginners Ed 3

Hardening MySQL. Maciej Dobrzański maciek at

MySQL Backup and Recovery: Tools and Techniques. Presented by: René Senior Operational DBA

General DBA Best Practices

Mind Q Systems Private Limited

High-availability with Galera Cluster for MySQL

SQL Server 2012 Database Administration With AlwaysOn & Clustering Techniques

Welcome to Virtual Developer Day MySQL!

This guide specifies the required and supported system elements for the application.

Determining your storage engine usage

EMBL-EBI. Database Replication - Distribution

Ultimate Guide to Oracle Storage

Microsoft SQL Database Administrator Certification

MySQL synchronous replication in practice with Galera

How To Manage Myroster Database With Hp And Myroberty

Oracle Database 11g: SQL Tuning Workshop

ORACLE CORE DBA ONLINE TRAINING

MySQL Enterprise Monitor

MySQL always-up with Galera Cluster

MySQL 5.0 vs. Microsoft SQL Server 2005

Optimizing Performance. Training Division New Delhi

Optimizing TYPO3 performance

HYPERION SYSTEM 9 N-TIER INSTALLATION GUIDE MASTER DATA MANAGEMENT RELEASE 9.2

Optimizing the Performance of Your Longview Application

ORACLE DATABASE 11G: COMPLETE

XtraBackup: Hot Backups and More

SQL Server 2008 Designing, Optimizing, and Maintaining a Database Session 1

MySQL: Cloud vs Bare Metal, Performance and Reliability

UNIVERSITY AUTHORISED EDUCATION PARTNER (WDP)

MyOra 3.0. User Guide. SQL Tool for Oracle. Jayam Systems, LLC

Physical DB design and tuning: outline

Parallel Replication for MySQL in 5 Minutes or Less

Testing and Verifying your MySQL Backup Strategy

MySQL Security: Best Practices

Comparing MySQL and Postgres 9.0 Replication

MS SQL Performance (Tuning) Best Practices:

Best Practices for Using MySQL in the Cloud

Monitoreo de Bases de Datos

Oracle Database: SQL and PL/SQL Fundamentals NEW

StreamServe Persuasion SP5 Oracle Database

IBM DB2: LUW Performance Tuning and Monitoring for Single and Multiple Partition DBs

Full Text Search in MySQL 5.1 New Features and HowTo

DBMS Questions. 3.) For which two constraints are indexes created when the constraint is added?

DB2 for Linux, UNIX, and Windows Performance Tuning and Monitoring Workshop

Dave Stokes MySQL Community Manager

Hypertable Architecture Overview

FileMaker 11. ODBC and JDBC Guide

XtraBackup. Vadim Tkachenko CTO, Co-Founder, Percona Inc Percona Live SF Feb 2011

MySQL Replication. openark.org

ArcSDE Configuration and Tuning Guide for Oracle. ArcGIS 8.3

This document will list the ManageEngine Applications Manager best practices

FileMaker 13. ODBC and JDBC Guide

Real-time reporting at 10,000 inserts per second. Wesley Biggs CTO 25 October 2011 Percona Live

ORACLE INSTANCE ARCHITECTURE

Oracle Database 11g: SQL Tuning Workshop Release 2

Deploying MySQL with the Oracle ZFS Storage Appliance

MySQL Enterprise Backup User's Guide (Version 3.9.0)

<Insert Picture Here> Oracle Database Directions Fred Louis Principal Sales Consultant Ohio Valley Region

Transcription:

DBA Tutorial Kai Voigt Senior MySQL Instructor Sun Microsystems kai@sun.com Santa Clara, April 12, 2010

Certification Details http://www.mysql.com/certification/ Registration at Conference Closed Book Exams Non-Disclosure and Logo Usage Agreements 70 multiple-choice questions 90 minutes

MySQL Certification Study Guide http://www.mysql.com/certification/studyguides

New DBA 5.1 Hands On Exams Online real life tasks Need to pass 5 out of 5 mandatory tasks Need to pass 5 out of 10 optional tasks

Exam Content DBA 1 MySQL Architecture (10%) Starting, Stopping, and Configuring MySQL (20%) Client Programs for DBA Work (5%) Character Set Support (5%) Locking (10%) Storage Engines (20%) Data (Table) Maintenance (10%) The INFORMATION_SCHEMA Database (5%) Data Backup and Recovery Methods (15%)

Exam Content DBA 2 Stored Routines (5%) User Management (20%) Securing the Server (10%) Upgrade-Related Security Issues (5%) Optimizing Queries (15%) Optimizing Schemas (15%) Optimizing the Server (10%) Interpreting Error Messages (5%) Optimizing the Environment (5%) Scaling MySQL (10%)

Exam Content DBA 1 MySQL Architecture (10%) Starting, Stopping, and Configuring MySQL (20%) Client Programs for DBA Work (5%) Character Set Support (5%) Locking (10%) Storage Engines (20%) Data (Table) Maintenance (10%) The INFORMATION_SCHEMA Database (5%) Data Backup and Recovery Methods (15%)

Client/Server Overview OS independancy C Client Library Connectors

Communication Protocols Windows Only: Named Pipes, Shared Memory --skip-networking Unix Sockets vs TCP/IP

SQL Parser & Storage Engines Two Tiers Storage Engines Independance

How MySQL uses Disk Space Data Directory InnoDB Table Space

How MySQL Uses Memory One Connection = One Thread Grant Table Buffer Key Buffer Cache Table Cache

Exam Content DBA 1 MySQL Architecture (10%) Starting, Stopping, and Configuring MySQL (20%) Client Programs for DBA Work (5%) Character Set Support (5%) Locking (10%) Storage Engines (20%) Data (Table) Maintenance (10%) The INFORMATION_SCHEMA Database (5%) Data Backup and Recovery Methods (15%)

Types of MySQL Distributions tar & RPM Binaries vs self-built

Starting and Stopping, Windows Pre-initialized Data Directory Multiple mysqld Binaries --console Option Running mysql command line client Install mysqld as a service

Starting and Stopping, Unix RPM: user, group, data directory Data Directory: /var/lib/mysql mysqld, mysqld_safe, mysql.server How to stop a MySQL server mysqld writes to stdout

Runtime MySQL Configuration my.cnf / my.ini Option File vs Command Line General Startup Options

Log and Status Files Problems with Logging General Log Slow Query Log Queries not using indexes

Loading Time Zone Tables mysql_tzinfo_to_sql script

Security-Related Configuration Passwords Filesystem Access

SQL Mode Use How to configure

Upgrading MySQL Manual and Release Notes Basic Procedure

Exam Content DBA 1 MySQL Architecture (10%) Starting, Stopping, and Configuring MySQL (20%) Client Programs for DBA Work (5%) Character Set Support (5%) Locking (10%) Storage Engines (20%) Data (Table) Maintenance (10%) The INFORMATION_SCHEMA Database (5%) Data Backup and Recovery Methods (15%)

Client Programs mysql Command Line Client mysqladmin mysqlimport mysqldump

Exam Content DBA 1 MySQL Architecture (10%) Starting, Stopping, and Configuring MySQL (20%) Client Programs for DBA Work (5%) Character Set Support (5%) Locking (10%) Storage Engines (20%) Data (Table) Maintenance (10%) The INFORMATION_SCHEMA Database (5%) Data Backup and Recovery Methods (15%)

Character Set Support Performance Issues Disk Usage, Disk I/O, Memory Usage CHAR vs VARCHAR

Break

Exam Content DBA 1 MySQL Architecture (10%) Starting, Stopping, and Configuring MySQL (20%) Client Programs for DBA Work (5%) Character Set Support (5%) Locking (10%) Storage Engines (20%) Data (Table) Maintenance (10%) The INFORMATION_SCHEMA Database (5%) Data Backup and Recovery Methods (15%)

Locking Concepts Read vs Write Locks Explicit vs Implicit Locks Advisory Locks Table vs Row Level Locks Deadlocks

Explicit Table Locking LOCK TABLE READ LOCAL Releasing Table Locks Locking multiple tables

Exam Content DBA 1 MySQL Architecture (10%) Starting, Stopping, and Configuring MySQL (20%) Client Programs for DBA Work (5%) Character Set Support (5%) Locking (10%) Storage Engines (20%) Data (Table) Maintenance (10%) The INFORMATION_SCHEMA Database (5%) Data Backup and Recovery Methods (15%)

MySQL Storage Engines Things to consider Default Engine Determine the storage engine Required Engines: MyISAM, Memory

The MyISAM Engine MERGE, FULLTEXT features LOW_PRIORITY, HIGH_PRIORITY Out of Disk Space No Deadlocks Fixed Format Compressed Format

The MERGE Engine Table Locking No Deadlocks

The InnoDB Engine Tablespace Multiversioning Deadlocks Auto-Recovery Foreign Keys Per-Table Tablespace Transactions SAVEPOINT Implicit Commits Isolation Levels

The MEMORY Engine General Characteristics BTREE vs HASH Indexes

The FEDERATED Engine Concepts of FEDERATED Engine How to define

Exam Content DBA 1 MySQL Architecture (10%) Starting, Stopping, and Configuring MySQL (20%) Client Programs for DBA Work (5%) Character Set Support (5%) Locking (10%) Storage Engines (20%) Data (Table) Maintenance (10%) The INFORMATION_SCHEMA Database (5%) Data Backup and Recovery Methods (15%)

SQL Statements CHECK TABLE REPAIR TABLE ANALYZE TABLE OPTIMIZE TABLE Table Statistics

Client and Utility Programs myisamchk mysqlcheck

MyISAM Auto-Repair --myisam-recover

Exam Content DBA 1 MySQL Architecture (10%) Starting, Stopping, and Configuring MySQL (20%) Client Programs for DBA Work (5%) Character Set Support (5%) Locking (10%) Storage Engines (20%) Data (Table) Maintenance (10%) The INFORMATION_SCHEMA Database (5%) Data Backup and Recovery Methods (15%)

INFORMATION_SCHEMA List of Tables Read-Only INFORMATION_SCHEMA vs SHOW Limitations

Exam Content DBA 1 MySQL Architecture (10%) Starting, Stopping, and Configuring MySQL (20%) Client Programs for DBA Work (5%) Character Set Support (5%) Locking (10%) Storage Engines (20%) Data (Table) Maintenance (10%) The INFORMATION_SCHEMA Database (5%) Data Backup and Recovery Methods (15%)

Introduction Recovery = Backup + Binary Log Principles of MySQL Backup Binary vs Text Backup

Making Binary Backups MyISAM Tables InnoDB Tables Binary Portability

Making Text Backups SELECT INTO OUTFILE mysqldump

Replication as an Aid to Backup Hot Backup How to Backup a Slave

Data Recovery Load mysqldump File Binary Log mysqlbinlog --start-position --stop-position

End of Part 1

DBA Tutorial Kai Voigt Senior MySQL Instructor Sun Microsystems kai@sun.com Santa Clara, April 20, 2009

Certification Details http://www.mysql.com/certification/ Registration at Conference Closed Book Exams Non-Disclosure and Logo Usage Agreements 70 multiple-choice questions 90 minutes

MySQL Certification Study Guide http://www.mysql.com/certification/studyguides

New DBA 5.1 Hands On Exams Online real life tasks Need to pass 5 out of 5 mandatory tasks Need to pass 5 out of 10 optional tasks

Exam Content DBA 2 Stored Routines (5%) User Management (20%) Securing the Server (10%) Upgrade-Related Security Issues (5%) Optimizing Queries (15%) Optimizing Schemas (15%) Optimizing the Server (10%) Interpreting Error Messages (5%) Optimizing the Environment (5%) Scaling MySQL (10%)

Stored Procedures DEFINER/INVOKER Check incoming Data Restrict incoming Data Reduce Amount of Data Exchange

Exam Content DBA 2 Stored Routines (5%) User Management (20%) Securing the Server (10%) Upgrade-Related Security Issues (5%) Optimizing Queries (15%) Optimizing Schemas (15%) Optimizing the Server (10%) Interpreting Error Messages (5%) Optimizing the Environment (5%) Scaling MySQL (10%)

User Account Management Username + Hostname Wildcards Grant Tables in mysql Database Global, Database, Table, Column, Routine Level ALL PRIVILEGES USAGE Privilege Grants Cache GRANT/REVOKE CREATE/DROP USER IDENTIFIED BY WITH GRANT OPTION SHOW GRANTS SET PASSWORD

Client Access Control Two Stages Wildcards Hostnames, then Usernames

Exam Content DBA 2 Stored Routines (5%) User Management (20%) Securing the Server (10%) Upgrade-Related Security Issues (5%) Optimizing Queries (15%) Optimizing Schemas (15%) Optimizing the Server (10%) Interpreting Error Messages (5%) Optimizing the Environment (5%) Scaling MySQL (10%)

Filesystem Security Don t run mysql as root Log Files should be kept secret

Network Security MySQL user names!= OS user names mysql_secure_installation Script mysql Database FILE Privilege SHOW PROCESSLIST SUPER Privilege --skip-networking --bind-address

FEDERATED Table Security Connect String Storage Prevent Users from seeing password

Exam Content DBA 2 Stored Routines (5%) User Management (20%) Securing the Server (10%) Upgrade-Related Security Issues (5%) Optimizing Queries (15%) Optimizing Schemas (15%) Optimizing the Server (10%) Interpreting Error Messages (5%) Optimizing the Environment (5%) Scaling MySQL (10%)

Upgrade-Related Security Issues Upgrading Privilege Tables Strict SQL Mode Error for Division by Zero Zero Dates, Null Dates

Exam Content DBA 2 Stored Routines (5%) User Management (20%) Securing the Server (10%) Upgrade-Related Security Issues (5%) Optimizing Queries (15%) Optimizing Schemas (15%) Optimizing the Server (10%) Interpreting Error Messages (5%) Optimizing the Environment (5%) Scaling MySQL (10%)

Identifying Candidates for Analysis Binary Log Slow Query Log SHOW PROCESSLIST

EXPLAIN columns: possible_keys, key, ref, id Joins: Multiply row numbers Order of Tables type: eq_ref, range, const Multi-Column Indexes STRAIGHT JOIN

MyISAM Index Caching Global vs Table Level Key Buffer SET, CACHE INDEX, LOAD INDEX INTO

Break

Exam Content DBA 2 Stored Routines (5%) User Management (20%) Securing the Server (10%) Upgrade-Related Security Issues (5%) Optimizing Queries (15%) Optimizing Schemas (15%) Optimizing the Server (10%) Interpreting Error Messages (5%) Optimizing the Environment (5%) Scaling MySQL (10%)

General Table Optimization PROCEDURE ANALYSE() Normalization vs Denormalization

MyISAM-Specific Optimizations Compressed Tables Dynamic vs Fixed Row Format Split Table into Dynamic and Fixed Parts

InnoDB-Specific Optimizations Size of Primary Keys SELECT COUNT(*) Group Statements into Transactions OPTIMIZE TABLE

Exam Content DBA 2 Stored Routines (5%) User Management (20%) Securing the Server (10%) Upgrade-Related Security Issues (5%) Optimizing Queries (15%) Optimizing Schemas (15%) Optimizing the Server (10%) Interpreting Error Messages (5%) Optimizing the Environment (5%) Scaling MySQL (10%)

Tuning Memory Parameters Table Cache Small Default Values MyISAM Key Buffer InnoDB Buffer Pool Disabling InnoDB read_buffer_size Sort Buffer Join Buffer max_allowed_packet

Using the Query Cache Characteristics query_cache_size query_cache_limit SHOW STATUS LIKE qcache_%

Exam Content DBA 2 Stored Routines (5%) User Management (20%) Securing the Server (10%) Upgrade-Related Security Issues (5%) Optimizing Queries (15%) Optimizing Schemas (15%) Optimizing the Server (10%) Interpreting Error Messages (5%) Optimizing the Environment (5%) Scaling MySQL (10%)

Diagnostics Error Log long_query_time Slow Query Log mysqldumpslow

Exam Content DBA 2 Stored Routines (5%) User Management (20%) Securing the Server (10%) Upgrade-Related Security Issues (5%) Optimizing Queries (15%) Optimizing Schemas (15%) Optimizing the Server (10%) Interpreting Error Messages (5%) Optimizing the Environment (5%) Scaling MySQL (10%)

Memory and Disks Memory is important Disk Seek Time is important RAID Seperate Log Files and Data Directory Using Symlinks Filesystem Selection

Network and OS Latency and Throughput Process Limits max_connections

Exam Content DBA 2 Stored Routines (5%) User Management (20%) Securing the Server (10%) Upgrade-Related Security Issues (5%) Optimizing Queries (15%) Optimizing Schemas (15%) Optimizing the Server (10%) Interpreting Error Messages (5%) Optimizing the Environment (5%) Scaling MySQL (10%)

Using Multiple Servers Requirements Shared InnoDB tables

Replication General Features Master-Slave MASTER_LOG_FILE, MASTER_LOG_POS master.info Relay Log Binary Log IO Thread, SQL Thread Unique Server IDs

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.

Good Luck!