- 浏览: 7847259 次
- 性别:
- 来自: 广州
文章分类
- 全部博客 (2425)
- 软件工程 (75)
- JAVA相关 (662)
- ajax/web相关 (351)
- 数据库相关/oracle (218)
- PHP (147)
- UNIX/LINUX/FREEBSD/solaris (118)
- 音乐探讨 (1)
- 闲话 (11)
- 网络安全等 (21)
- .NET (153)
- ROR和GOG (10)
- [网站分类]4.其他技术区 (181)
- 算法等 (7)
- [随笔分类]SOA (8)
- 收藏区 (71)
- 金融证券 (4)
- [网站分类]5.企业信息化 (3)
- c&c++学习 (1)
- 读书区 (11)
- 其它 (10)
- 收藏夹 (1)
- 设计模式 (1)
- FLEX (14)
- Android (98)
- 软件工程心理学系列 (4)
- HTML5 (6)
- C/C++ (0)
- 数据结构 (0)
- 书评 (3)
- python (17)
- NOSQL (10)
- MYSQL (85)
- java之各类测试 (18)
- nodejs (1)
- JAVA (1)
- neo4j (3)
- VUE (4)
- docker相关 (1)
最新评论
-
xiaobadi:
jacky~~~~~~~~~
推荐两个不错的mybatis GUI生成工具 -
masuweng:
(转)JAVA获得机器码的实现 -
albert0707:
有些扩展名为null
java 7中可以判断文件的contenttype了 -
albert0707:
非常感谢!!!!!!!!!
java 7中可以判断文件的contenttype了 -
zhangle:
https://zhuban.me竹板共享 - 高效便捷的文档 ...
一个不错的网络白板工具
http://hi.baidu.com/edeed/item/3fa6e07f754457346dc37cbb
common_schema是一个MySQL schema工具集(5.1以上版本才适用), 它通过在MySQL数据库里建立一个名为common_schema的数据库, 该数据库里包含许多有用的视图和函数, 用来做数据库分析,监控,管理和SQL代码生成, 其中大部分视图信息其实来自INFORMATION_SCHEMA数据库, 只是做了一些连接和汇总.
下载地址: http://code.google.com/p/common-schema/downloads/list
下载列表里包含如下三个发行版本:
common_schema_mysql_51: 适合所有MySQL5.1以上版本;
common_schema_innodb_plugin: 适合所有MySQL5.1(包含InnoDB插件和可用INFORMATION_SCHEMA)以上版本;
common_schema_percona_server: 适合所有Percona5.1以上版本;
对于没有使用Percona Server, 一般就使用其它两个版本, 它俩的区别就是common_schema_innodb_plugin多建了一个Innodb相关的视图. 所以一般下载安装common_schema_innodb_plugin这个发行版即可.
1 安装
# cd /u01/software/mysql/
# rz -bey (二进制上传安装文件)
# mysql -uu_test -p (以最高权限用户如root, 登录数据库)
mysql> source common_schema_innodb_plugin-r50.sql
mysql> show databases like '%schema';
+--------------------+
| Database (%schema) |
+--------------------+
| information_schema |
| common_schema |
+--------------------+
2 rows in set (0.00 sec)
mysql> use common_schema;
Database changed
mysql> show full tables;
+----------------------------+------------+
| Tables_in_common_schema | Table_type |
+----------------------------+------------+
| _columns_privileges | VIEW |
| _flattened_keys | VIEW |
| _global_status_sleep | VIEW |
| _sql_grants_components | VIEW |
| auto_increment_columns | VIEW |
| data_size_per_engine | VIEW |
| data_size_per_schema | VIEW |
| global_status_diff | VIEW |
| global_status_diff_clean | VIEW |
| global_status_diff_nonzero | VIEW |
| no_pk_innodb_tables | VIEW |
| numbers | BASE TABLE |
| processlist_per_userhost | VIEW |
| processlist_repl | VIEW |
| processlist_summary | VIEW |
| processlist_top | VIEW |
| redundant_keys | VIEW |
| routine_privileges | VIEW |
| sql_alter_table | VIEW |
| sql_foreign_keys | VIEW |
| sql_grants | VIEW |
| sql_show_grants | VIEW |
| table_charset | VIEW |
| text_columns | VIEW |
+----------------------------+------------+
24 rows in set (0.00 sec)
2 举例子
举一些还比较有用的例子.
列出数据库中所有AUTO_INCREMENT类型列:
mysql> select * from common_schema.auto_increment_columns;
列出数据库中各种存储引擎下表数量和大小, 及其最大的表信息:
mysql> select * from common_schema.data_size_per_engine;
列出数据库中各schema下表数量和大小, 及其最大的表信息:
mysql> select * from common_schema.data_size_per_schema;
列出状态变量差异(10秒间隔), 从这里在一定程度上可以看出数据库繁忙程度:
mysql> select * from common_schema.global_status_diff_nonzero;
列出进程汇总信息:
mysql> select * from common_schema.processlist_summary;
列出TOP进程信息:
mysql> select * from common_schema.processlist_top;
列出各用户和主机进程汇总信息:
mysql> select * from common_schema.processlist_per_userhost;
列出存储过程权限信息:
mysql> select * from common_schema.routine_privileges;
列出用户权限信息(类似show grants for语句):
mysql> select * from common_schema.sql_show_grants;
返回按指定分隔符分隔后的token数量:
mysql> SELECT get_num_tokens('the quick brown fox', ' ') AS num_token;
+-----------+
| num_token |
+-----------+
| 4 |
+-----------+
返回按指定分隔符分隔后的某个token:
mysql> SELECT split_token('the quick brown fox', ' ', 3) AS token;
+-------+
| token |
+-------+
| brown |
+-------+
3 所有组件说明
所有视图和函数说明参考:
http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/download.html
common_schema是一个MySQL schema工具集(5.1以上版本才适用), 它通过在MySQL数据库里建立一个名为common_schema的数据库, 该数据库里包含许多有用的视图和函数, 用来做数据库分析,监控,管理和SQL代码生成, 其中大部分视图信息其实来自INFORMATION_SCHEMA数据库, 只是做了一些连接和汇总.
下载地址: http://code.google.com/p/common-schema/downloads/list
下载列表里包含如下三个发行版本:
common_schema_mysql_51: 适合所有MySQL5.1以上版本;
common_schema_innodb_plugin: 适合所有MySQL5.1(包含InnoDB插件和可用INFORMATION_SCHEMA)以上版本;
common_schema_percona_server: 适合所有Percona5.1以上版本;
对于没有使用Percona Server, 一般就使用其它两个版本, 它俩的区别就是common_schema_innodb_plugin多建了一个Innodb相关的视图. 所以一般下载安装common_schema_innodb_plugin这个发行版即可.
1 安装
# cd /u01/software/mysql/
# rz -bey (二进制上传安装文件)
# mysql -uu_test -p (以最高权限用户如root, 登录数据库)
mysql> source common_schema_innodb_plugin-r50.sql
mysql> show databases like '%schema';
+--------------------+
| Database (%schema) |
+--------------------+
| information_schema |
| common_schema |
+--------------------+
2 rows in set (0.00 sec)
mysql> use common_schema;
Database changed
mysql> show full tables;
+----------------------------+------------+
| Tables_in_common_schema | Table_type |
+----------------------------+------------+
| _columns_privileges | VIEW |
| _flattened_keys | VIEW |
| _global_status_sleep | VIEW |
| _sql_grants_components | VIEW |
| auto_increment_columns | VIEW |
| data_size_per_engine | VIEW |
| data_size_per_schema | VIEW |
| global_status_diff | VIEW |
| global_status_diff_clean | VIEW |
| global_status_diff_nonzero | VIEW |
| no_pk_innodb_tables | VIEW |
| numbers | BASE TABLE |
| processlist_per_userhost | VIEW |
| processlist_repl | VIEW |
| processlist_summary | VIEW |
| processlist_top | VIEW |
| redundant_keys | VIEW |
| routine_privileges | VIEW |
| sql_alter_table | VIEW |
| sql_foreign_keys | VIEW |
| sql_grants | VIEW |
| sql_show_grants | VIEW |
| table_charset | VIEW |
| text_columns | VIEW |
+----------------------------+------------+
24 rows in set (0.00 sec)
2 举例子
举一些还比较有用的例子.
列出数据库中所有AUTO_INCREMENT类型列:
mysql> select * from common_schema.auto_increment_columns;
列出数据库中各种存储引擎下表数量和大小, 及其最大的表信息:
mysql> select * from common_schema.data_size_per_engine;
列出数据库中各schema下表数量和大小, 及其最大的表信息:
mysql> select * from common_schema.data_size_per_schema;
列出状态变量差异(10秒间隔), 从这里在一定程度上可以看出数据库繁忙程度:
mysql> select * from common_schema.global_status_diff_nonzero;
列出进程汇总信息:
mysql> select * from common_schema.processlist_summary;
列出TOP进程信息:
mysql> select * from common_schema.processlist_top;
列出各用户和主机进程汇总信息:
mysql> select * from common_schema.processlist_per_userhost;
列出存储过程权限信息:
mysql> select * from common_schema.routine_privileges;
列出用户权限信息(类似show grants for语句):
mysql> select * from common_schema.sql_show_grants;
返回按指定分隔符分隔后的token数量:
mysql> SELECT get_num_tokens('the quick brown fox', ' ') AS num_token;
+-----------+
| num_token |
+-----------+
| 4 |
+-----------+
返回按指定分隔符分隔后的某个token:
mysql> SELECT split_token('the quick brown fox', ' ', 3) AS token;
+-------+
| token |
+-------+
| brown |
+-------+
3 所有组件说明
所有视图和函数说明参考:
http://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/download.html
发表评论
-
让 InnoDB 多任务运行
2018-09-06 16:06 744今天偶然看到的一招,记录下 如果服务器上的参数 innodb_ ... -
mysql中查询连接工作状态
2018-05-31 15:13 637#!/bin/bash while true do mysql ... -
MYSQL BACKUP的SHELL相关语句
2018-05-25 20:33 505#!/bin/bash ###############Basi ... -
MySQL This function has none of DETERMINISTIC, NO SQL...错误1418 的原因分析及解决方法
2018-05-08 11:17 571MySQL开启bin-log后,调用存储过程或者函数以及触发器 ... -
NUMA的选择
2018-04-24 09:52 1344现在的机器上都是有 ... -
关于MYSQL 5.7线程池的好文收集
2018-03-27 10:57 1472来自腾讯工程师的好文: https://www.jianshu ... -
MYSQL 的审计日志插件
2017-11-30 10:19 1229MYSQL 的审计日志插件,可惜目前只是LINUX用: 来自M ... -
(转)MySQL InnoDB缓冲池配置详解
2017-10-09 16:55 3988一、InnoDB缓冲池 InnoDB维护一个称为缓冲池的内存 ... -
(转)MySQL 5.7默认SQL模式带来的问题总结
2017-10-05 18:46 1819http://www.ywnds.com/?p=8865 在 ... -
(转)MySQL 5.7默认ONLY_FULL_GROUP_BY语义介绍
2017-10-05 18:45 1137http://www.ywnds.com/?p=8184 ON ... -
MySQL 5.6 新功能之 Index Condition Pushdown (ICP)
2017-10-05 15:52 744http://www.cnblogs.com/zhoujiny ... -
mysql 5.7中的MBR和BKA算法
2017-10-03 15:11 1675一、什么是MRR MMR全称是Multi-Range Re ... -
(收藏)万字总结:学习MySQL优化原理,这一篇就够了!
2017-09-30 23:37 1143http://dbaplus.cn/news-155-1531 ... -
(转)MySQL中NULL和空值的区别
2017-09-23 15:57 2186MySQL中NULL和空值的区别 http://www.yw ... -
mysql 5.7中关于count(*)的优化
2017-09-20 19:15 2300在mysql 5.7中,对于select count(*) f ... -
MySQL 索引设计概要
2017-09-12 21:12 468<<MySQL 索引设计概要>>,不错 ... -
10分钟学会理解和解决MySQL乱码问题
2017-07-22 18:21 499http://cenalulu.github.io/mysql ... -
MySQL的or/in/union与索引优化
2017-07-22 08:29 898https://mp.weixin.qq.com/s/ZWez ... -
MYSQL中查看某个表或库的大小语句
2017-04-02 09:12 1907在information_schema.tables中有相关记 ... -
(收藏)MYSQL大表方案
2017-01-09 19:58 1390https://segmentfault.com/a/1190 ...
相关推荐
mysql common_schema 完整sql。适合5.1版本以上,支持5.7以下的简单的json内容获取
MySQL中information_schema是什么
MySQL中information_schema系统表
persistence-2_0-final-jar_and_schema.zip
sakila_dwh_schema.sql
主要介绍了mysql数据库中的information_schema和mysql可以删除吗这个问题,需要的朋友可以参考下
common_schema - MySQL的DBA框架
因为MySQL的很多功能都依赖主键,我想用zabbix用户,来监控业务数据库的所有表,是否都建立了主键。 监控的语句是: FROM information_schema.tables t1 LEFT OUTER JOIN information_schema.table_constraints t2...
sample_schema_scripts Oracle 数据库 示例方案脚本(含结构+数据脚本) 安装Oracle时未勾选“示例方案”可执行该脚本创建对应数据库
绝对原版store_schema.sql脚本,希望对大家有帮助!
ESI_Schema_V1i12.zip,上传仅供参考,有问题留言。
store_schema.sql脚本,oracle的store初始化脚本。
SAP_HCM_Schema_CN28详解SAP_HCM_Schema_CN28详解SAP_HCM_Schema_CN28详解
Oracle database 10g SQL开发指南中 store模式下的store_schema脚本 相应的本书的pdf电子书也在我的上传资源中,需要的可以去下载!
测试环境搭了一个mariadb 5.7,使用jdbc驱动 <groupId>mysql <artifactId>mysql-...Table 'performance_schema.session_variables' doesn't exist 问度娘无果,无奈升级MySQL驱动为5.1.36,解决。 据了解:
NULL 博文链接:https://icbm.iteye.com/blog/1981396
information_schema数据库是在mysql的版本5.0之后产生的,一个虚拟数据库,物理上并不存在。information_schema数据库类似与“数据字典”,提供了访问数据库元数据的方式,即数据的数据。比如数据库名或表名,列类型...
Copying_a_Maximo_Schema_on_Oracle