mysql workbench 6 - mysql community downloads · 2 copyright © 2013, oracle and/or its affiliates....
TRANSCRIPT
![Page 1: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/1.jpg)
1 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
MySQL Workbench 6.0
機能紹介&デモ
日本オラクル株式会社
山崎 由章 / MySQL Senior Sales Consultant,
Asia Pacific and Japan
![Page 2: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/2.jpg)
2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
以下の事項は、弊社の一般的な製品の方向性に関する概要を説明するものです。また、情報提供を唯一の目的とするものであり、いかなる契約にも組み込むことはできません。以下の事項は、マテリアルやコード、機能を提供することをコミットメント(確約)するものではないため、購買決定を行う際の判断材料になさらないで下さい。オラクル製品に関して記載されている機能の開発、リリースおよび時期については、弊社の裁量により決定されます。
OracleとJavaは、Oracle Corporation 及びその子会社、関連会社の米国及びその他の国における登録商標です。文中の社名、商品名等は各社の商標または登録商標である場合があります。
![Page 3: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/3.jpg)
3 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
MySQL Workbenchで出来ること
• 管理
– Server起動/停止、Serverステータス診断、システム/ステータス変数確認、
ログ確認、ユーザ管理、セッション管理、オブジェクト管理、データ編集、など
• 開発
– SQLエディタ、SQL整形、SQLコード補完、SQLシンタックスハイライト、
SQL Snippets(ステートメント再利用)、ビジュアルExplain、など
• 設計
– E-R図作成、フォワードエンジニアリング、リバースエンジニアリング、など
![Page 4: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/4.jpg)
4 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Server管理
![Page 5: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/5.jpg)
5 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
新規コネクションの生成 ここをクリック
![Page 6: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/6.jpg)
6 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
新規コネクションの生成
• TCP/IP、UNIXソケットファイルによる接続だけでなく、
「Standard TCP/IP over SSH Connection」を選択することで
SSH経由による接続も可能
![Page 7: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/7.jpg)
7 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Serverのステータス確認
• Management タブ のServer Status
![Page 8: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/8.jpg)
8 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Serverのステータス確認
• 各機能の有効/無効
• ディスクの空き容量
• 各種ログ出力の有効/無効
![Page 9: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/9.jpg)
9 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Serverのステータス確認
• CPU負荷
• コネクション数
• ネットワークトラフィック
• QPS(Queries per Second)
• InnoDB関連の情報
![Page 10: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/10.jpg)
10 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
クライアントコネクションの状態確認
• Management タブ の
Client Connections
• コネクションの情報を
確認可能
![Page 11: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/11.jpg)
11 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
コネクションから実行中のSQLを獲得
• SQL EditiorでSQLを表示
– フォーマットされているため読みやすい
– SQL EditorでSQLを編集可能
– Explainも取得可能
![Page 12: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/12.jpg)
12 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
システム変数、ステータス変数の確認
• Management タブ の Status and System Variables
• “SHOW GLOBAL VARIABLES”,”SHOW GLOBAL STATUS”を
実行しなくても、各変数を確認可能
![Page 13: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/13.jpg)
13 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Schema Dump/Export
• 簡単にバックアップ
• mysqldumpを使用
• 1つのファイルに出力
もしくは、 テーブル
単位でファイルを分割
![Page 14: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/14.jpg)
14 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Schema Import
• mysqldumpファイルを
ロード
![Page 15: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/15.jpg)
15 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
データモデリング
![Page 16: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/16.jpg)
16 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
データモデル概要
![Page 17: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/17.jpg)
17 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
E-R図
![Page 18: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/18.jpg)
18 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
フォワードエンジニアリング/リバースエンジニアリング
• データモデルからオブジェクトを作成、
既存のデータベースからデータモデルを生成
• SQLスクリプトを生成することも可能
![Page 19: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/19.jpg)
19 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
データモデルの同期
• 変更内容をデータベース
に反映
![Page 20: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/20.jpg)
20 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
DBドキュメント出力(商用版のみ)
• データベーススキーマの情報をドキュメント化
– テーブル定義書を自動作成
– フォーマットは4種類から選択可能
![Page 21: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/21.jpg)
21 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
データモデルの検証(商用版のみ)
• DB設計上の間違いや懸念事項を提示
検証結果の例
例)film_textテーブルについている外部キーfk_film_textが、
inventoryテーブルの主キー以外の列を参照している
![Page 22: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/22.jpg)
22 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
SQL開発
![Page 23: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/23.jpg)
23 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
SQL Editor
サーバ管理オプション
スキーマツリー
クエリーエリア
コンテクストヘルプ、
スニペット
サーバー応答&履歴
トグルスライドバー
![Page 24: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/24.jpg)
24 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Table Data
• テーブルを右クリック
• 行を検索
– 自動的にLIMIT句を付与してSELECTを実行
• ファイルへエクスポート
– クエリー結果をファイルへ出力
– CSV、XML、SQL、JSON、など
• テーブル編集
– 行データを編集
![Page 25: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/25.jpg)
25 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Table Data
• JOINが含まれていない
• テーブルカラムのみ(関数などが含まれていない)
• テーブルが主キー or ユニークキー(NOT NULL付き) を持っている
クエリー結果を編集できる条件:
![Page 26: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/26.jpg)
26 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Object Editors
• オブジェクトを右クリックして、
”Alter Object” を選択
テーブル、ビューなどのオブジェクトを簡単に変更
![Page 27: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/27.jpg)
27 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Schema Inspector
• スキーマ内の全オブジェクトを確認
• サーバから情報を取得
• テーブルメンテナンス処理を
実行可能
– Analyze
– Optimize
– Check
– Checksum
![Page 28: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/28.jpg)
28 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
レスポンスタイムの確認
Duration = Execution time – on the server Fetch = Time to transfer the result (Network + Client “App” Latency)
![Page 29: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/29.jpg)
29 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
スニペット
• 良く使うSQL文、
コマンドを簡単に
呼出し&実行
• オリジナルの
スニペットも
作成可能
![Page 30: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/30.jpg)
30 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
ビジュアルEXPLAIN
• MySQL 5.6以降で、ビジュアルEXPLAINを実行可能
• MySQL Workbenchから取得
• オブジェクトへのアクセス
パターンを一目で確認可能
(色で判別可能)
EXPLAINの結果を見やすく表示
このボタンをクリック
![Page 31: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/31.jpg)
31 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
ビジュアルEXPLAIN
• 赤色
– ALL(full table scan)
• 橙色
– Full index scan
– Full Text Index Search
• 緑色
– Range (>,<,…)
– Reference
• 青色(Good)
– EQ_REF
EXPLAINの結果を見やすく表示
特に
注意!!
![Page 32: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/32.jpg)
32 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
![Page 33: MySQL Workbench 6 - MySQL Community Downloads · 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 以下の事項は、弊社の一般的な製品の方向性に関する概要を説明する](https://reader031.vdocuments.net/reader031/viewer/2022041411/5e191bd6298e67728d6f28ff/html5/thumbnails/33.jpg)
33 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
33