mysql una introduccion tecnica

58
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 1

Upload: keith-hollman

Post on 27-Jan-2015

147 views

Category:

Technology


6 download

DESCRIPTION

MySQL A Technical Introduction in Spanish. Some basics around getting started with MySQL if your database competency lies in another technology. Based on another presentation, it steps further into installation options, configuration and basic admin tasks.

TRANSCRIPT

Page 1: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.1

Page 2: MySQL Una Introduccion Tecnica

MySQL: Una Introducción Técnica.Keith HollmanMySQL Principal Sales Consultant

[email protected]

Page 3: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.3

The following 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.

Safe Harbor Statement

Page 4: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.4

Agenda

MySQL introducción: Arquitectura y Componentes.

Enterprise Edition & Community.

Instalación.

Seguridad.

Empezando con MySQL Server.

Tareas de Administración.

Page 5: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.5

MySQL Introducción: Software, Arquitectura y Componentes

Page 6: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.6

Empresas Líderes dependen de MySQL

Page 7: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.7

MySQL Introducción

15 MM Installations 70.000 download/day 3rd DB in the World LAMP Stack Facebook: 190.000 fans growing 35% Y on Y 1st DB in the Cloud 3.000 ISV and OEMs 9 out of 10 top Universities 9 out of 10 top Web properties

Page 8: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.8

MySQL Introducción

Community www.mysql.com/downloads Opensource, GPLv2. Enterprise edelivery.oracle.com product pack “MySQL Database”

Enterprise Standard, Enterprise, Carrier Grade Edition. Embedded Classic (MySQL Essentials), Standard, Enterprise, Carrier

Grade Edition.

Paquetes instaladores: rpm, msi. Ficheros comprimidos: tar.gz, MSWin zip “no installer”.

Software

Page 9: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.9

MySQL IntroducciónArquitectura y Componentes

Page 10: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.10

MySQL Introducción

Modelo de Procesamiento– 1ª capa: mysqld parsea, optimiza & ejecuta SQL para leer / escribir.

– 2ª capa: Depende del Storage Engine.

¿Por qué elegiría un Storage Engine en particular?– Almacenamiento, transaccional / ACID, bloqueos / integridad referencial,

optimización (extrayendo / escribiendo datos), funcionalidades especiales.

– Depende del funcionamiento que se quiere conseguir desde la aplicación.

Transparente al usuario final.

Arquitectura y Componentes

Page 11: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.11

MySQL Introducción

¿Necesitas que varias aplicaciones con diferente codificación se conecten al mismo servidor MySQL?

– Connector/Net, Connector/J, Connector/Python, Connector/ODBC, Connector/C (libmysql), Connector/C++, MySQL native driver for PHP (mysqlnd), libmysqld (mysql embebido).

¿Qué configuración tiene que tener?– Connection pooling, balanceo de carga, failover, preparados para entornos

Replica (lect./escr.), cambiar entre distintos SQLModes, etc.

– Client / server diferenciación / separación, reducir tamaños de instalación.

¿Quieres saber más? http://dev.mysql.com/doc/refman/5.6/en/connectors-apis.html

Conectores / APIs

Page 12: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.12

Enterprise Edition y Community.

Page 13: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.13

CommunityEnterprise MySQL

http://edelivery.oracle.com

http://edelivery.oracle.com

http://www.mysql.com

http://www.mysql.com

Ediciones de MySQLEnterprise y Open Source

Page 14: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.14

Funcionalidades Standard SE Enterprise EE Cluster CGE

MySQL Database ✔ ✔ ✔

MySQL Connectors ✔ ✔ ✔

MySQL Replication ✔ ✔ ✔

MySQL Partitioning ✔ ✔

MySQL Workbench SE ✔ ✔ ✔

Storage Engine: MyISAM ✔ ✔ ✔

Storage Engine: InnoDB ✔ ✔ ✔

Storage Engine: NDB ✔

MySQL Enterprise Monitor ✔ ✔

MySQL Enterprise Backup ✔ ✔

