making mysql administration a breeze - a look into a mysql dba's toolchest
DESCRIPTION
TRANSCRIPT
![Page 1: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/1.jpg)
<Insert Picture Here>
Making MySQL Administration a BreezeA look into a MySQL DBA's toolchest
Lenz GrimmerMySQL Community Relations Specialist
![Page 2: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/2.jpg)
Overview
• Tools for Linux/Unix only• Open Source Software• Toolkits (script collections) and individual tools with
a MySQL focus• Not covering generic base OS tools like vmstat, iostat or top
![Page 3: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/3.jpg)
Maatkit
• http://maatkit.org/• Perl script collection• >25 tools• All tools are standalone• Minimal dependencies• Docs embedded in the tools• Exhaustive test suite
![Page 4: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/4.jpg)
Openark kit
• http://code.openark.org/forge/openark-kit/• Python script collection• 10 tools• BSD License• Written by Shlomi Noach
![Page 5: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/5.jpg)
Kontrollkit
• http://kontrollsoft.com/software-kontrollkit• A collection of 13 scripts for making your daily
MySQL DBA responsibilities easier• Perl, Python, Shell• Formerly known as Monolith Toolkit• Maintained by Matt Reid (Kontrollbase)
![Page 6: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/6.jpg)
Hack MySQL Kit (hmk)
• http://hackmysql.com/• 4 tools (C, Perl)
–mysqlreport - Make easy-to-read MySQL status reports.
–mysqlsla - Simple, lightweight MySQL log parsing.
–mysqlidxchx - Checks tables for unused indexes.
–mysqlsniffer - MySQL protocol sniffer.• GPL• Written by Daniel Nichter (Maatkit)
![Page 7: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/7.jpg)
User account administrationUser account administration
![Page 8: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/8.jpg)
Securich
• http://www.securich.com/• Written by Darren Cassar (aka “MySQL Preacher”)• Implemented as Stored Routines• Roles & user groups• Cloning of user accounts• Flexible privilege assignment• Improved password handling • Fast blocking of user accounts
![Page 9: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/9.jpg)
oak-block-account
• Block or release connections for specific accounts • Without changing privileges• Optionally kill any existing connections
$ oak-block-account -u root \
–ask-pass --account-user=<someuser>
![Page 10: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/10.jpg)
MonitoringMonitoring
![Page 11: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/11.jpg)
innotop
• http://code.google.com/p/innotop/• MySQL/InnoDB transaction/status monitor, inspired
by mytop• Perl• Console based• Monitoring of
– Replication status– Queries– InnoDB Transactions, Locks...
![Page 12: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/12.jpg)
mycheckpoint
• http://code.openark.org/forge/mycheckpoint• Python• Monitoring utility with a strong emphasis on user
accessibility to monitored data• SQL oriented: charts, reports and advanced
metrics are generated on the fly with views.
![Page 13: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/13.jpg)
BackupBackup
![Page 14: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/14.jpg)
mk-parallel-dump/restore
• Multi-threaded SQL dumps• One subdirectory per DB• Dump Compression• Backups can be split up into chunks• Saves binlog position• Supports regular Expressions
![Page 15: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/15.jpg)
mydumper
• https://launchpad.net/mydumper• Developed in C (glib, pcre)• Parallel Data Dumps• Easy to parse output• Regular expressions• Consistency
– Snapshot across all threads– Stores Master/Slave binlog positions
![Page 16: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/16.jpg)
xtrabackup
• https://launchpad.net/percona-xtrabackup• Online backup for InnoDB / MyISAM• 2010-04-12: Version 1.2 (incl. Windows)• In my.cnf:[xtrabackup]target_dir = /home/backups
• Backup command:$ xtrabackup –backup
![Page 17: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/17.jpg)
mylvmbackup
• http://www.lenzg.net/mylvmbackup/• Perl Script• Fast creation of MySQL backups using LVM-
Snapshots (Linux)• Supports tar, rsync or rsnap to back up the data
(rdiff soon)• Archive names with timestamps
![Page 18: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/18.jpg)
Auditing/SecurityAuditing/Security
![Page 19: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/19.jpg)
oak-security-audit
• Regular, automatic checking of– Non-local root-accounts– Anonymous user accounts– Accounts without a hostname– Accounts using empty or identical passwords– Non-root accounts with full privileges
$ oak-security-audit \ -u root --ask-pass
![Page 20: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/20.jpg)
Performance tuningPerformance tuning
![Page 21: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/21.jpg)
MySQL Tuning Primer
• https://launchpad.net/mysql-tuning-primer• Shell script by Matthew Montgomery• Takes information from "SHOW STATUS LIKE..."
and "SHOW VARIABLES LIKE..." • Attempts to produce sane recommendations for
tuning server variables• Inspired by Gert Dewit's MySQL AR
![Page 22: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/22.jpg)
mysqltuner
• https://launchpad.net/mysqltuner• Perl• Examines the database environment• Provides performance tuning data and
recommendations.• Inspired by the MySQL Tuning Primer
$ mysqltuner.pl –recommend \ --config tuner-default.cnf
![Page 23: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/23.jpg)
mysqlreport
• Part of the HackMySQL toolkit• Well-documented Perl script• Reports important MySQL status values• Transforms SHOW STATUS values into an easy-
to-read report• A better alternative to manually interpreting SHOW
STATUS output• Must-read: “The Guide To Understanding
mysqlreport”
![Page 24: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/24.jpg)
mext
• http://code.google.com/p/aspersa/• Shell script• BSD license• Runs mysqladmin extended-status and
formats it nicely• Can also read from saved files• Supports incremental, differential and relative
output
![Page 25: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/25.jpg)
ReplicationReplication
![Page 26: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/26.jpg)
Monitoring replication
• mk-heartbeat– Uses separate heartbeat table– Frequently updates a time stamp on the master and
measures replication delay– Master and slave clocks must be in sync
• mk-table-checksum– Performs an online replication consistency check– Checksums MySQL tables on one or many servers
![Page 27: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/27.jpg)
Monitoring replication (Cont.)
• oak-get-slave-lag– Reads master status and iterates through SHOW
SLAVE STATUS– Triggers an error if threshold is reached
• oak-show-replication-status– Shows how far behind replicating slaves are on a given
master
![Page 28: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/28.jpg)
Replication maintenance
• oak-purge-master-logs– Purges master logs while considering the replicating
slaves
• mk-slave-find– Connects to a MySQL replication master and finds its
slaves– Prints a tree-like view of the replication hierarchy
• mk-slave-move– Move a MySQL slave around in the replication hierarchy
![Page 29: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/29.jpg)
Q & A
Questions, Comments?Questions, Comments?
![Page 31: Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest](https://reader034.vdocuments.mx/reader034/viewer/2022051512/540561398d7f72a6768b4bc3/html5/thumbnails/31.jpg)
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.