If you need to monitor and analyze your MySQL databases size over time you can automate this process.
1) create the database
CREATE DATABASE stat DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
2) create the table
CREATE TABLE `stat`.`sizeTable` (
`idsizeTable` INT NOT NULL AUTO_INCREMENT ,
`insertdate` DATE NOT NULL ,
`databaseName` VARCHAR(45) NOT NULL ,
`sizeMB` DOUBLE NOT NULL ,
PRIMARY KEY (`idsizeTable`) ,
INDEX `dateIndex` (`insertdate` ASC) )
ENGINE = InnoDB;
3) schedule the sql to collect statistics:
create event stat_db_evt
on schedule
every 24 hour
do
insert into stat.sizeTable (insertdate,databaseName, sizeMB) SELECT NOW() as insertdate, table_schema databaseName, sum( data_length + index_length ) / 1024 / 1024 sizeMB FROM information_schema.TABLES GROUP BY table_schema;
Thar is all. This script will run every 24 hours and collect the statistics into the table, which you can analyze later.
This blog is a collection of minds around linux, java, javascript, etc. Looking for great opportunities.
четверг, 27 июня 2013 г.
суббота, 22 июня 2013 г.
пятница, 14 июня 2013 г.
OCPJP 7 Passed!
Yesterday I have passed 1z0-804 and earned the OCPJP status! Yeah!
So, what did I use for my preparation:
So, what did I use for my preparation:
- Book Oracle Certified Professional Java SE 7 Programmer Exams by Ganesh and Sharma.
- Tests from http://enthuware.com.
Подписаться на:
Сообщения (Atom)