MySQL Cluster Manager ✔

MySQL Enterprise Security ✔ ✔

MySQL Enterprise Scalability ✔ ✔

Disponible sólo en la edición comercial.✔

MySQL Ediciones

Page 15: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.15

Oracle Premier Lifetime Support

Oracle Product Certifications/Integrations

MySQL Enterprise High Availability

MySQL Enterprise Security

MySQL Enterprise Scalability

MySQL Enterprise Backup

MySQL Enterprise Monitor/Query Analyzer

MySQL Workbench

MySQL Enterprise Audit

MySQL Enterprise EditionLos Niveles más altos en Seguridad, Rendimiento y Disponibilidad.

Page 16: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.16

MySQL default thread-handling – excelente rendimiento, puede limitar escalabilidad según y como crecen los usuarios.

– Las conexiones se asignan a 1 thread para la duración de la conexión, el mismo thread para todas las sentencias.

Thread Pool API, permite a los usuarios crea su propio pool de threads. MySQL Thread Pool mejora el rendimiento de manera sostenido,

escalando en unísono con el crecimiento de los usuarios.– El Thread Pool contiene un número de thread groups configurables,

gestionando hasta 4096 threads re-utilizables por grupo.– Los Threads se priorizan, sentencias se encolan para limitar las ejecuciones

concurrentes y la carga en el servidor, mejora la escalabilidad al mismo ritmo que crecen las conexiones.

MySQL Enterprise ScalabilityMySQL Thread Pool

Page 17: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.17

MySQL Audit API – permite a los usuario a añadir auditado. MySQL Enterprise Audit ofrece políticas de auditoría predeterminadas. Por defecto log de todas las conexiones, logins, actividad SQL en

todas o instancias MySQL específicas. Políticas definido por usuario, filtros y rotación de logs. activación / desactivión dinámica: no requiere reinicio. Salida XML según la especificación de auditado

Ayuda a las aplicaciones MySQL cumplir con los estándares regulatorias. (LOPD, HIPAA, Sarbanes-Oxley, PCI, etc.)

Nuevo!MySQL Enterprise AuditAuditado basado en políticas para aplicaciones MySQL

Page 18: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.18

2. El usuario Joe conecta y consulta a Server1

MySQL Enterprise Audit Flow

1. El DBA lo activa en Server1Server1

3. La conexión y consulta de Joe se registra,

Page 19: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.20

Online, high performance backup for InnoDB (scriptable interface) Full, Incremental, Partial Backups (with compression) Point in Time, Full, Partial Recovery options Enterprise Advisor Monitoring and Alerts on Backup Operations Metadata on status, progress, history Unlimited Database Size Cross-Platform

- Windows, Linux, Unix

MEB Backup Files

MEB Backup Files

MySQL Database Files

MySQL Database Files

mysqlbackupmysqlbackup

Ensures quick, online backup and recovery of your on premise and Cloud based MySQL applications.

MySQL Enterprise Backup

Page 20: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.21

A Virtual MySQL DBA Assistant!

Web-based, global view of MySQL/Cluster applications (on-premise and Cloud deployments)

Automated, rules-based monitoring and alerts (SMTP, SNMP enabled)

Query capture, monitoring, analysis and tuning, correlated with Monitor graphs

Real-time Replication Monitor with auto-discovery of master-slave topologies

Integrated with Oracle Support

MySQL Enterprise Monitor

Page 21: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.23

Centralized monitoring of queries without Slow Query Log, SHOW PROCESSLIST;

Aggregated view of query execution counts, time, and rows

Visual “grab and go” correlation with Monitor graphs

Enabled via Connectors (PHP, JDBC, .Net) or MySQL Proxy

Saves you time parsing atomic executions from logs. Finds problems you cannot find yourself.

MySQL Query Analyzer

Page 22: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.24

Instalación.

Page 23: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.25

Instalación

ZIP (Generic Binaries) 10 pasos con los directorios consolidados, customizable.

RPM 1 paso (por paquete rpm), distintos directorios, fijos.

