MySQL Performance Tuning für Oracle-DBA'sFromDual GmbH
MySQL Performance Tuning
* Was ist Performance?
* Was kostet Performance?
* Tuning Massnahmen
* MySQL Konfiguration
* Wo schauen?
* Langsame Abfragen finden
* Optimiere das Query!
* Monitoring
Der Datenbank-Backup ist gemacht - was nun?FromDual GmbH
* Datenbank-Backup – welcher Zweck?
* Tauglichkeit des Backup, Verifikation
* Echtdaten vollständig nutzen
* Dem Datenschutz genügen
* Material für die Entwicklung
* Automatisierung
MySQL Performance Tuning für Oracle-DBA'sFromDual GmbH
MySQL Performance Tuning
* Was ist Performance?
* Was kostet Performance?
* Tuning Massnahmen
* MySQL Konfiguration
* Wo schauen?
* Langsame Abfragen finden
* Optimiere das Query!
* Monitoring
Der Datenbank-Backup ist gemacht - was nun?FromDual GmbH
* Datenbank-Backup – welcher Zweck?
* Tauglichkeit des Backup, Verifikation
* Echtdaten vollständig nutzen
* Dem Datenschutz genügen
* Material für die Entwicklung
* Automatisierung
Weltweite Produktionsdatenverwaltung mit MySQL-ReplikationFromDual GmbH
Weltweite Produktionsdatenverwaltung mit MySQL
* Ausgangslage
* Probleme die sich stellen
* Wer darf welche Daten kriegen?
* Wie werden Daten verteilt?
* Produktionsdaten zurück?
* MySQL multi-Source Replikation
* Bertriebsverantwortung
* Hochverfügbarkeit
* Sensitive Daten
* Wer darf welche Daten sehen?
* MySQL Row Filterung
* Nachträgliche Forderungen
MySQL High Availability Solutions: MySQL Replication, MySQL Read-Scaleout, Master/Slave Replication, Master/Master Replication, active/passive fail-over Cluster with SAN or DRBD, Galera Cluster for MySQL, MySQL NDB Cluster
Weltweite Produktionsdatenverwaltung mit MySQL-ReplikationFromDual GmbH
Weltweite Produktionsdatenverwaltung mit MySQL
* Ausgangslage
* Probleme die sich stellen
* Wer darf welche Daten kriegen?
* Wie werden Daten verteilt?
* Produktionsdaten zurück?
* MySQL multi-Source Replikation
* Bertriebsverantwortung
* Hochverfügbarkeit
* Sensitive Daten
* Wer darf welche Daten sehen?
* MySQL Row Filterung
* Nachträgliche Forderungen
MySQL High Availability Solutions: MySQL Replication, MySQL Read-Scaleout, Master/Slave Replication, Master/Master Replication, active/passive fail-over Cluster with SAN or DRBD, Galera Cluster for MySQL, MySQL NDB Cluster
In loser Folge werden Tipps und Tricks aus allen Bereichen der Programmierung in Lotus Notes/Domino vorgestellt. @Formula, LotusScript, XPages, LS2CApi.
Wie konfiguriere ich den Domino Designer?
Welche kostenlosen Tools können mir meine Arbeit erleichtern?
Warum ist es wichtig, richtig zu "dimmen"?
Richtext kann mit LotusScript im Backend nicht in Richtext eingefügt werden. Oder etwa doch? @Transform / @Sort. Was kann man denn damit machen?
8.5.3, was gibt es Neues im Bereich @Formula / LotusScript.
Zielgruppe sind alle, die sich mit Applikationsentwicklung beschäftigen. Anfänger und "alte Hasen"; es ist für jeden etwas dabei.
Kenntnisse: Grundlagen der Entwicklung in Lotus Notes/Domino
bccon-2014 adm01 tipps-und-skripts-aus-dem-leben-eines-ibm-connections-adminsICS User Group
Gekürzter Vortrag der Connect 2014 Präsentation "BP307 Practical Solutions for Connections Administrators – Tips and Scripts for Your Daily Business" Tipps und Skripts rund um die Connections Installation, Konfiguration, Dokumentation und Troubleshooting. Wir zeigen Skripte die jedem Administrator das Leben erleichtern können.
Download der Skripts: http://github.com/stoeps13/ibmcnxscripting
Tipps und Skripts aus dem Leben eines Connections AdminsKlaus Bild
Gekürzter Vortrag der Connect 2014 Präsentation "BP307 Practical Solutions for Connections Administrators – Tips and Scripts for Your Daily Business" Tipps und Skripts rund um die Connections Installation, Konfiguration, Dokumentation und Troubleshooting. Wir zeigen Skripte die jedem Administrator das Leben erleichtern können. Download der Skripts: http://github.com/stoeps13/ibmcnxscripting
MariaDB/MySQL pitfalls - And how to come out again...FromDual GmbH
During the last conferences the audience was asking for more war stories than just new features.
In this presentation we have a look at the most often seen problems as a MariaDB/MySQL consultant in field.
MariaDB / MySQL tripping hazard and how to get out again?FromDual GmbH
The document discusses common pitfalls and mistakes when using MariaDB/MySQL databases and how to avoid or recover from them, including issues related to different versions and forks of MariaDB and MySQL not being fully compatible, keeping implementations simple to avoid unnecessary complexity, and problems that can occur from table locking, disk space usage, and other operational concerns.
In this presentation we discuss the New Features of MariaDB 10.4. First we give a short overview of the MariaDB Branches and Forks. Then we talk about the announced IPO. Technically we cover topics like Authentication, Accounts, InnoDB, Optimizer improvements, Application-Time Period Tables the new Backup Stage Galera 4 and other changes...
MariaDB 10.4 became General Available (GA = ready for production) this summer. So it is time to look at the new Features in MariaDB 10.4. After a short intro about history we look for the reason of broad usage of MariaDB nowadays. Most important improvements where in User Authentication, InnoDB improvements, and Optimizer enhancements. A completely New Feature is Application-Time Period Tables. Backup got a new Locking behaviour so LVM snapshots are possible and officially supported now. And last but not least MariaDB 10.4 comes with Galera 4.
MariaDB 10.2 New Features for Developers, Administrators and DevOps. Window Functions, Common Table Expressions, Check Constraints, GeoJSON, GIS, JSON, Oracle compatibility and MariaDB Connectors
Reading MySQL fingerprints
Every MySQL Database has its typical fingerprints. They can be seen with SHOW GLOBAL STATUS;
How you interprete them you will find in this presentation.
This document provides an overview of Galera Cluster for MySQL. It discusses how Galera Cluster allows for highly available, multi-master replication across multiple nodes through synchronous replication. It also covers topics like installation, configuration, operations including rolling restarts, load balancing, and catching node state changes. The document includes demonstrations of these concepts.
This document discusses high availability with Galera Cluster for MySQL. It provides an overview of Galera Cluster, including its advantages like active-active multi-master clusters and automatic node membership control. It also covers Galera Cluster installation, configuration, operations like initial cluster start and rolling restarts, load balancing, and online schema upgrades.
MySQL indexing is one of the areas where you can achieve the most performance gains. In this presentation we have a short look how we can improve MySQL performance with indexing...
The document discusses MySQL indexing and optimization. It provides an overview of indexing in MySQL, including what indexes are, how they are created, and how MySQL uses indexes to optimize queries. The document also discusses best practices for indexing, including identifying missing indexes, avoiding unnecessary indexes, and ensuring indexes have good selectivity to maximize query performance.
This document discusses MySQL performance tuning. It covers high availability solutions, MySQL system and status variables, memory usage, storage engines like InnoDB and MyISAM, monitoring tools, and the Performance Schema. Tuning levers include configuring variables related to caching, buffers, threads, and storage engines. Monitoring helps identify optimization opportunities.
3. www.fromdual.com
3 / 26
Inhalt
Backup/Recovery
➢
Einstimmung
➢
Was kann schief gehen?
➢
Randbedingungen
➢
MySQL Backup Methoden
➢
Backup mit mysqldump
➢
Backup mit MySQL Enterprise Backup
➢
Backup mit LVM Snapshot
➢
logischer Restore
➢
physischer Restore
➢
Point-in-Time-Recovery
➢
Restore-Test
➢
Master/Slave-Replikation
➢
Tipps und Tricks
➢
FromDual Backup/Recovery Manager
4. www.fromdual.com
4 / 26
Einstimmung
● Wer von Euch macht Backups?
→ Alles Mädchen! Backup ist nix für Cowboys!
● Wer von Euch hat HA und brauch daher kein
Backup?
● Was ist mit Ups!-Queries?
UPDATE employee SET bonus + 500
WHERE id + 42;
Rows matched: 3000 Changed: 3000 Warnings:
0
5. www.fromdual.com
5 / 26
Was kann schief gehen?
● Logische Fehler
● Ups-Queries
● Admin, Entwickler auf Produktion statt Test.
● Schlecht getestete Releases
● Technische Korruption der DB Blocks
● I/O System (Controller, etc.), Memory
● Virtualisierung (Host swappen, overcommitten!)
● Hardware
● schnell kaputt → Glück gehabt
● Langsam kaputt → Sch.....ade!
● Rechenzentrum down
● Blitzschlag, Erbeben, Stromausfall, Link down = Desaster
● Was ist am wahrscheinlichsten?
7. www.fromdual.com
7 / 26
MySQL Backup Methoden
● Wie macht Ihr Backups?
● MySQL: 2 Typen von Backups:
● Logische Backups
● Physische Backups
● MySQL: 3 Backup-Möglichkeiten:
● Logisches Backup mit mysqldump
● Physisches Backup mit MySQL Enterprise
Backup (MEB)
● Physisches Backup mit LVM Snapshots
8. www.fromdual.com
8 / 26
Backup mit mysqldump
● Wer verwendet noch MyISAM?
● Logisches Backup mit mysqldump:
● singletransaction: Konsistenz
● masterdata: Binary Log Position
# für InnoDB
mysqldump user=root password alldatabases
singletransaction
flushprivileges masterdata=1 flushlogs
triggers routines events
hexblob > full_dump.sql
9. www.fromdual.com
9 / 26
Eigenschaften von mysqldump
● Jede Row wird angelangt
● Ausgabe ist „menschenlesbar“
● InnoDB read/write
● MyISAM read only (Lock für Writes)
● Problem: Restore dauert lange bei grossen
Datenmengen oder schwacher Hardware
→ Faustregel: DB muss in RAM passen
10. www.fromdual.com
10 / 26
Backup mit MEB
● Physisches Backup mit MEB
● MEB = MySQL Enterprise Backup
● In 2 Phasen:
● 1. Backup
● 2. Apply-Log
mysqlbackup user=root notimestamp /tmp/backup
mysqlbackup user=root notimestamp
–applylog /tmp/backup
11. www.fromdual.com
11 / 26
Eigenschaften von MEB
● Kopie der Dateien auf Filesystem-Ebene
● Binäres Kopieren von Files/Blocks
● InnoDB read/write
● MyISAM read only (Lock für Writes)
● Grosser Vorteil: Restore dauert in etwa so
lang wie Backup!!!
● Problem: Korruptionen werden nicht
entdeckt
12. www.fromdual.com
12 / 26
LVM Snapshot
● Physisches Backup mit LVM Snapshot
● DB Befehle und O/S Befehle in selber
Session!
FLUSH TABLES WITH READ LOCK;
! lvcreate size=10G snapshot name=dbbackup
/dev/lvm/databases
UNLOCK TABLES;
! mount /dev/lvm/databases /mnt/dbbackup
! tar czf /dev/rmt0 /mnt/dbbackup # teuer!
! umount /mnt/dbbackup
! lvremove /dev/lvm/databases
13. www.fromdual.com
13 / 26
Eigenschaften von LVM
Snapshots
● Kopie der Dateien auf Filesystem-Ebene
● Binäres Kopieren von Files/Blocks
● Kurzer Lock für Schreiben (< 5 Sekunden)
● Grosser Vorteil: Restore dauert in etwa so lang wie
Backup!!!
● Einschränkung: Muss root Rechte haben
● Problem: Korruptionen werden nicht entdeckt
● mylvmbackup: http://www.lenzg.net/mylvmbackup/
mylvmbackup user=root innodb_recover
mycnf=/etc/my.cnf vgname=lvm lvname=dbbackup
backuptype=tar
14. www.fromdual.com
14 / 26
Restore (mysqldump)
● Leere Datenbank neu anlegen:
● Logisches Backup zurückspielen:
mysql_install_db datadir=/var/lib/mysql
user=mysql
# MySQL 5.7:
mysqld initializeinsecure user=mysql
datadir=/var/lib/mysql
service mysql start
mysql user=root < full_dump.sql
15. www.fromdual.com
15 / 26
Restore (physisch)
● DB stoppen und Zielverzeichnis leeren
● Datenbank zurückspielen:
service mysql stop
rm rf /var/lib/mysql
mysqlbackup copyback /tmp/backup
18. www.fromdual.com
18 / 26
Restore testen
● Wer hat schon Restore (freiwillig) getestet?
Empfehlung: Unbedingt regelmässig tun!
● Grund:
● Übung
● Gewissheit, dass es funktioniert
● Erfahrung, wie lange es dauert
● Fehler die wir kürzlich gesehen haben:
● Tar-File wurde seit 30 Tage von Tape-Library korrumpiert... :-(
● Binary-Logs fehlten in Backup (Lücken!) :-(
● Events/Statements fehlten in Backup (log_slave_updates
= 1)
19. www.fromdual.com
19 / 26
Restore-Test
Prod QA Test Dev
EntwicklungProduktion
DBA Entwickler
bck
nächtlicher
Restore
TestDB1: ja
TestDB2: nein
DevDBa: ja
DevDBb: nein
DevDBc: ja
21. www.fromdual.com
21 / 26
Tipps und Tricks I
● Backups regelmässig (täglich?) machen!
● Binary Log einschalten (log_bin)
● Binary Log Position zu Backup merken (
masterdata)
● Lesen und Schreiben von unterschiedlichen
Platten
● Backups und Binary Logs nicht auf selben Platten
wie Daten ablegen.
● DB Backup mit Filesystem-Backup wegsichern
(Timing beachten)
● Schlechte Erfahrung mit mysqldump direkt auf
NFS
22. www.fromdual.com
22 / 26
Tipps und Tricks II
● Korrupte Daten werden bei physischen
Backups nicht bemerkt:
● Virtualisierung: InnoDB Korruptionen?
mysqldump alldatabases > /dev/null
● Struktur Dump von Zeit zu Zeit erstellen.
● Ist nicht sooo teuer!
● mysqldump alldatabases nodata
● Ins VCS einchecken?
● Backups regelmässig testen!
26. www.fromdual.com
26 / 26
Q & A
Fragen ?
Diskussion?
Wir haben Zeit für ein persönliches Gespräch...
● FromDual bietet neutral und unabhängig:
● Beratung
● Remote-DBA
● Support für MySQL, Galera, Percona Server und MariaDB
● Schulung
www.fromdual.com/presentations