MySQL Schema Maintenance
Upcoming SlideShare
Loading in...5
×
 

MySQL Schema Maintenance

on

  • 7,530 views

Schema maintenance is a hot topic for database administrators. Especially if they have to maintain schemas for development, staging, and production, the task could be difficult and confusing. Using ...

Schema maintenance is a hot topic for database administrators. Especially if they have to maintain schemas for development, staging, and production, the task could be difficult and confusing. Using MySQL Workbench, schema maintenance is greatly simplified, and the tasks of synchronizing schemas across servers become easy and manageable.

Statistics

Views

Total Views
7,530
Views on SlideShare
7,365
Embed Views
165

Actions

Likes
8
Downloads
148
Comments
0

12 Embeds 165

http://www.ustudy.in 51
http://codebits.eu 30
https://codebits.eu 26
http://www.slideshare.net 24
http://www.techiegyan.com 23
http://ustudy.in 5
http://209.85.129.132 1
http://www.cnblogs.com 1
http://translate.googleusercontent.com 1
http://www.haogongju.net 1
http://www.twylah.com 1
http://localhost 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-NonCommercial-NoDerivs LicenseCC Attribution-NonCommercial-NoDerivs LicenseCC Attribution-NonCommercial-NoDerivs License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

MySQL Schema Maintenance MySQL Schema Maintenance Presentation Transcript

  • MySQL schema maintenance Giuseppe Maxia MySQL Community Team Lead This work is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported License. Thursday, 03 December 2009
  • about me - Giuseppe Maxia  a.k.a. The Data Charmer  MySQL Community Team Lead  Long time MySQL hacker  Formerly, database consultant, designer, coder.  A passion for QA  An even greater passion for open source  ... and community  Passionate blogger  http://datacharmer.blogspot.com Thursday, 03 December 2009
  • Schema what? In a relational database, the schema defines the tables, the fields in each table, and the relationships between fields and tables. http://en.wikipedia.org/wiki/Schema_(database) Thursday, 03 December 2009
  • tables Thursday, 03 December 2009
  • tables table name column column column Thursday, 03 December 2009
  • tables CREATE TABLE employees ( ID INT NOT NULL, name VARCHAR(20), name table salary INT, column column column PRIMARY KEY (ID) ) Thursday, 03 December 2009
  • relationship departments employees ID INT ID INT name varchar (10) name varchar (10) salary INT dept_ID INT Thursday, 03 December 2009
  • relationship departments employees ID INT ID INT name varchar (10) name varchar (10) salary INT 1 dept_ID INT Thursday, 03 December 2009
  • relationship departments employees ID INT ID INT name varchar (10) name varchar (10) salary INT 1 dept_ID INT many Thursday, 03 December 2009
  • relationship customer ID INT name varchar (10) sales cust_ID INT emp_ID INT s_date DATE amount DECIMAL employees ID INT name varchar (10) salary INT dept_ID INT Thursday, 03 December 2009
  • relationship customer ID INT name varchar (10) sales cust_ID INT emp_ID INT s_date DATE amount DECIMAL employees ID INT name varchar (10) 1 salary INT dept_ID INT Thursday, 03 December 2009
  • relationship customer many ID INT name varchar (10) sales cust_ID INT emp_ID INT s_date DATE amount DECIMAL employees ID INT name varchar (10) 1 salary INT dept_ID INT Thursday, 03 December 2009
  • relationship customer many ID INT many to name varchar (10) many sales cust_ID INT emp_ID INT s_date DATE amount DECIMAL employees ID INT name varchar (10) 1 salary INT dept_ID INT Thursday, 03 December 2009
  • Main actors • Production • Development • Stage • Test Thursday, 03 December 2009
  • Production database • You must have one Thursday, 03 December 2009
  • Development database • Where you create new things Thursday, 03 December 2009
  • Test database • Where you experiment crazy ideas Thursday, 03 December 2009
  • Stage database • Where you test before deploying to production Thursday, 03 December 2009
  • Schema maintenance actions • Reverse engineering • Forward engineering • Synchronization Thursday, 03 December 2009
  • Reverse Engineering Thursday, 03 December 2009
  • Reverse Engineering DDL dept_emp department dept_manager employees titles salaries Thursday, 03 December 2009
  • Reverse Engineering DDL dept_emp department dept_manager employees titles salaries Thursday, 03 December 2009
  • Reverse Engineering DDL dept_emp department dept_manager employees titles salaries Thursday, 03 December 2009
  • Forward Engineering Thursday, 03 December 2009
  • Forward Engineering Thursday, 03 December 2009
  • Forward Engineering Thursday, 03 December 2009
  • Forward Engineering DDL dept_emp department dept_manager employees titles salaries Thursday, 03 December 2009
  • Forward Engineering . ti ve ! truc G e s IN is d N g DDL A R n dept_emp W ee ri department g in dept_manager employees d en a r rw titles o salaries F Thursday, 03 December 2009
  • Synchronization Thursday, 03 December 2009
  • Synchronization Thursday, 03 December 2009
  • Synchronization Thursday, 03 December 2009
  • Synchronization Thursday, 03 December 2009
  • Synchronization Thursday, 03 December 2009
  • Synchronization Thursday, 03 December 2009
  • Synchronization Thursday, 03 December 2009
  • Synchronization Thursday, 03 December 2009
  • Synchronization Thursday, 03 December 2009
  • Synchronization Thursday, 03 December 2009
  • Synchronization Thursday, 03 December 2009
  • Synchronization Thursday, 03 December 2009
  • Synchronization Thursday, 03 December 2009
  • How it works yes Development OK? Production no no yes OK? Stage Test Thursday, 03 December 2009
  • How else it works Development Production • Partition adjustment • Dynamic schemas Test Stage • Hot fixes Thursday, 03 December 2009
  • What happens in between Development no OK? Test Thursday, 03 December 2009
  • What happens in between Development no What now? OK? Test Thursday, 03 December 2009
  • What happens in between Development no What now? Wrong schema here OK? Test Thursday, 03 December 2009
  • What happens in between Development no What now? Wrong schema here OK? REWIND? Test Thursday, 03 December 2009
  • Schema maintenance: how to 1. Poor man's way Thursday, 03 December 2009
  • How poor is the poor man? • only command line access • No Perl, PHP, or Python • Can't install anything • Command line access • Perl or Python available • Can install modules • Command line access • GUI • Can install everything Thursday, 03 December 2009
  • How poor is the poor man? ELY • only command line access EM R TR O EX PO • No Perl, PHP, or Python • Can't install anything • Command line access • Perl or Python available • Can install modules • Command line access • GUI • Can install everything Thursday, 03 December 2009
  • How poor is the poor man? ELY • only command line access EM R TR O EX PO • No Perl, PHP, or Python • Can't install anything • Command line access OR • Perl or Python available PO • Can install modules • Command line access • GUI • Can install everything Thursday, 03 December 2009
  • How poor is the poor man? ELY • only command line access EM R TR O EX PO • No Perl, PHP, or Python • Can't install anything • Command line access OR • Perl or Python available PO • Can install modules • Command line access RI CH • GUI • Can install everything Thursday, 03 December 2009
  • so, the extremely poor man's way ... HOST 1 HOST 2 Development Production Thursday, 03 December 2009
  • so, the extremely poor man's way ... HOST 1 HOST 2 get the Development Production schema TEXT FILE Thursday, 03 December 2009
  • so, the extremely poor man's way ... HOST 1 HOST 2 get the Development Production get the schema schema TEXT TEXT FILE FILE Thursday, 03 December 2009
  • so, the extremely poor man's way ... HOST 1 HOST 2 get the Development Production get the schema schema TEXT TEXT diff FILE FILE Thursday, 03 December 2009
  • so, the extremely poor man's way ... HOST 1 HOST 2 get the Development Production get the schema schema TEXT TEXT diff FILE FILE then … uh … figure out how to continue Thursday, 03 December 2009
  • the poor man's way ... HOST 1 HOST 2 Development Production get the get the schema schema TEXT diff TEXT FILE FILE Perl Script Thursday, 03 December 2009
  • the poor man's way ... HOST 1 HOST 2 Development Production get the get the schema schema TEXT diff TEXT FILE FILE Perl Script TELLS YOU WHAT TO DO Thursday, 03 December 2009
  • not so poor man's way ... HOST 1 HOST 2 Development Production DOES A LOT OF THINGS TELLS YOU WHAT TO DO Python Script http://schemasync.org Thursday, 03 December 2009
  • not so poor man's way ... HOST 1 HOST 2 Development Production DOES A LOT OF THINGS TELLS YOU WHAT TO DO Python Script http://schemasync.org WARNING: doesn't deal with partitions Thursday, 03 December 2009
  • The rich man http://aquafold.com Thursday, 03 December 2009
  • The rich man http://aquafold.com WARNING: doesn't deal with partitions Thursday, 03 December 2009
  • MySQL Workbench http://wb.mysql.com Thursday, 03 December 2009
  • MySQL Workbench http://wb.mysql.com Thursday, 03 December 2009
  • MySQL Workbench http://wb.mysql.com Thursday, 03 December 2009
  • Schema and model Thursday, 03 December 2009
  • Schema and model DDL dept_emp department dept_manager employees titles salaries Thursday, 03 December 2009
  • Schema and model DDL dept_emp department dept_manager employees titles salaries Thursday, 03 December 2009
  • Physical schema implemented in a specific DBMS Thursday, 03 December 2009
  • Physical schema DDL dept_emp department dept_manager implemented employees in a specific DBMS titles salaries Thursday, 03 December 2009
  • Conceptual model DBMS agnostic Thursday, 03 December 2009
  • Conceptual model DBMS agnostic Thursday, 03 December 2009
  • MySQL Workbench basics Thursday, 03 December 2009
  • Creating tables (1) Thursday, 03 December 2009
  • Creating tables (2) Thursday, 03 December 2009
  • Creating tables (3) Thursday, 03 December 2009
  • Creating tables (3) Thursday, 03 December 2009
  • Creating tables (4) Thursday, 03 December 2009
  • Creating tables (4) Thursday, 03 December 2009
  • Creating tables (5) Thursday, 03 December 2009
  • Creating tables (5) Thursday, 03 December 2009
  • database connections(1) Thursday, 03 December 2009
  • database connections(2) Thursday, 03 December 2009
  • Reverse engineering in the old world Thursday, 03 December 2009
  • Reverse engineering in the old world show create table departmentsG Create Table: CREATE TABLE `departments` ( `dept_id` int(10) unsigned NOT NULL, `department` char(30) NOT NULL, PRIMARY KEY (`dept_id`), KEY `department` (`department`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 1 row in set (0.00 sec) Thursday, 03 December 2009
  • Reverse engineering in the old world show create table departmentsG Create Table: CREATE TABLE `departments` ( `dept_id` int(10) unsigned NOT NULL, `department` char(30) NOT NULL, PRIMARY KEY (`dept_id`), KEY `department` (`department`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 1 row in set (0.00 sec) Thursday, 03 December 2009
  • Reverse engineering (1) Thursday, 03 December 2009
  • Reverse engineering (2) Thursday, 03 December 2009
  • Reverse engineering (3) Thursday, 03 December 2009
  • Reverse engineering (4) Thursday, 03 December 2009
  • Reverse engineering (5) Thursday, 03 December 2009
  • Reverse engineering (6) Thursday, 03 December 2009
  • Reverse engineering (7) Thursday, 03 December 2009
  • Reverse engineering (8) Thursday, 03 December 2009
  • Reverse engineering (9) Thursday, 03 December 2009
  • Reverse engineering (10) Thursday, 03 December 2009
  • forward engineering in the old world mysqldump --host=development -B --no-data crosstab > crosstab.sql mysql --host=stage < crosstab.sql Thursday, 03 December 2009
  • Forward engineering (1) Thursday, 03 December 2009
  • Forward engineering (2) Thursday, 03 December 2009
  • Forward engineering (3) Thursday, 03 December 2009
  • Forward engineering (4) Thursday, 03 December 2009
  • synchronization in the old world Thursday, 03 December 2009
  • Synchronization (1) Thursday, 03 December 2009
  • Synchronization (1) Thursday, 03 December 2009
  • Synchronization (2) Thursday, 03 December 2009
  • Synchronization (3) Thursday, 03 December 2009
  • Synchronization (4) Thursday, 03 December 2009
  • Synchronization (5) Thursday, 03 December 2009
  • Synchronization (6) Thursday, 03 December 2009
  • More goodies • MySQL Workbench 5.2 (Beta) - live demo Thursday, 03 December 2009
  • Thanks Let's talk! Thursday, 03 December 2009