MySQL Server (mysqld_safe mysqld) my.cnf / my.ini: datadir (db dirs, .frm, .MYD, .MYI, .ibd) / socket / port / user /

pid-file.

Page 24: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.26

Instalación

# groupadd mysql

# useradd -r -g mysql mysql

# cd /usr/local

# tar zxvf /path/to/mysql-VERSION-OS.tar.gz

# ln -s full-path-to-mysql-VERSION-OS mysql

# cd mysql

# chown -R mysql .

# chgrp -R mysql .

# scripts/mysql_install_db --user=mysql

# chown -R root .

# chown -R mysql data

ZIP

Next command is optional

# cp support-files/my-medium.cnf /etc/my.cnf

# bin/mysqld_safe --user=mysql &

Next command is optional# cp support-files/mysql.server /etc/init.d/mysql.server

Ubuntu:

“libaio” requisito: ‘sudo apt-get libaio1’

MySQL 5.6 Reference Manual

2.2. Installing MySQL from Generic Binaries on Unix/Linux

Page 25: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.27

Instalación

Instalar los rpm’s que necesitas / quieres, ej.:

MySQL-server-VERSION.glibc23.i386.rpm,MySQL-client-VERSION.glibc23.i386.rpm,MySQL-embedded-VERSION.glibc23.i386.rpm …

# rpm -i MySQL-server-VERSION.glibc23.i386.rpm

# rpm -i MySQL-client-VERSION.glibc23.i386.rpm

etc..

(v5.6) El usuario mysql está creado, la contraseña del usuario root para administrar MySQL está en $HOME/.mysql.secret y automáticamente se ejecuta mysql_secure_installation.sh.

RPM

Si luego hacemos una actualización de la versión, upgrade, hay que actualizar todos los paquetes instalados, no sólo los que queramos.

Los principales directorios usados son:

/usr/bin/mysql Ubicación CLI ‘mysql’, etc./usr/sbin/mysqld “mysqld” y otros./var/lib/mysql Bases de datos (esquemas),

logs./usr/share/mysql Ficheros de soporte,

ejemplos de my.cnf, etc.

MySQL 5.6 Reference Manual

2.5.1. Installing MySQL from RPM Packages on Linux

Page 26: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.28

Instalación

Arranque | Parada:# bin/mysqld_safe --user=mysql &

# mysql.server | /etc/init.d/mysql start | stop

Accediendo / conectando:# mysql –uroot –pcontraseña ([client],[mysql] opciones en my.cnf)

mysql> use sakila;

mysql> show tables;

mysql> use mysql; select * from user limit 3; ...

3 rows in set (0.00 sec)

Una vez instalado…

Page 27: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.29

Page 28: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.30

Empezando con MySQL Server.

Page 29: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.31

Empezando con MySQL Server.

# mysql –uroot

mysql> grant all on *.* to ‘root’@’192.168.1.1’ identified by ‘password’;

mysql_secure_installation script. mysql_config_editor , .mylogin.cnf encrypted option file. SSL Keys & Certificates: parametrización por herramienta. Proxy (non GA) Enterprise Security: PAM & External Authentication (LDAP). Oracle Secure Backup integration. MEM Security Advisor

Seguridad inicial

Page 30: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.32

Empezando con MySQL Server.

mysql> select user, host from mysql.user;

mysql> create user 'keith'@'192.168.1.%' identified by 'hollman';mysql> show grants for 'keith'@'192.168.1.%';+----------------------------------------------------------------------------------------------------------------+| GRANT USAGE ON *.* TO 'keith'@'192.168.1.%' IDENTIFIED BY PASSWORD '*24D81B2006F09C3C56D6E41FBD88134C72F60C9F' |+----------------------------------------------------------------------------------------------------------------+

mysql> grant all on *.* to 'keith'@'192.168.1.%'; | GRANT ALL PRIVILEGES ON *.* TO 'keith'@'192.168.1.%‘ ...

mysql> revoke all on *.* from 'keith'@'192.168.1.%';| GRANT USAGE ON *.* TO 'keith'@ '192.168.1.%‘ ...

mysql> drop user 'keith'@'192.168.1.%';mysql> show grants for 'keith'@'192.168.1.%';ERROR 1141 (42000): There is no such grant defined for user 'keith' on host '192.168.1.%'

Creando cuentas

Page 31: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.33

Empezando con MySQL Server.

# mysql --help

# mysql -uroot -pcontraseña -P3306 -h192.168.1.2# mysql --user=root --password=contraseña --port=3307 --host=localhost

# mysql (usar las opciones de [mysql] y/o [client] en el my.cnf / my.ini)MSWin: C:\ProgramData\MySQL\MySQL Server 5.6\my.iniLinux: /etc/my.cnf, $HOME/.my.cnf, /usr/local/mysql/my.cnf

mysql> status;

mysql> select version(); use sakila; select * from store; select * from mysql.user;

mysql> select now(); select sysdate(); select sleep(2); select sysdate(); select now();mysql> select now(), sysdate(), sleep(2), sysdate(), now();

mysql> insert into ... ; delete from ... ; update nombre_tabla set ... ;

mysqlimport mysql> load data infile ‘path_al_fichero’ into table ‘nombre_table’;mysqldump mysql> select * into outfile ‘path_al_fichero’ [...] from nombre_tabla;

Accediendo, S/I/U/D, Import y Export.

Page 32: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.34

Empezando con MySQL Server.

http://dev.mysql.com/doc/index-other.html: Sakila Employees Menagerie World World_innodb

Bases de datos de ejemplo

Page 33: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.35

Tareas de Administración.

Page 34: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.36

Tareas de Administración

my.ini / my.cnf (example file)

– innodb_file_per_table, innodb_buffer_pool_size, binlog_format, log-bin, log-output, etc.

Socket y puertos, shared-memory-base-name (Win), etc.– multi_mysqld != oratab

Host, usuarios, contraseña y encryptación.– mysql_config_editor (mysql --login-path=admin)

Cambiando el comportamiento– sql_mode ‘oracle’– --safe-updates / --i-am-a-dummy option.

Error, General & Slow log.

Configuración / option file.

Page 35: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.37

Tareas de Administración

CLI– mysql –uroot –pcontra –P 3306 –S /tmp/mysql.sock –h localhost

– mysql –e … mysql --help …

– mysqladmin (shutdown, ping, shutdown_timeout, create database)

– mysqlcheck (check, optimize, repair, analyze)

– mysqlbinlog, mysqldumpslow, mysqlslap, myisamchk, etc.

Workbench python Utilities– mysqlreplicate, mysqlrplshow, mysqlrpladmin, mysqlrplcheck,

mysqlfailover

– mysqldbexport, mysqldbimport, mysqldbcopy, mysqldiff, mysqlserverinfo, mysqluserclone, etc.

Clientes & Utilidades

Page 36: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.38

Tareas de Administración

http://dev.mysql.com/doc/refman/5.6/en/charset-syntax.html

Character Set :: conjunto de simbolos y codificaciones

Collation :: conjunto de reglas para comparar caracteres en un charset.

:: case sensitive, case insensitive & binary (_cs, _ci & _bin) Cada charset tiene al menos 1 collation, el por defecto. (show character set;) 2 charsets no pueden tener el mismo collation.

Almacenamiento del dato y comunicación entre MySQL Server y cliente. Configurado a nivel de servidor, sesión, database, tabla y columna.

– A nivel de sesión: set names ‘utf8’;

Charset & Collations

Page 37: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.39

Tareas de Administración

CREATE TABLE `kk` (

id_es varchar(10) collate latin1_spanish_ci,

id_utf varchar(10) collate utf8_general_ci)

default charset=latin1

collate=latin1_spanish_ci;

insert into kk values

('áéíóúñ¿?', 'áéíóúñ¿?');

select * from kk;+----------+----------+| id_es | id_utf | +----------+----------+ | áéíóúñ¿? | áéíóúñ¿? | +----------+----------+

Charset & Collations

select hex(id_es),length(id_es) from kk;+------------------+---------------+ | hex(id_es) | length(id_es) | +------------------+---------------+ | E1E9EDF3FAF1BF3F | 8 | +------------------+---------------+

select hex(id_utf), length(id_utf) from kk;+--------------------------------+----------------+ | hex(id_utf) | length(id_utf) | +--------------------------------+----------------+ | C3A1C3A9C3ADC3B3C3BAC3B1C2BF3F | 15 | +--------------------------------+----------------+

Page 38: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.40

Tareas de Administración

InnoDB (por defecto >5.5.5) Transaccional / OLTP. OLTP, Integridad Referencial, Bloqueos por fila, FullText (5.6), recuperable ante fallos, múltiples

Buffers y Caches.

MyISAM (por defecto <5.5.5) Web, alto lectura, baja escritura. .MYD/.MYI ficheros portables, alta compresión, FullText y búsquedas GIS, formato de fila fija

para acceso rápido, inserciones concurrentes, escrituras precede por encima de consultas.

NDB / NDBCluster Cluster, 99.999% disponible. Específico para Cluster: HA, OLTP, réplicas, particiones y fragmentos, auto-sharding, etc.

Otros: MEMORY (fast performance, .frm files on disk, fixed length rows, hash & btree indexes,

table contents temporary*, --init-file.), FEDERATED (Acceder a tablas remotas.), CSV (Almacenar datos en formato CSV.), ARCHIVE (Archivar, select & insert sólo.), BLACKHOLE (Particular uso sin generar IO.), EXAMPLE (¿Quieres crear tu propio motor?)

Storage Engines

Page 39: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.41

Tareas de Administración

ACID– START TRANSACTION / BEGIN, SAVEPOINT, COMMIT, ROLLBACK, ROLLBACK TO

SAVEPOINT, RELEASE SAVEPOINT, SET AUTOCOMMIT.– Usa el storage engine adecuado, es decir, transaccional (SHOW ENGINES\G)

Problemas transaccionales:– Lecturas Dirty (leer cambios no-comiteados)

– Lecturas non-repeatable (dentro de la misma transacción la misma operación de lectura, da distintos resultados)

– Lecturas Phantom (filas phantom, una fila que aparece que no estaba antes)

Transacciones

Page 40: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.42

Tareas de Administración

Isolation levels– READ UNCOMMITTED, READ COMMITTED, REPEATABLE READ & SERIALIZABLE.

Global, sesión o en memoria (hasta siguiente reinicio).– my.cnf: transaction-isolation = READ-COMMITTED

– Sesión: set transaction isolation level READ COMMITTED;

– Global: set global transaction isolation level READ COMMITTED;

Por defecto, REPEATABLE READ.– SELECT @@tx_isolation; SELECT @@GLOBAL.tx_isolation;

Transacciones

Page 41: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.43

Tareas de Administración

Depende del Storage Engine. 2 tipos para protegerse:

– Shared: Clientes que leen permiten leer a otros, pero escrituras deben esperar que todas las lecturas hayan acabado.

– Exclusive: Si un cliente quiere escribir, todos deben esperar a leer o escribir hasta que la escritura haya acabado.

Uso:– select… LOCK IN SHARED MODE;

– select… FOR UPDATE;

Bloqueos

Page 42: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.44

Tareas de Administración

Tablas– show create table like …

– create table tabla2 like tabla1 != create table tabla2 as select * from…

– show table status like …;

– mysqlcheck (tablas e índices), check, analyze, repair, optimize.

Indices / Keys– check table … extended; | mysqlcheck –extended

– Utilities: mysqlindexcheck

Particionamiento– Filosofía y dependerá de la aplicación y necesidad.

– Hash, Range o Key, Sub-particiones, (5.6) hints para partition-pruning.

Mantenimiento de tablas

Page 43: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.45

Tareas de Administración

Connectors / APIs– Librerias y drivers estándar, permitiendo acceso a bajo nivel (haciendo uso

de funciones para comunicarse con mysql)

– Connector/J, Connector/ODBC, Connector/NET, Connector/C++, Connector/Python, PHP (mysqli, ext/mysqli, PDO_MYSQL), etc.

Stored Routines & Security“With the large number of client programs that are available for MySQL, why would you want to write your own?”

– Acceso a datos de tablas: DEFINER en la definición de la rutina, y luego dar EXECUTE.

Triggers (before, after, insert, update, delete)

Programación

Page 44: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.46

Tareas de Administración

SQL extractos / dump mysqldump / select into outfilemysqldump -P3306 -uroot -poracle --host=141.144.12.45 --database sakila --log-error=d:\dump_sakila.log -q -r D:\dump_sakila1.sql | mysql -uroot -poracle -P3307 < D:\dump_sakila.sql

mysqlimport / load data infile (no crea las tablas) tee / no-tee

MySQL Enterprise Backup mysqlbackup: Full / Incremental, a cinta (Rman lib.so), single image,

aplicar logs al backup incremental (PITR partial recovery example), cualquier tipo de tabla, auto-bloqueo, con compresión, OSB, etc.

Backup & Recovery

Page 45: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.47

Tareas de Administración

show processlist;

Explain plan: explain select …

Procedure analyse: select… from… PROCEDURE ANALYSE()\G

PERFORMANCE_SCHEMA MEM Query Analyzer

Optimización

Page 46: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.48

Listos?

Page 47: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.49

Page 48: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.50

Del mundo Oracle, que debo dejar atrás?

Page 49: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.51

MySQL Cluster Carrier Grade Edition

• ‘Auto-sharding’ y ‘Multi-master’• Transaccional, ACID, base de datos relacional

ESCALABILIDAD LECT. Y ESCR.

• Diseño ‘Shared-nothing’, ningún Punto Único de Fallo• Operaciones On-Line: Escale, actualice esquemas, etc.

99.999% DISPONIBLE

• Ediciones GPL y Comercial• Hardware de ‘commodity’, herramientas de gestión y monitorización

TCO BAJO, FLEXIBLE

• Consultas relacionales y complejas + Accesos de ‘Key/Value’• MySQL, Memcached, C++, Java, JPA, HTTP / REST

APIS SQL Y NOSQL

• Alta carga, rendimiento ‘real-time’• Baja latencia predecible, accesos multi-thread

RESPUESTA EN REAL-TIME

Page 50: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.52

Mohandas Karamchand GandhiHind Swaraj 1908

“Llegué a contactar con cada anarquista India en Londres. Su valentía me impresionó, pero sentí que su ambición estaba desencaminado. Sentí que la violencia no era un remedio para los males de India, y que su pueblo requería el uso de una arma más impactante y diferente para protegerse.”

Page 51: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.53

MySQL Cluster CGEEscalabilidad On-Line

Clie

ntes

Cap

a A

plic

ació

n

Dat

a N

odes

Mg

mt

Page 52: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.54

MySQL Cluster CGE

Partición– Particionamiento horizontal– Una parte de la tabla, cada partición contiene un conjunto de filas– Número de particiones = número de data nodes

Fragmento– La copia de una partición

Réplica– La copia completa de los

datos

‘Node Group’– Creado automáticamente

– # de grupos = # de data nodes / # de réplicas

– Mientras que haya siempre un ‘data node’ en cada ‘node group’ tendremos una copia completa de los datos.

Conceptos Claves

Page 53: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.55

Siguientes Pasos

Prueba MySQL 5.7 DMR

MySQL Blog: Lo Último.

Involucre MySQL Consulting

MySQL 5.6 OCP DBA / Dev

Oracle University cursos

Page 54: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.56

Más documentación

Guía para desarrolladores y DBA para las Novedades

de MySQL 5.6 (en Español)

White Papers técnicos.

Reference Manual.

Page 55: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.57

blog: MySQLMed.wordpress.com [email protected]

Page 56: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.58

Ahora me toca a mi…

Page 57: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.59

Page 58: MySQL Una Introduccion Tecnica

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.60